1
1
// RUN: %target-swift-emit-silgen %s | %FileCheck %s
2
+ // RUN: %target-swift-emit-silgen %s -enable-library-evolution
2
3
3
- protocol Foo {
4
+ public protocol Foo {
4
5
static var button : Self { get }
5
6
}
6
7
7
- enum Bar : Foo {
8
+ public enum Bar : Foo {
8
9
case button
9
10
}
10
11
11
- protocol AnotherFoo {
12
+ public protocol AnotherFoo {
12
13
static func bar( arg: Int ) -> Self
13
14
}
14
15
15
- enum AnotherBar : AnotherFoo {
16
+ public enum AnotherBar : AnotherFoo {
16
17
case bar( arg: Int )
17
18
}
18
19
19
- // CHECK-LABEL: sil private [transparent] [thunk] [ossa] @$s21protocol_enum_witness3BarOAA3FooA2aDP6buttonxvgZTW : $@convention(witness_method: Foo) (@thick Bar.Type) -> @out Bar {
20
+ public struct PublicStruct { }
21
+
22
+ enum InternalEnumWithPublicStruct : Foo {
23
+ case button
24
+ case other( PublicStruct )
25
+ }
26
+
27
+ // CHECK-LABEL: sil shared [transparent] [serialized] [thunk] [ossa] @$s21protocol_enum_witness3BarOAA3FooA2aDP6buttonxvgZTW : $@convention(witness_method: Foo) (@thick Bar.Type) -> @out Bar {
20
28
// CHECK: bb0([[BAR:%.*]] : $*Bar, [[BAR_TYPE:%.*]] : $@thick Bar.Type):
21
29
// CHECK-NEXT: [[META_TYPE:%.*]] = metatype $@thin Bar.Type
22
30
// CHECK: [[REF:%.*]] = function_ref @$s21protocol_enum_witness3BarO6buttonyA2CmF : $@convention(method) (@thin Bar.Type) -> Bar
@@ -26,13 +34,13 @@ enum AnotherBar: AnotherFoo {
26
34
// CHECK-NEXT: return [[TUPLE]] : $()
27
35
// CHECK-END: }
28
36
29
- // CHECK-LABEL: sil shared [transparent] [ossa] @$s21protocol_enum_witness3BarO6buttonyA2CmF : $@convention(method) (@thin Bar.Type) -> Bar {
37
+ // CHECK-LABEL: sil shared [transparent] [serializable] [ ossa] @$s21protocol_enum_witness3BarO6buttonyA2CmF : $@convention(method) (@thin Bar.Type) -> Bar {
30
38
// CHECK: bb0({{%.*}} : $@thin Bar.Type):
31
39
// CHECK-NEXT: [[CASE:%.*]] = enum $Bar, #Bar.button!enumelt
32
40
// CHECK-NEXT: return [[CASE]] : $Bar
33
41
// CHECK-END: }
34
42
35
- // CHECK-LABEL: sil private [transparent] [thunk] [ossa] @$s21protocol_enum_witness10AnotherBarOAA0D3FooA2aDP3bar3argxSi_tFZTW : $@convention(witness_method: AnotherFoo) (Int, @thick AnotherBar.Type) -> @out AnotherBar {
43
+ // CHECK-LABEL: sil shared [transparent] [serialized ] [thunk] [ossa] @$s21protocol_enum_witness10AnotherBarOAA0D3FooA2aDP3bar3argxSi_tFZTW : $@convention(witness_method: AnotherFoo) (Int, @thick AnotherBar.Type) -> @out AnotherBar {
36
44
// CHECK: bb0([[ANOTHER_BAR:%.*]] : $*AnotherBar, [[INT_ARG:%.*]] : $Int, [[ANOTHER_BAR_TYPE:%.*]] : $@thick AnotherBar.Type):
37
45
// CHECK-NEXT: [[META_TYPE:%.*]] = metatype $@thin AnotherBar.Type
38
46
// CHECK: [[REF:%.*]] = function_ref @$s21protocol_enum_witness10AnotherBarO3baryACSi_tcACmF : $@convention(method) (Int, @thin AnotherBar.Type) -> AnotherBar
@@ -42,8 +50,8 @@ enum AnotherBar: AnotherFoo {
42
50
// CHECK-NEXT: return [[TUPLE]] : $()
43
51
// CHECK-END: }
44
52
45
- // CHECK-LABEL: sil_witness_table hidden Bar: Foo module protocol_enum_witness {
53
+ // CHECK-LABEL: sil_witness_table [serialized] Bar: Foo module protocol_enum_witness {
46
54
// CHECK: method #Foo.button!getter: <Self where Self : Foo> (Self.Type) -> () -> Self : @$s21protocol_enum_witness3BarOAA3FooA2aDP6buttonxvgZTW
47
55
48
- // CHECK-LABEL: sil_witness_table hidden AnotherBar: AnotherFoo module protocol_enum_witness {
56
+ // CHECK-LABEL: sil_witness_table [serialized] AnotherBar: AnotherFoo module protocol_enum_witness {
49
57
// CHECK: method #AnotherFoo.bar: <Self where Self : AnotherFoo> (Self.Type) -> (Int) -> Self : @$s21protocol_enum_witness10AnotherBarOAA0D3FooA2aDP3bar3argxSi_tFZTW
0 commit comments