Commit Graph

42 Commits

Author SHA1 Message Date
Becca Royal-Gordon
fd84e7273d Rename module.map -> module.modulemap in tests
The legacy `module.map` spelling of module map files was deprecated by llvm/llvm-project#75142 and clang expects to remove support for them in the future. Switch all tests to use the supported spelling.

Fixes rdar://128431478.
2024-08-12 17:47:26 -07:00
Kavon Farvardin
6e1bd47d61 Revert "Disable test Runtime/issue-51181.swift"
This reverts commit dfcdf16a72.
2024-07-01 09:15:07 -07:00
Meghana Gupta
5ced6cc00d Disable test Runtime/issue-51181.swift 2024-04-09 12:57:51 -07:00
Yuta Saito
e52b155a9c [test] Disable multithreading tests on threading_none 2023-10-11 18:14:43 +00:00
Yuta Saito
4c8dc5bcb8 [test] Replace obsolete single_threaded_runtime feature with threading_none
The feature was renamed in 0cf687aa2b but
validation tests were not updated at that time.
2023-10-11 18:14:43 +00:00
Anthony Latsis
b2f386d521 Gardening: Migrate test suite to GH issues: validation-test/Runtime 2022-09-19 22:58:06 +03:00
Alastair Houghton
67304e56fb [Test] Remove nonexistent library from target-run command.
This caused tests to fail if they were running remotely, but not locally.

rdar://99627836
2022-09-07 11:21:38 +01:00
Yuta Saito
687dca9d60 [Threading][test] disable threaded lit tests under threading_none 2022-07-07 01:57:38 +00:00
Nate Chandler
5aa3cf6d6c [Test] Mark two unsupported for backdeploy.
They depend on new runtime changes.
2022-04-04 14:52:03 -07:00
Nate Chandler
08bf645ef7 [Test] Check multipayload empty case wrapping.
Verify the behavior of swift_storeEnumTagMultiPayload in the face of
small payload sizes (8 bits) and many empty cases (more than 2^8).

Additional test of the behavior that was fixed at
https://github.com/apple/swift/pull/42131
2022-04-01 08:30:35 -07:00
Nate Chandler
f12a321045 [Runtime] Fixed multi-payload empty-case masking.
When storing a tag into a multi-payload enum for an empty case via
swift_storeEnumTagMultiPayload, the tag is split between the storage for
payloads (i.e. the associated values of the non-empty cases) and the
storage for tags (i.e. the integers which refer to the non-empty cases).

Typically, the number of non-empty cases (i.e. one beyond the tag
that refers to the last non-empty case) is stored into the tag storage
and the integer which distinguishes which among the empty cases the enum
is in is stored into storage for payloads.  When the enum is small,
however--specifically, when the payload size is less than four
bytes--that information is packaged differently via masking.

Previously, there was a problem with that masking.  While the value
stored into the tag storage was correct (and correctly indicated that
the enum was in some empty case), the value stored into the payload
storage was not.  The result was that which empty case an enum was in
would be corrupted.

Here, that is fixed by fixing the masking.

rdar://87914343
2022-03-31 21:09:36 -07:00
Karoy Lorentey
83fee79056 [test] rdar://85620934 Fix back deployment vs exclusivity checking tests 2021-11-30 17:29:10 -08:00
Yuta Saito
722d790480 [test] mark multi-thread based tests as UNSUPPORTED in single-thread
Some of test cases assumes that the runtime is built for multi-threaded
platform.
2021-09-21 22:55:29 +00:00
Karoy Lorentey
4c12217157 [test] Add missing postprocessing phase to executable stress tests
We need to run utils/swift-darwin-postprocess.py on every executable test on Darwin platforms to work around a dyld issue. (And to ad-hoc sign executables on platforms that need it.)

Add a %target-codesign step to stress tests that are currently missing it.
2021-06-17 13:35:21 -07:00
Nate Chandler
6efadb051d [Test] Disabled several Runtime tests for back_deployment_runtime.
rdar://76567759
2021-04-13 15:42:33 -07:00
Robert Widmann
a4d76261f0 Pass -target to lit Tests instead of -arch
A follow-on to b436825948 where
-m${platform}-version-min was traded for -target. The lit substitution
for %target-clang was relying on -arch and -version-min to specify the
intended platform version to the linker. With the removal of
version-min, only arch was given, so a fallback platform was selected.
For the iPhone simulator, for example, this is iOS 10.99 despite there
being no such simulator for that deployment version. Provide the variant
triple everywhere instead. This has the added benefit of unifying the
special paths catalyst takes.

