Commit Graph

43 Commits

Author SHA1 Message Date
Hamish Knight
345619e9cb [test] Remove a test for linking against libraries in the resource dir
This is no longer a behavior we have in the new driver
(swiftlang/swift-driver#733).
2024-09-22 19:40:06 +01:00
Erik Eckstein
221ac85216 tests: disable a test in execution/interpret-with-dependencies.swift because it fails on some CI jobs 2024-07-31 10:00:00 +02:00
Kavon Farvardin
e4ed330077 NFC: simplify test and add assertion
This is a follow-up to clean-up https://github.com/apple/swift/pull/74372
2024-06-13 11:58:21 -07:00
Kavon Farvardin
273549239b AST: fix isWrittenWithConstraints
Surprisingly, there are some situations where an extension can end up
with _fewer_ constraints than the extended type. That was baked-in as an
assertion in this new-ish method.

I haven't figured out why that can happen in the reproducer only when
using `-interpret` mode. It didn't trigger the assertion for me when
compiling normally.

The fix is simple: check all the requirements, rather than using a
short-cut.

resolves rdar://125659789 / https://github.com/apple/swift/issues/72719
2024-06-12 17:20:49 -07:00
Allan Shortlidge
adda1f559d IRGen: Weakly link symbols for unavailable declarations.
When computing linkage, the compiler would treat unavailable declarations as if
they were "always available" when they lack an `introduced:` version:

```
// Library
@available(macOS, unavailable)
public func foo() {
  // …
}

// Client
import Library

@available(macOS, unavailable)
func bar() {
  // Even though foo() and bar() are unavalable on macOS the compiler still
  // strongly links foo().
  foo()
}
```

This created an unnecessary dependency between libraries and their clients and
also can interfere with back deployment, since unavailable declarations may not
be present in a library on all OS versions. Developers could work around these
issues by conditionally compiling the code that references an unavailable
declaration, but they shouldn't have to given that unavailable code is meant to
be provably unreachable at runtime. Additionally, it could improve library code
size if we allowed the compiler to strip unavailable declarations from a binary
completely.

Resolves rdar://106673713
2023-03-23 08:57:15 -07:00
Anthony Latsis
763df189e5 Gardening: Migrate test suite to GH issues: validation-test/execution 2022-09-19 22:35:26 +03:00
Ben Barham
c163e0fe5e [Tests] Make OS features consistent
lit.py currently allows any substring of `target_triple` to be used as a
feature in REQUIRES/UNSUPPORTED/XFAIL. This results in various forms of
the OS spread across the tests and is also somewhat confusing since they
aren't actually listed in the available features.

Modify all OS-related features to use the `OS=` version that Swift adds
instead. We can later remove `config.target_triple` so that these don't
the non-OS versions don't work in the first place.
2022-05-20 19:51:23 -07:00
Jonathan Grynspan
34a4d66481 [SR-15938] Error when referencing #dsohandle in a Swift test on Windows 2022-03-04 12:25:49 -05:00
Arnold Schwaighofer
ef0bb9932d Re-enable remote_run tests that were disabled
The underlying issue was supposedly fixed a while ago.
2021-08-03 13:51:15 -07:00
3405691582
e81534960c [validation] Fix some portability test issues.
Here we fix a few portability issues affecting running the validation tests on OpenBSD. The remaining failures will be dealt with separately.

1. In the `rth` tool, ensure `-z origin` is specified to the linker when
   using `$ORIGIN`, as required on this platform.

2. Explicitly set the rpath in the `dsohandle-multi-module` execution
   test, since the test uses built dynamic libraries during the test.

3. Erase the environment variable instead of using `env -u`, the latter
   of which is not portable.
2021-02-06 16:36:44 -05:00
Saleem Abdulrasool
af868e5c8f build: migrate towards the unified directory layout for modules
This changes the install layout to be similar across Darwin and
non-Darwin platforms.  This will enable simplifying the user experience,
build infrastructure, and the driver as the SDK layout converges towards
a single layout on all the platforms.
2020-09-13 17:46:54 -07:00
Mishal Shah
a3cd8bc9e9 [Tests] Codesign the binary before executing the test 2020-08-07 00:26:07 -07:00
Mishal Shah
84489d87b2 [Apple Silicon] Mark several tests that require the Swift interpreter accordingly 2020-07-02 16:26:10 -07:00
Doug Gregor
3095deb0f1 [Tests] Update with explicit SDK linking where we missed it. 2020-06-18 09:48:19 -07:00
David Zarzycki
5dcc32f98f Remove all uses of -force-single-frontend-invocation
The `-force-single-frontend-invocation` flag predates WMO and is now an
alias for `-whole-module-optimization`. We should use the latter and let
the former fade into history.
2020-05-08 06:37:41 -04:00
Saleem Abdulrasool
3cefb7b3f7 validation-test: mark test as XFAIL
TBD generation is not constrained to Darwin and it trips on the linker
synthetic `__ImageBase`.  XFAIL this until the TBD generation is either
constrained or is taught to ignore the synthetic.  This should
temporarily allow us to enable validation tests on Windows.
2019-12-14 22:15:01 -08:00
Saleem Abdulrasool
db9a6cae4d validation-test: refactor the test invocation (NFC)
This just uses the `%target-build-swift-dylib` instead of
`%target-build-swift` substitution along with `%target-library-name` to
ensure that we are target independent.
2019-06-04 13:05:42 -07: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
Devin Coughlin
b9256d8337 [Tests] Disable backward deployment tests requiring ASan
Test requiring ASan are currently failing on internal bots that test
back deployment because of a test infrastructure problem with ASan bac
 deployment.

Mark those tests as unsupported for remote_run (which is currently only used
for those back-deployment tests) until we can address the underlying issue.
2019-01-17 16:10:58 -08:00
Jordan Rose
62c4036f69 Add a regression test for SR-9624 (#21741)
It got fixed somewhere along the way in Swift 5.
2019-01-09 11:06:31 -08:00
Saleem Abdulrasool
8968fcad5f test: create and use target-library-name 2018-12-12 08:37:59 -08:00
Saleem Abdulrasool
b212229db1 test: add and use prefix substitutions for libraries
The naming convention is different on Windows than on Unix-like
environments.  In order to follow the convention we need to substitute
the prefix and the suffix.  Take the opportunity to rename the
`target-dylib-extension` to the CMake-like variable
`target-shared-library-suffix` and introduce
`target-shared-library-prefix`.  This helps linking the test suite
binaries on Windows.
2018-12-11 15:56:06 -08:00
Jordan Rose
01a0de27ec [test] Update for remote-run-ing tests on a different macOS (#18966)
Most of this is just "remember to specify the inputs and outputs on
the command line, so remote-run can see them". A bit is "prefix
environment variables with '%env-'". And the last few are "yeah,
this was never going to work in a remote environment".

In the few cases where I couldn't think of anything reasonable, I just
marked the test as "UNSUPPORTED: remote_run", a new "feature".
2018-08-27 14:50:40 -07:00
Slava Pestov
a86a71de1e Runtime/IRGen: Two-phase metadata initialization for non-resilient classes
Note that this patch also consolidates the recursive metadata tests
into one place while adding an execution test.
2018-08-20 16:23:07 -07:00
Arnold Schwaighofer
7e4ce9a575 Codesign more tests 2018-08-10 06:58:40 -07:00
Michael Gottesman
c48196f892 Fix the build by making the test arc_36509461.swift only run on macosx.
rdar://36916944
2018-01-29 10:32:37 -08:00
Michael Gottesman
75c0572afa As per Jordan's request, move execution_crashers => execution.
I thought these were all execution time crashers, but I was incorrect. Some are
just execution tests that take a little bit to run.
2018-01-29 10:31:51 -08:00
Michael Gottesman
5947e04298 Rename ./validation_test/execution => execution_crashers to match the names of the compiler_crasher. 2018-01-26 12:19:20 -08:00
Erik Eckstein
76f281510f Remove @_semantics("optimize.sil.never")
The replacement is @_optimize(none)
2017-11-16 14:11:52 -08:00
Slava Pestov
8b73de60a9 IRGen: Remove GenericTypeRequirements::ParentType
Finally, remove the parent type metadata argument from type
constructors.

Now that type constructors don't take a parent metadata pointer,
we can hit some asserts concerning type constructors that do not
have any parameters. This happens when you define a concrete type
in a fully-constrained extension of a generic type.

A more efficient ABI would use concrete type metadata for these
cases, but that would be a bigger change that we can do later, so
for now just relax these assertions.

This resolves a runtime crasher since a circular metadata case is
no longer circular. I renamed the crasher to reference the more
specific radar since the more general issue of circular metadata
is still unresolved.
2017-09-25 15:45:17 -07:00
Robert Widmann
6509f78f13 tests: replace remaining 'mkdir -p' calls with %empty-directory(...)'
These changes were made manually.
2017-06-04 11:08:39 -07:00
Dmitri Gribenko
486cab447d tests: replace 'rm -rf %t && mkdir -p %t' with '%empty-directory(%t)'
These changes were made using a script.
2017-06-04 11:08:39 -07:00
Slava Pestov
aeb6887fe1 Adjust rdar18157434.swift to pass with optimizations
The optimizer was deleting the allocation altogether.

Fixes one of the three failures outlined in <rdar://problem/31780356>.
2017-04-24 00:52:10 -07:00
Slava Pestov
3749a0066d Add a couple of crashers 2017-04-23 01:49:02 -07:00
Dmitri Gribenko
55864d10cb Tests: use 'mkdir -p' 2016-09-02 21:36:45 -07:00
Dmitri Gribenko
d175b3b66d Migrate FileCheck to %FileCheck in tests 2016-08-10 23:52:02 -07:00
David Farler
cda5aef65c Restrict dsohandle-multi-module.swift test to OS X
Investigating a problem with execution tests on other platforms
when building multiple dylibs and an executable that builds them.

rdar://problem/27620565
2016-07-29 17:56:45 -07:00
David Farler
1d075adfb7 Add execution test for #dsohandle: multiple images
There wasn't an execution test involving #dsohandle, so add one here.
Also, the DSO handle coming from different modules should never be
the same.

rdar://problem/26565092
2016-07-29 14:37:44 -07:00
Jordan Rose
90c5cfea4d [test] Add a Linux test for indirect link dependencies relying on -L.
This is the Linux equivalent of 3731a2ff0. There's probably a way to
merge them into one file cleanly, but the extra linker args on OS X
make it a little tricky. I'm deciding not to worry about it right now.
2015-12-04 17:58:27 -07:00
Jordan Rose
4f9367041f [Driver] Always use the runtime resource library path for DYLD_LIBRARY_PATH.
...when interpreting. Otherwise, the script may depend on library X, which
depends on library Y, where library Y is a standard Swift library, located
in lib/swift/$PLATFORM/.

Finishes rdar://problem/23588774
2015-12-04 12:18:48 -08:00
Jordan Rose
3731a2ff0c [test] Add a test for indirect link dependencies relying on -L.
...as described in rdar://problem/23588774. We don't really have a good way
to make this test cross-platform as such, but I'll add a Linux version soon.
2015-12-04 12:18:47 -08:00
Arnold Schwaighofer
4d4329b0e0 Add executable_test to the validation test suite
Swift SVN r29278
2015-06-03 23:28:43 +00:00
Jordan Rose
13e8137113 [test] Add more testability tests, including execution tests.
Swift SVN r26785
2015-04-01 01:12:25 +00:00