mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
back-deployment This test relies on `_swift_task_deinitOnExecutor`, which is only available in newer runtimes.
30 lines
498 B
Swift
30 lines
498 B
Swift
// RUN: %target-run-simple-swift(-target %target-future-triple) | %FileCheck %s
|
|
|
|
// REQUIRES: executable_test
|
|
// REQUIRES: concurrency
|
|
// REQUIRES: concurrency_runtime
|
|
// UNSUPPORTED: back_deployment_runtime
|
|
|
|
var isDead: Bool = false
|
|
|
|
public class Foo {
|
|
@MainActor
|
|
deinit {
|
|
print("DEINIT")
|
|
isDead = true
|
|
}
|
|
}
|
|
|
|
func main() {
|
|
print("isDead = \(isDead)")
|
|
do {
|
|
_ = Foo()
|
|
}
|
|
print("isDead = \(isDead)")
|
|
}
|
|
|
|
// CHECK: isDead = false
|
|
// CHECK: DEINIT
|
|
// CHECK: isDead = true
|
|
main()
|