Commit Graph

172 Commits

Author SHA1 Message Date
Gabor Horvath
61520d28cf Partially reenable test
A big test was disabled due to one module failing to verify with
sil-opt. This PR reenables the test for all other modules to catch
errors while this particular problem is being looked into.

rdar://143050566
2025-03-24 18:53:29 +00:00
Ian Anderson
517ced4f4b [ClangImporter][Tests] clang doesn't support the empty string as a path argument
SIL/verify_all_overlays.py is passing `-F ""` on non-Apple platforms. Swift handles that kind of, but clang doesn't support it and will get argument parsing errors. It's a pathological case, so fix SIL/verify_all_overlays.py to not do that, but also add a failsafe in ClangImporter to not pass on empty paths.

rdar://142441042
2025-02-03 13:06:32 -08:00
Arnold Schwaighofer
ed3a6d1090 verify_all_overlays.py : This test blocks the nightly toolchain and the failure is being worked on
Temporarily disable it.

rdar://143050566
2025-01-29 13:30:28 -08:00
Alastair Houghton
100f2615cb [Tests] Enable C++ interop for Runtime in the overlay verification test.
The Runtime module requires C++ interop enabled, because that's
the only way to robustly fix things so that it is able to declare various
types and constants without clashing with system headers.

To make this work, we also need to add a missing invocation to sil-opt to
make it pick the correct C++ runtime library.

rdar://143050566
2025-01-28 14:21:50 +00:00
Alastair Houghton
760cc57bef [Backtracing] Rename _Backtracing to Runtime.
Move the backtracing code into a new Runtime module.  This means renaming
the Swift Runtime's CMake target because otherwise there will be a name
clash.

rdar://124913332
2025-01-17 10:09:36 +00:00
Alexis Laferrière
a046a0d6b7 Tests: Disable verify_all_overlays on Linux platforms 2025-01-07 11:59:53 -08:00
Kavon Farvardin
ca25edb848 XFAIL parse_stdlib.sil temporarily 2024-03-14 23:10:44 -07:00
Ian Anderson
288f37b2c1 [Concurrency] [shims] Don't declare exit in the concurrency shims
Don't delete the OS declaration of `exit` because the concurrency shims aren't always imported, and so the shim declaration might not always be available.
Don't override the OS declaration of `exit` in the concurrency shims since we can't just delete the OS one. Instead, set up internal shims just for building Concurrency that forward declares `exit`.
2024-01-29 16:25:46 -08:00
John McCall
41cdfb04ad Introduce a proper TypeAttribute class hierarchy.
The old TypeAttributes reprsentation wasn't too bad for a small number of
simple attributes.  Unfortunately, the number of attributes has grown over
the years by quite a bit, which makes TypeAttributes fairly bulky even at
just a single SourceLoc per attribute.  The bigger problem is that we want
to carry more information than that on some of these attributes, which is
all super ad hoc and awkward.  And given that we want to do some things
for each attribute we see, like diagnosing unapplied attributes, the linear
data structure does require a fair amount of extra work.

I switched around the checking logic quite a bit in order to try to fit in
with the new representation better.  The most significant change here is the
change to how we handle implicit noescape, where now we're passing the
escaping attribute's presence down in the context instead of resetting the
context anytime we see any attributes at all.  This should be cleaner overall.

The source range changes around some of the @escaping checking is really a
sort of bugfix --- the existing code was really jumping from the @ sign
all the way past the autoclosure keyword in a way that I'm not sure always
works and is definitely a little unintentional-feeling.

