Skip to content

Commit 14be8f7

Browse files
committed
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.
1 parent 4288ab4 commit 14be8f7

File tree

3 files changed

+26
-1
lines changed

3 files changed

+26
-1
lines changed

stdlib/public/BackDeployConcurrency/CMakeLists.txt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,8 @@ set(swift_concurrency_options
4747
DARWIN_INSTALL_NAME_DIR "@rpath")
4848
set(swift_concurrency_extra_sources
4949
"../BackDeployConcurrency/Exclusivity.cpp"
50-
"../BackDeployConcurrency/Metadata.cpp")
50+
"../BackDeployConcurrency/Metadata.cpp"
51+
"../stubs/SwiftNativeNSObject.mm")
5152
set(swift_concurrency_async_fp_mode "never")
5253

5354
add_subdirectory(../Concurrency stdlib/public/BackDeployConcurrency)

test/Concurrency/Backdeploy/mangling.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
// REQUIRES: CPU=x86_64
1616
// REQUIRES: OS=macosx
1717
// REQUIRES: executable_test
18+
// REQUIRES: concurrency_runtime
1819
actor MyActor { }
1920

2021
protocol MyProtocol {
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
// RUN: %empty-directory(%t)
2+
// RUN: %target-build-swift -target x86_64-apple-macosx10.15 %s -o %t/test_mangling -Xfrontend -disable-availability-checking -parse-as-library
3+
// RUN: %target-run %t/test_mangling
4+
5+
// REQUIRES: CPU=x86_64
6+
// REQUIRES: OS=macosx
7+
// REQUIRES: executable_test
8+
// REQUIRES: concurrency_runtime
9+
10+
import Foundation
11+
12+
@objc actor MyActor {
13+
func f() -> String { "hello" }
14+
}
15+
16+
@main
17+
enum Main {
18+
static func main() async {
19+
let ma = MyActor()
20+
let greeting = await ma.f()
21+
assert(greeting == "hello")
22+
}
23+
}

0 commit comments

Comments
 (0)