mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
Instead, use the `%target-swift-5.1-abi-triple` substitution to compile the tests for deployment to the minimum OS versions required for use of _Concurrency APIs.
34 lines
848 B
Swift
34 lines
848 B
Swift
// RUN: %target-run-simple-swift(-parse-as-library -target %target-swift-5.1-abi-triple %import-libdispatch) | %FileCheck %s
|
|
|
|
// REQUIRES: executable_test
|
|
// REQUIRES: concurrency
|
|
// REQUIRES: libdispatch
|
|
// REQUIRES: concurrency_runtime
|
|
// UNSUPPORTED: back_deployment_runtime
|
|
|
|
// REQUIRES: rdar114644156
|
|
|
|
// doesn't matter that it's bool identity function or not
|
|
func boolIdentityFn(_ x : Bool) -> Bool { return x }
|
|
|
|
actor FirstActor {
|
|
func startTest() { // whether startTest is async or sync doesn't matter
|
|
|
|
// do not remove this call or if-statement.
|
|
if boolIdentityFn(true) {}
|
|
|
|
}
|
|
|
|
deinit {
|
|
// CHECK: called deinit
|
|
print("called deinit")
|
|
}
|
|
}
|
|
|
|
@main struct RunIt {
|
|
static func main() async {
|
|
let actor = FirstActor()
|
|
await actor.startTest() // do not remove this call
|
|
}
|
|
}
|