Commit Graph

150 Commits

Author SHA1 Message Date
marcrasi
dccb75c810 [AutoDiff] disable SIL/verify_all_overlays.py for "_Differentiation"
It is failing so I'll disable it to fix the tests until we fix it.
2020-04-01 12:07:39 -07:00
Nathan Hawes
168a9ba318 [test] Remove orphaned comment from validation-test/SIL/verify_all_overlays.py 2020-03-02 15:12:08 -08:00
Nathan Hawes
68ad8acded [test] remove xfail on validation-test/SIL/verify_all_overlays.py
Looks like it started passing:
https://ci.swift.org/job/oss-swift_tools-RA_stdlib-RDA_long-test/3521/
2020-03-02 11:01:10 -08:00
Dan Zheng
9600b9737a [SIL] Fix use-after-free in SILFunction::print. (#29949)
Fix use-after-free in helper function `printSILFunctionNameAndType`.
The address of a `DenseMap` local variable is used after the function returns.

Resolves SR-12239.
2020-02-20 17:53:38 -08:00
Hamish Knight
312f7ddc50 Parse Swift decls in one shot
Instead of interleaving typechecking and parsing
for SIL files, first parse the file for Swift
decls by skipping over any intermixed SIL decls.
Then we can perform type checking, and finally SIL
parsing where we now skip over Swift decls.

This is an intermediate step to requestifying the
parsing of a source file for its Swift decls.
2020-02-04 13:04:50 -08:00
Rintaro Ishizaki
4eadbaa9f6 Revert "Merge pull request #27466 from rintaro/syntaxparse-type"
This reverts commit a4fcd26b38, reversing
changes made to 88ecae4b9a.
2019-10-14 12:19:04 -07:00
Rintaro Ishizaki
f88fb20a01 [SyntaxParse] Mark a SIL crasher test case "fixed" 2019-10-01 17:55:41 -07:00
Jordan Rose
7a509422b3 [test] sil-opt doesn't support -Fsystem; use -F
Fix-up for bb0f0c8397 (rdar://problem/48513002).
2019-03-01 17:23:56 -08:00
Jordan Rose
bb0f0c8397 [test] -Fsystem $SDK/System/Library/PrivateFrameworks (#23019)
Otherwise certain modules don't import correctly when built against an
Apple-internal SDK. Should have no effect when using the public SDK,
but we try to minimize divergence between the public and
Apple-internal test suites.

rdar://problem/48513002
2019-03-01 14:26:20 -08:00
Jordan Rose
8521015407 [test] Add proper search paths for XCTest in verify_all_overlays.py (#22994)
This turns out to be the only problem on iOS and tvOS. Oops! macOS
still has some actual failing overlays as tracked by SR-9847.

(We should also add this search path to
ParseableInterface/verify_all_overlays.py.)

rdar://problem/48458622
2019-02-28 15:04:11 -08:00
Jordan Rose
d17602a847 [test] Un-XFAIL a test for watchOS (#22813)
Whatever bug is happening in https://bugs.swift.org/browse/SR-9847,
the watchOS overlays aren't hitting it.

rdar://problem/48280638
2019-02-25 09:41:22 -08:00
Jordan Rose
43feb9cbe1 On Apple platforms, use swiftmodule directories for the stdlib (#21797)
This changes the Swift resource directory from looking like

    lib/
      swift/
        macosx/
          libswiftCore.dylib
          libswiftDarwin.dylib
          x86_64/
            Swift.swiftmodule
            Swift.swiftdoc
            Darwin.swiftmodule
            Darwin.swiftdoc

to

    lib/
      swift/
        macosx/
          libswiftCore.dylib
          libswiftDarwin.dylib
          Swift.swiftmodule/
            x86_64.swiftmodule
            x86_64.swiftdoc
          Darwin.swiftmodule/
            x86_64.swiftmodule
            x86_64.swiftdoc

matching the layout we use for multi-architecture swiftmodules
everywhere else (particularly frameworks).

There's no change in this commit to how Linux swiftmodules are
packaged. There's been past interest in going the /opposite/ direction
for Linux, since there's not standard support for fat
(multi-architecture) .so libraries. Moving the .so search path /down/
to an architecture-specific directory on Linux would allow the same
resource directory to be used for both host-compiling and
cross-compiling.

rdar://problem/43545560
2019-02-19 14:47:21 -08:00
Jordan Rose
1a4c5f5e0c [test] verify_all_overlays doesn't actually fail on watchOS
Further fix-up for 482d2baccd.
2019-02-05 14:12:15 -08:00
Jordan Rose
e9da05902c [test] Echo all failures to the same file
Fix-up for 482d2baccd. This slipped in while I was moving things
around, but fortunately that part of the test isn't currently failing.
2019-02-04 19:37:43 -08:00
Jordan Rose
482d2baccd Make verify_all_overlays.sil fail loudly instead of silently (#22325)
...then XFAIL it. Filed https://bugs.swift.org/browse/SR-9847 to look
into it later.
2019-02-04 11:53:25 -08:00
Michael Gottesman
fd4828e40a Eliminate -assume-parsing-unqualified-ownership-sil from tests.
I am doing this separately from the actual change to eliminate the option to
make it easier to review.
2018-12-19 12:54:13 -08:00
Harlan Haskins
66a61c5eca Rename @sil_stored to @_hasStorage 2018-11-12 11:32:32 -08:00
Michael Ilseman
1f9ff2a2e7 [test] un-XFAIL passing parse_stdlib test.
The problematic class no longer exists, so the test passes.
2018-11-06 09:20:48 -08:00
Doug Gregor
ab61aaeed1 Resolve two crashers and fix a test issue on Linux. 2018-09-15 23:01:51 -07:00
Graydon Hoare
8b8d0a2c6a Restrict a recent XFAILing long_test to assert configurations, rdar://38631299. 2018-03-19 16:00:23 -07:00
Jordan Rose
8dad8994c1 [test] Disable parse_stdlib.sil on Apple platforms to unblock builders (#14098)
Tracked within Apple by <rdar://problem/36754225> Swift CI:
parse_stdlib.sil tests failing with vtable verification. The error is
an assertion failure that we haven't traced back to its cause yet:

    Assertion failed: (EntriesSZ == VTableEntryCache.size() && "Cache
    size is not equal to true number of VTable entries"), function
    verify, file /Users/buildnode/jenkins/workspace/
    oss-swift-package-osx/swift/lib/SIL/SILVerifier.cpp, line 4747.
2018-01-24 08:45:09 -08:00
Jordan Rose
ace0f56e9c Be way more conservative about marking dependencies as non-cascading (#13214)
Being part of the type of a private declaration isn't sufficient,
because that could be used for the inferred type of a non-private
variable/constant/property.

Also, introduce a new kind of dependency test that shows both that a
file A changes its interface based on a change in another file B, and
that the swiftdeps output for file A includes the dependency on file B
as cascading.

https://bugs.swift.org/browse/SR-6149
2017-12-01 18:35:18 -08:00
Doug Gregor
5be25a690c Re-enable parse_stdlib test 2017-11-02 07:16:29 -07:00
Doug Gregor
00801f4c80 Disable the parse_stdlib test, again.
Recent work on witness tables broke it. We're (still) tracking this failure
via rdar://problem/34771322.
2017-11-01 16:09:35 -07:00
Doug Gregor
dfa9982edd Collapse the 17 “parse_stdlib” tests into a single test.
The sharding of this test buys us nothing, because it was only sharding
the AST verifier, which is an insignificant portion of the runtime
(and memory usage) of this test. Given that the test takes ~2m30s to run
and consumes > 2GB memory, having 17 copies of it running is a problem.
2017-11-01 16:02:20 -07:00
Doug Gregor
d17059c882 Re-enable parse_stdlib tests on macOS.
Our Linux CI is still running out of memory on these tests, but try to
reinstate macOS testing so we don't regress here.
2017-11-01 14:05:12 -07:00
Doug Gregor
945ac3de0a Revert " Re-enable parse_stdlib tests." 2017-11-01 06:59:35 -07:00
Doug Gregor
ef0f347885 Re-enable parse_stdlib tests.
Now that memory usage is (more) under control, re-enable the parse_stdlib
tests. Fixes rdar://problem/34771322.
2017-10-31 23:41:41 -07:00
Max Moiseev
0ace1ee7fe [long test] Enable verify_all_overlays test
The test was originally disabled but to timeouts that were supposedly caused by the new integer protocols. A few improvements have been implemented in the compiler as well as in the standard library since them, so it might no longer be a problem.
2017-10-10 13:37:41 -07:00
Jordan Rose
3dceaf1588 [test] Disable parse_stdlib tests on Mac too
We're running out of memory there as well. Fixing this is tracked
by rdar://problem/34771322.
2017-10-05 17:27:03 -07:00
Doug Gregor
092a8e789a Temporarily disable parse_stdlib tests on Linux.
They're breaking CI because we seem to be running out of memory (?).
Need to investigate.
2017-10-02 00:12:39 -07:00
John McCall
ab3f77baf2 Make SILInstruction no longer a subclass of ValueBase and
introduce a common superclass, SILNode.

This is in preparation for allowing instructions to have multiple
results.  It is also a somewhat more elegant representation for
instructions that have zero results.  Instructions that are known
to have exactly one result inherit from a class, SingleValueInstruction,
that subclasses both ValueBase and SILInstruction.  Some care must be
taken when working with SILNode pointers and testing for equality;
please see the comment on SILNode for more information.

A number of SIL passes needed to be updated in order to handle this
new distinction between SIL values and SIL instructions.

Note that the SIL parser is now stricter about not trying to assign
a result value from an instruction (like 'return' or 'strong_retain')
that does not produce any.
2017-09-25 02:06:26 -04:00
Slava Pestov
bf2ca1ab94 Sema/AST: Don't crash when stdlib declarations are missing
I don't have reduced test cases. The original test cases
were a series of frontend invocations in -parse-stdlib
mode.

While the original bugs seem to have been fixed, while
verifying I found a few places where we weren't checking
for null decls property in the ASTContext.

Probably not too useful to check this in, but I don't see it
causing any harm, either.
2017-08-06 00:43:23 -07:00
practicalswift
f280b69153 [gardening] Remove "REQUIRES: asserts" from fixed crashers. 2017-05-09 20:46:35 +02:00
Slava Pestov
edb1e97a35 SIL: Remove uncurryLevel from SILDeclRef
All we need to store is whether the SILDeclRef directly
references the declaration, or if it references a curry
thunk, and we already have an isCurried bit for that.
2017-05-09 00:56:35 -07:00
practicalswift
2facbde995 [gardening] Remove no longer needed "REQUIRES: asserts" 2017-05-04 15:22:45 +02:00
Slava Pestov
b5721e8d8e AST: Remove AnyObject protocol 2017-05-02 19:45:00 -07:00
Bob Wilson
32ff6de1cb Change REQUIRES arguments to work with recent LLVM versions
With more recent versions of LLVM (e.g., used with master-next) the
argument of REQUIRES is parsed as an expression. Do not use "rdar"
URLS for these since it confuses lit.
2017-05-01 15:15:22 -07:00
Jordan Rose
4b87bd93f9 Tweak DiagnosticEngine's 'aka' logic to only kick in for typealiases. (#9010)
Previously we had more ad hoc logic that tried to decide if it was
worth desugaring a type based on its structure. Now we instead look
for a typealias that might actually benefit from desugaring, and if
we don't find one we won't show the 'aka' note.
2017-04-25 19:37:22 -07:00
Erik Eckstein
acca5dcfec disable a test because it times out
rdar://problem/31683781
2017-04-18 10:08:55 -07:00
Slava Pestov
8201eaaa60 SIL: Change rule regarding shared_external linkage
The existence of a shared_external function in itself is not
an error; it just means we deserialized a witness table or
vtable but did not need to deserialize a thunk.

However, a direct reference to such a function is an error,
because we should have deserialized the body in that case.

This fixes a crasher, but the SIL crashers are kind of silly
because the SIL parser does not try at all not to crash on
invalid input.
2017-03-30 00:45:20 -07:00
Slava Pestov
8fe8b89b0f SIL: Terminology change: [fragile] => [serialized]
Also, add a third [serializable] state for functions whose bodies we
*can* serialize, but only do so if they're referenced from another
serialized function.

This will be used for bodies synthesized for imported definitions,
such as init(rawValue:), etc, and various thunks, but for now this
change is NFC.
2017-03-29 16:47:28 -07:00
practicalswift
c9e534d4ea [gardening] Fix annotations for fixed crashers 2017-01-07 21:05:03 +01:00
practicalswift
724e2efa02 [gardening] Remove "REQUIRES: asserts" from fixed crashers 2017-01-06 16:38:25 +01:00
Slava Pestov
f19cbef54d Sema: Try harder not to perform lookups into tuple types 2017-01-03 23:00:07 -08:00
Slava Pestov
48c529bf3b Resolve SIL crasher which started passing at some point 2017-01-03 20:15:30 -08:00
Pavel Yaskevich
fb3515382c [Diagnostics] When checking AssignExpr properly diagnose destination
Currently if destination is unresolved instead of trying to re-typecheck
it again and diagnose structural problems which led to such outcome, it
gets completely ignored in favor of trying to type-check source without
contextual type. That leads to missed diagnostic opportunities, which
results in problems on AST verification and SIL generation stages, and
generally missleading errors e.g. `.x = 0`.

Resolves: SR-3506.
2017-01-03 18:22:33 -08:00
practicalswift
f5f7064eb9 [gardening] Remove asserts from fixed crashers. 2016-12-21 21:17:06 +01:00
Slava Pestov
09dd5fec84 Sema: Small fixes 2016-12-21 14:20:27 -05:00
Mishal Shah
91822ee424 Revert "Disable tests until PR bots logging issue on Linux is fixed." 2016-12-21 12:05:03 +05:30