Files
swift-mirror/validation-test/Concurrency/rdar107275872.swift
Eric Miotto d6df83d8fa Restrict a few tests to run against the just built runtime
Addresses rdar://158442561
2025-08-20 14:50:47 -07:00

33 lines
832 B
Swift

// RUN: %empty-directory(%t)
// RUN: %target-build-swift -O -Xfrontend -disable-availability-checking %s -plugin-path %swift-plugin-dir -parse-as-library -module-name main -o %t/main
// RUN: %target-codesign %t/main
// RUN: %target-run %t/main | %FileCheck %s
// REQUIRES: objc_interop
// REQUIRES: concurrency
// REQUIRES: executable_test
// REQUIRES: concurrency_runtime
// UNSUPPORTED: back_deployment_runtime || use_os_stdlib
// rdar://108260399
// REQUIRES: optimized_stdlib
import Foundation
@main struct M {
@TaskLocal static var v: UUID = UUID()
static func test(_ t: UUID) async {
await Self.$v.withValue(t) {
await Task.sleep(1)
print(Self.$v.get())
}
}
static func main() async {
// CHECK: before
print("before")
await test(UUID())
// CHECK: after
print("after")
}
}