Commit Graph

5 Commits

Author SHA1 Message Date
Kuba (Brecka) Mracek
7853184ed6 Enable running tests from test/Concurrency/ directory in freestanding/minimal presets (#61835)
* Enable running tests from test/Concurrency/ directory in freestanding/minimal presets

* Mark failing Concurrency tests as XFAIL/SKIP on freestanding/minimal
2022-11-04 09:07:27 -07:00
Doug Gregor
104271ce9e Minor concurrency test requirement cleanups 2022-06-13 12:04:16 -07:00
Doug Gregor
b43e864b3f Generalize tests for Apple Silicon 2022-06-06 14:37:17 -07:00
Doug Gregor
2551a04621 Back-deploy @objc actor types.
@objc actors implicitly inherit from the new, hidden
`SwiftNativeNSObject` class that inherits from `NSObject` yet provides
Swift-native reference counting, which is important for the actor
runtime's handling of zombies. However, `SwiftNativeNSObject` is only
available in the Swift runtime in newer OS versions (e.g., macOS
12.0/iOS 15.0), and is available in the back-deployed _Concurrency
library, but there is no stable place to link against for
back-deployed code. Tricky, tricky.

When back-deploying @objc actors, record `NSObject` as the superclass
in the metadata in the binary, because we cannot reference
`SwiftNativeNSObject`. Then, emit a static initializer to
dynamically look up `SwiftNativeNSObject` by name (which will find it
in either the back-deployment library, on older systems, or in the
runtime for newer systems), then swizzle that in as the superclass of
the @objc actor.

Fixes rdar://83919973.
2021-10-05 23:04:57 -07:00
Doug Gregor
0ab6355e7c Include SwiftNativeNSObject in the back-deployed concurrency library.
SwiftNativeNSObject is part of the core runtime on OS versions that
also have the concurrency library, so we need to include a copy of
it with the back-deployed concurrency library.
2021-10-03 22:06:59 -07:00