mirror of
https://github.com/apple/swift.git
synced 2026-06-20 15:42:51 +02:00
de6ae94b28
This test running on different platforms may end up using different ways to get the metadata; x86 may use __swift_instantiateConcreteTypeFromMangledNameV2 that looks like this: ``` %6 = tail call ptr @__swift_instantiateConcreteTypeFromMangledNameV2(ptr nonnull @"$syycSgMd", ptr nonnull @"$syycSgMR") #12 ``` So we need to relax the CHECKs here a bit more
16 lines
598 B
Swift
16 lines
598 B
Swift
// RUN: %target-swift-frontend -primary-file %s -emit-ir -O -swift-version 5 -plugin-path %swift-plugin-dir -module-name main | %FileCheck %s
|
|
|
|
// REQUIRES: concurrency
|
|
|
|
@TaskLocal var taskLocal: (() -> Void)?
|
|
|
|
// Verify that taskLocalValuePush uses the formal AST type metadata (Optional<() -> ()>, mangled as "yycSg"):
|
|
// CHECK-LABEL: define {{.*}}swiftcc void @"$s4main4testyyF"()
|
|
// CHECK: call ptr @__swift_instantiateConcreteTypeFromMangledName{{.*}}@"$syycSg
|
|
// CHECK: call swiftcc {} @swift_task_localValuePush(
|
|
func test() {
|
|
$taskLocal.withValue({}) {
|
|
print("inside withValue")
|
|
}
|
|
}
|