Files
swift-mirror/test/IRGen/task_local_function_value_metadata.swift
Konrad Malawski de6ae94b28 [Concurrency] Harden the isolated_conformance_conditional_extension
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
2026-04-11 12:09:26 +09:00

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")
}
}