Fixes rdar://73174820
2021-01-14 13:33:30 -08:00
Ben Barham
86c292c10c [Test] Temporarily disable tests blocking PR testing 2021-01-14 12:09:14 +10:00
Mike Ash
4ccfdfb72a [Runtime] Fix StableAddressConcurrentReadableHashMap threading crash.
StableAddressConcurrentReadableHashMap::getOrInsert had a race condition in the first lookup, where the snapshot was destroyed before the pointer was extracted from the returned wrapper. Fix this by creating the snapshot outside the if so that it stays alive.

rdar://problem/71932487
2020-12-21 16:52:56 -05:00
Kuba (Brecka) Mracek
9de7b59388 Subsume SWIFT_STDLIB_USE_NONATOMIC_RC into SWIFT_STDLIB_SINGLE_THREADED_RUNTIME (#33643) 2020-08-26 21:28:30 -07:00
Nate Chandler
086e4a356e [Test] Don't use os stdlib for Runtime/rdar64672291.swift. 2020-07-11 09:30:13 -07:00
Nate Chandler
c6812cee68 [Test] Mark executable test appropriately. 2020-07-10 06:21:11 -07:00
Nate Chandler
9e6d68e45b [Runtime] Let existential types satisfy superclass requirements.
Previously, when an attempt was made to instantiate a generic metadata
whose argument was constrained to subclass a superclass Super with an
existential type E that had a superclass constraint to a subclass Sub of
that same superclass Super, the instantiation would fail at runtime,
despite the fact that the generic instantiation was allowed to
type-check.

The result was a runtime failure to instantiate generic metadata
resulting eventually in a crash.

Here, handling for that situation is added.  When checking generic
requirements at runtime, when a superclass requirement is encountered,
an existential type is checked for.  If that existential type has a
superclass constraint and if that superclass constraint is a subclass of
the superclass requirement, the check is determined to be satisfactory.

rdar://problem/64672291
2020-07-02 17:19:55 -07:00
Slava Pestov
8e35609df2 IRGen: Sign the class stub initialization callback pointer on arm64e
The Objective-C runtime expects a signed pointer here. The existing test
would have caught this, except it was always disabled because the
symbol name passed to the dlsym() check should not have had the leading
'_'.

Fixes <rdar://problem/57679510>.
2020-05-01 21:55:11 -04:00
Julian Lettner
105e4ad592 [TSan] Add positive test for TSan + Dispatch on Linux
1) Enable tests that use `import Dispatch` on Linux. Add substitution
   `%import-libdispatch` that needs to be used for all cross-platform
   tests (i.e., tests that are intended to be run on other platforms
   than Darwin) that do `import Dispatch` or enable thread sanitizer.

2) Make sure as many existing Dispatch and TSan tests as possible run on
   Linux. Mark tests that would require substantial work with
   `UNSUPPORTED: OS=linux-gnu`.

3) Add integration-style Swift test that shows that TSan finds a simple
   race when using `Dispatch.async` incorrectly. A more complete test
   suite for TSan's libdispatch support lives on the LLVM/compiler-rt
   side.

rdar://problem/49177535
2019-06-10 14:24:53 -07:00
mishal_shah
1e38fc3030 Update master to build with Xcode 11 beta, macOS 10.15, iOS 13, tvOS 13, and watchOS 6 SDKs 2019-06-03 22:50:02 -07:00
Slava Pestov
5d66bb810a Run stable ABI tests on all Apple platforms
A number of tests exercise features only available in Apple OSes that
shipped with Swift 5.0 in the OS; this includes the following versions:

- macOS 10.14.4
- iOS 12.2
- tvOS 12.2
- watchOS 5.2

Previously these tests were restricted to running on macOS only, with
an explicit -target x86_64-apple-macosx10.14.4. To get better test
coverage, add a new %target-stable-abi-triple substitution which
expands to a triple with the correct OS version on all Apple platforms.

On non-Apple platforms, this is the same as %target-variant-triple,
but for now any test that uses this exercises Apple platform features
anyway.

One caveat is that since iOS 12.2 does not have a 32-bit slice, we
have to skip any tests that use -target %target-stable-abi-triple
on this platform. A new swift_stable_abi feature flag can be tested
with 'REQUIRES: swift_stable_abi'. To get maximum test coverage,
I split off a 'stable_abi' version of a few tests that build with both
an old and new deployment target. This allows the old deployment
target case to still be tested on 32-bit iOS.
2019-05-16 17:02:06 -04:00
Slava Pestov
52fbe642ed Fix REQUIRES lines on class stubs tests
We use the just-built clang without any -target or -sdk flags. Keep things
simple and limit the test to macOS for now.

