mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
rdar://127535274 The layout string needs to be assigned before completion, to make it available in recursive metadata initialization. Setting it in the completion function causes a race between other metadata initializers using it and the completion function running.
12 lines
780 B
Swift
12 lines
780 B
Swift
// RUN: %target-build-swift -g -Xfrontend -enable-experimental-feature -Xfrontend LayoutStringValueWitnesses -Xfrontend -enable-experimental-feature -Xfrontend LayoutStringValueWitnessesInstantiation -Xfrontend -enable-layout-string-value-witnesses -Xfrontend -enable-layout-string-value-witnesses-instantiation -Xfrontend -enable-library-evolution -c -parse-as-library -emit-ir %s | %FileCheck %s
|
|
|
|
// CHECK: define internal ptr @"$s13rdar1275352744TestVMi"
|
|
// CHECK: [[METADATA:%.*]] = call ptr @swift_allocateGenericValueMetadataWithLayoutString
|
|
// CHECK: call void @swift_generic_instantiateLayoutString(ptr @"type_layout_string l13rdar1275352744TestVyxG", ptr [[METADATA]])
|
|
// CHECK: ret ptr [[METADATA]]
|
|
// CHECK: }
|
|
public struct Test<T> {
|
|
let x: [T]
|
|
let y: [T]
|
|
}
|