|
1 |
| -// RUN: %target-swift-frontend -enable-reflection-metadata -enable-reflection-names -emit-ir %S/Inputs/reflection_metadata.swift | FileCheck %s |
2 |
| -// RUN: %target-swift-frontend -enable-reflection-metadata -emit-ir %S/Inputs/reflection_metadata.swift | FileCheck %s --check-prefix=STRIP_REFLECTION_NAMES |
3 |
| -// RUN: %target-swift-frontend -emit-ir %S/Inputs/reflection_metadata.swift | FileCheck %s --check-prefix=STRIP_REFLECTION_METADATA |
| 1 | +// RUN: %target-swift-frontend -enable-reflection-metadata -enable-reflection-names -emit-ir %s | FileCheck %s |
| 2 | +// RUN: %target-swift-frontend -enable-reflection-metadata -emit-ir %s | FileCheck %s --check-prefix=STRIP_REFLECTION_NAMES |
| 3 | +// RUN: %target-swift-frontend -emit-ir %s | FileCheck %s --check-prefix=STRIP_REFLECTION_METADATA |
4 | 4 |
|
5 |
| -// STRIP_REFLECTION_NAMES-NOT: {{.*}}swift3_reflstr |
6 | 5 | // STRIP_REFLECTION_NAMES_DAG: {{.*}}swift3_reflect
|
| 6 | +// STRIP_REFLECTION_NAMES_DAG: {{.*}}swift3_fieldmd |
| 7 | +// STRIP_REFLECTION_NAMES_DAG: {{.*}}swift3_assocty |
| 8 | +// STRIP_REFLECTION_NAMES-DAG: {{.*}}swift3_capture |
| 9 | +// STRIP_REFLECTION_NAMES-DAG: {{.*}}swift3_typeref |
| 10 | +// STRIP_REFLECTION_NAMES-NOT: {{.*}}swift3_reflstr |
| 11 | +// STRIP_REFLECTION_NAMES-NOT: {{.*}}swift3_builtin |
| 12 | + |
7 | 13 | // STRIP_REFLECTION_NAMES-DAG: @"\01l__swift3_reflection_metadata"
|
8 | 14 |
|
9 |
| -// STRIP_REFLECTION_METADATA-NOT: {{.*}}swift3_reflstr |
10 | 15 | // STRIP_REFLECTION_METADATA-NOT: {{.*}}swift3_reflect
|
| 16 | +// STRIP_REFLECTION_METADATA-NOT: {{.*}}swift3_fieldmd |
| 17 | +// STRIP_REFLECTION_METADATA-NOT: {{.*}}swift3_assocty |
| 18 | +// STRIP_REFLECTION_METADATA-NOT: {{.*}}swift3_capture |
| 19 | +// STRIP_REFLECTION_METADATA-NOT: {{.*}}swift3_typeref |
| 20 | +// STRIP_REFLECTION_METADATA-NOT: {{.*}}swift3_reflstr |
| 21 | +// STRIP_REFLECTION_METADATA-NOT: {{.*}}swift3_builtin |
| 22 | + |
11 | 23 | // STRIP_REFLECTION_METADATA-NOT: @"\01l__swift3_reflection_metadata"
|
12 | 24 |
|
13 | 25 | // CHECK-DAG: private constant [2 x i8] c"i\00", section "{{[^"]*}}swift3_reflstr{{[^"]*}}"
|
|
27 | 39 | // CHECK-DAG: private constant [3 x i8] c"GE\00", section "{{[^"]*}}swift3_reflstr{{[^"]*}}"
|
28 | 40 |
|
29 | 41 | // CHECK: @"\01l__swift3_reflection_metadata{{.*}}" = private constant <{ {{.*}} }>
|
| 42 | + |
| 43 | +public protocol MyProtocol { |
| 44 | + associatedtype Inner |
| 45 | + var inner: Inner { get } |
| 46 | +} |
| 47 | + |
| 48 | +public class MyClass { |
| 49 | + let i: Int |
| 50 | + let ms: MyStruct |
| 51 | + let me: MyEnum |
| 52 | + public init(i: Int, ms: MyStruct, me: MyEnum) { |
| 53 | + self.i = i |
| 54 | + self.ms = ms |
| 55 | + self.me = me |
| 56 | + } |
| 57 | +} |
| 58 | + |
| 59 | +public struct Conformance : MyProtocol { |
| 60 | + public var inner: Int = 0 |
| 61 | +} |
| 62 | + |
| 63 | +public struct MyStruct { |
| 64 | + let i: Int |
| 65 | + let mc: MyClass |
| 66 | + let me: MyEnum |
| 67 | +} |
| 68 | + |
| 69 | +public enum MyEnum { |
| 70 | + case C(MyClass) |
| 71 | + indirect case S(MyStruct) |
| 72 | + indirect case E(MyEnum) |
| 73 | + case I(Int) |
| 74 | +} |
| 75 | + |
| 76 | +public class MyGenericClass<T : MyProtocol> { |
| 77 | + let t: T |
| 78 | + let i: T.Inner |
| 79 | + let mgs: MyGenericStruct<T> |
| 80 | + let mge: MyGenericEnum<T> |
| 81 | + |
| 82 | + public init(t: T, i: T.Inner, mgs: MyGenericStruct<T>, mge: MyGenericEnum<T>) { |
| 83 | + self.t = t |
| 84 | + self.i = i |
| 85 | + self.mgs = mgs |
| 86 | + self.mge = mge |
| 87 | + } |
| 88 | +} |
| 89 | + |
| 90 | +public struct MyGenericStruct<T : MyProtocol> { |
| 91 | + let t: T |
| 92 | + let i: T.Inner |
| 93 | + let mgc: MyGenericClass<T> |
| 94 | + let mge: MyGenericEnum<T> |
| 95 | +} |
| 96 | + |
| 97 | +public enum MyGenericEnum<T : MyProtocol> { |
| 98 | + case GC(MyGenericClass<T>) |
| 99 | + indirect case GS(MyGenericStruct<T>) |
| 100 | + indirect case GE(MyGenericEnum<T>) |
| 101 | + case I(Int) |
| 102 | +} |
| 103 | + |
| 104 | +public func makeSomeClosures<T, U>(t: T, x: Int, y: MyGenericStruct<U>) |
| 105 | + -> (() -> (), () -> (), () -> ()) { |
| 106 | + return ({ _ = t }, { _ = x }, { _ = y }) |
| 107 | +} |
0 commit comments