Fixes <rdar://problem/50586614>.
2019-05-08 22:22:27 -04:00
Nathan Hawes
af3fbc52b3 Revert "Add tests for weak-linked class stubs" 2019-05-08 10:55:00 -07:00
Slava Pestov
9f4b86b741 Add test for weak-linked Objective-C resilient class stubs 2019-05-07 16:34:56 -04:00
Slava Pestov
fbd8b97351 Un-XFAIL validation-test/Runtime/class_stubs.m and adjust for Clang changes
The objc_loadClassref() symbol is weak linked from Clang now, so we can
un-XFAIL this test. Note that we have to pass a special flag to Clang
since objc_loadClassref() is not in the SDK's TBD files yet.

Also, change the test to use its own asserts instead of FileCheck since
there's no output unless a new libobjc is available.
2019-05-07 16:31:40 -04:00
Slava Pestov
9536eff2d6 Execution tests for Objective-C resilient class stubs
Fixes <rdar://49090613>, except they're disabled for the time being.
2019-04-19 17:39:51 -04:00
Slava Pestov
1159af50d9 Rename -enable-resilience to -enable-library-evolution and make it a driver flag
Fixes <rdar://problem/47679085>.
2019-03-14 22:24:26 -04:00
Julian Lettner
c0674b7ef8 [testsuite] Allow libdispatch tests to run on non-Apple platforms
The lit feature `objc_interop` is used as a proxy for the availability
of libdispatch and Foundation.

Although we don't support Obj-C on non-Apple platforms, we support
libdispatch and Foundation. Let's break up `objc_interop` into
finer-grained categories so we can run more tests on non-Apple
platforms.

This patch adds lit features `libdispatch` and `foundation` (currently
only enabled on Apple platforms) and removes the `objc_interop`
dependency from libdispatch tests.
2019-03-08 16:53:40 -08:00
Slava Pestov
2633c9d063 Fix old_runtime_crash_without_fixed_layout.swift to pass when optimizations are on
@_optimize(none) does not prevent LLVM from optimizing the function, and the LLVM
optimizer was able to inline blackHole() and elide the metadata access altogether.
2019-02-22 21:10:18 -05:00
Slava Pestov
6ac91701dd Runtime: Add precondition check to swift_updateClassMetadata()
This initialization pattern can only be used if there is a backward deployment
layout (IRGen calls this ClassMetadataStrategy::FixedOrUpdate) or if we are
running on a newer Objective-C runtime that supports class metadata update
hooks (IRGen calls this ClassMetadataStrategy::Update).

If neither condition holds, we must trap here to avoid undefined behavior.
2019-02-18 22:39:13 -05:00
Slava Pestov
eec0fcdf49 IRGen: When available, use ClassMetadataStrategy::Update even if we don't have legacy type info
If we know our deployment target has a new Objective-C runtime, we can
emit fixed metadata for classes with resilient types even if those
types do not appear in the YAML legacy type info.

Fixes <rdar://problem/47649465>.
2019-02-18 22:39:13 -05:00
Slava Pestov
32954fc463 Use -read-legacy-type-info-path in Runtime/class-layout-from-objc.m test 2019-02-08 14:22:00 -05:00
Jordan Rose
73fba19a97 [test] Tweak class-layout-from-objc.m to avoid macros named "check"
rdar://problem/47389594
2019-01-18 16:41:38 -08:00
Jordan Rose
7629253ab5 Test that newer libobjcs let the Swift runtime set up a class's layout (#21942)
Specifically, when the class is referenced from Objective-C first,
before being referenced from Swift in any way. This is important for
resilience, since up until now Objective-C isn't used to the size of a
class changing based on anything other than a superclass's size
changing.

This is basically the test that would have gone with 9024768b0 had
there been a build of libobjc to test it with.

rdar://problem/45718008
2019-01-17 17:39:44 -08:00
Andrew Trick
e560125d20 Create RuntimeUnittest library for C++ runtime unit tests from lit.
Create a new RuntimeUnittest library alongside the other stdlib unit
tests so we can write C++ runtime unit tests callable from lit.

Move runtime exclusivity tests into the stdlib unittest library and
create lit tests so we can verify that the runtime crashes with an
error message.
2018-10-13 10:06:35 -07:00
Doug Gregor
9565f0d753 [Test] Add test for SR-8666 / rdar://problem/43893945.
This test case crashed at runtime in Swift 4.2, but is now fixed. Add it
so that we don't regress.
2018-10-06 22:12:55 -07:00
David Zarzycki
c00c18fc68 [Tests] Consolidate stress/long tests in validation-tests 2018-03-20 22:19:37 -04:00