I tried to make the parser logic more consistent around recognizing these
parameter specifiers; it seems better now, at least.
2024-01-28 22:30:26 -05:00
Saleem Abdulrasool
dff40e9399 Cxx: mark as fragile
This library is still fragile as C++ Interop is in preview. Mark it as
fragile to match cxxStdlib.
2023-08-25 11:31:36 -07:00
Alastair Houghton
a890ec2c0f [Backtracing][Linux][Tests] Fix verify_all_overlays test.
The `_Backtracing` module has a number of private implementation only
imports that aren't used outside of the module and that don't require
any additional libraries (hence they aren't relevant to the outside
world).  `verify_all_overlays.py` needs to know about these when it
does its test, because it loadas the module as the main module, which
results in implementation only imports being required instead of
ignored.

rdar://110261712
2023-06-07 09:03:50 +01:00
Anthony Latsis
d650ce47f3 SILOptimizer: Fix some issues with CSE of open_existential_ref
* A direct user might have a dependent result
* An indirect user can also be a terminator instruction
2023-03-13 21:41:02 +03:00
Egor Zhdan
063be28a54 [cxx-interop] Update the C++ stdlib module name in SIL/verify_all_overlays.py 2023-01-26 19:19:46 +00:00
Anthony Latsis
6192ffde27 Gardening: Migrate test suite to GH issues: validation-test/SIL 2022-09-20 02:32:29 +03:00
Egor Zhdan
d738a64b02 [cxx-interop] Do not run SIL/verify_all_overlays.py on std
rdar://93420692
2022-05-17 16:10:40 +01:00
Daniel Duan
3dfc40898c [NFC] Remove Python 2 imports from __future__ (#42086)
The `__future__` we relied on is now,  where the 3 specific things are
all included [since Python 3.0](https://docs.python.org/3/library/__future__.html):

* absolute_import
* print_function
* unicode_literals
* division

These import statements are no-ops and are no longer necessary.
2022-04-13 14:01:30 -07:00
Robert Widmann
1afdb47271 Un-XFAIL Stdlib Validation Test 2022-03-15 21:07:57 -07:00
Erik Eckstein
6a020f8f15 Stabilize and simplify SIL linkage and serialization
The main point of this change is to make sure that a shared function always has a body: both, in the optimizer pipeline and in the swiftmodule file.
This is important because the compiler always needs to emit code for a shared function. Shared functions cannot be referenced from outside the module.
In several corner cases we missed to maintain this invariant which resulted in unresolved-symbol linker errors.

As side-effect of this change we can drop the shared_external SIL linkage and the IsSerializable flag, which simplifies the serialization and linkage concept.
2022-03-09 15:28:05 +01:00
Evan Wilde
6956b7c5c9 Replace /usr/bin/python with /usr/env/python
/usr/bin/python doesn't exist on ubuntu 20.04 causing tests to fail.
I've updated the shebangs everywhere to use `/usr/bin/env python`
instead.
2021-09-28 10:05:05 -07:00
Andrew Trick
797461673f Temporarily disable long test parse_stdlib.sil
rdar://81658645 (Swift CI: 1. OSS - Swift (Tools Opt+Assert, Stdlib
Opt+DebInfo+Assert, Long Test) - macOS (main);
parse_stdlib.sil.tmp.sil: error: expected '>' in SIL instruction)
2021-08-07 15:19:01 -07:00
Erik Eckstein
8cebf1bde9 temporarily disable checking of DifferentiationUnittest in SIL/verify_all_overlays.py 2021-02-24 16:02:14 +01:00
Michael Gottesman
1de2d3f7c0 [ast] Enable the ASTVerifier behind the enable-ast-verifier flag in no-asserts builds.
This follows the design of how we handled this with
sil-verify-all. Specifically, the default behavior is to run only in asserts
builds, but one can use the two flags: enable-ast-verifier and
disable-ast-verifier to override the default behavior.

The reason why this is interesting is that this means that when compiling
normally, we will not run the verifier, so we won't have a perf hit. But we can
now ask the user to run with this flag (or in a future maybe a re-run in the
driver would do this for them), saving us time when screening bugs by avoiding
the need to build an asserts compiler to triage if the ASTVerifier would catch
the bug.
2021-01-25 11:55:47 -08:00
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