Skip to content

Commit 06efb77

Browse files
committed
Fix tests
1 parent 9e07d5e commit 06efb77

22 files changed

+129
-114
lines changed

test/Driver/emit-sib-single-file.swift

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@
1818
// CHECK: Hello World
1919
// CHECK: Hello Bob, today is Tuesday.
2020

21+
@_inlineable
22+
@_versioned
2123
func greet(_ name: String, _ day: String) -> String {
2224
return "Hello \(name), today is \(day)."
2325
}

test/IRGen/sil_linkage.sil

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,13 @@ sil_stage canonical
55
// CHECK: define{{( protected)?}} swiftcc void @public_fragile_function_test() {{.*}} {
66
// CHECK: define{{( protected)?}} internal swiftcc void @public_transparent_fragile_function_test() {{.*}} {
77
// CHECK: define{{( protected)?}} swiftcc void @public_transparent_function_test() {{.*}} {
8-
// CHECK: define{{( protected)?}} swiftcc void @hidden_fragile_function_test() {{.*}} {
8+
// CHECK: define{{( hidden)?}} swiftcc void @hidden_fragile_function_test() {{.*}} {
99
// CHECK: define linkonce_odr hidden swiftcc void @shared_fragile_function_test() {{.*}} {
10-
// CHECK: define{{( protected)?}} swiftcc void @private_fragile_function_test() {{.*}} {
10+
// CHECK: define{{( internal)?}} swiftcc void @private_fragile_function_test() {{.*}} {
1111
// CHECK: define available_externally swiftcc void @public_external_fragile_function_def_test() {{.*}} {
12-
// CHECK: define{{( protected)?}} available_externally swiftcc void @hidden_external_fragile_function_def_test() {{.*}} {
12+
// CHECK: define{{( protected)?}} available_externally{{ (hidden)?}} swiftcc void @hidden_external_fragile_function_def_test() {{.*}} {
1313
// CHECK: define linkonce_odr hidden swiftcc void @shared_external_fragile_function_def_test() {{.*}} {
14-
// CHECK: define{{( protected)?}} available_externally swiftcc void @private_external_fragile_function_def_test() {{.*}} {
14+
// CHECK: define{{( protected)?}} available_externally{{ (hidden)?}} swiftcc void @private_external_fragile_function_def_test() {{.*}} {
1515
// CHECK: define{{( protected)?}} swiftcc void @public_resilient_function_test() {{.*}} {
1616
// CHECK: define hidden swiftcc void @hidden_resilient_function_test() {{.*}} {
1717
// CHECK: define linkonce_odr hidden swiftcc void @shared_resilient_function_test() {{.*}} {

test/SIL/Serialization/basic.sil

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,17 +7,17 @@
77

88
import Builtin
99

10-
// CHECK-LABEL: sil @test_unchecked_ownership_conversion : $@convention(thin) (@guaranteed Builtin.NativeObject) -> () {
10+
// CHECK-LABEL: sil [serialized] @test_unchecked_ownership_conversion : $@convention(thin) (@guaranteed Builtin.NativeObject) -> () {
1111
// CHECK: unchecked_ownership_conversion {{%.*}} : $Builtin.NativeObject, @guaranteed to @owned
12-
sil @test_unchecked_ownership_conversion : $@convention(thin) (@guaranteed Builtin.NativeObject) -> () {
12+
sil [serialized] @test_unchecked_ownership_conversion : $@convention(thin) (@guaranteed Builtin.NativeObject) -> () {
1313
bb0(%0 : $Builtin.NativeObject):
1414
unchecked_ownership_conversion %0 : $Builtin.NativeObject, @guaranteed to @owned
1515
return undef : $()
1616
}
1717

18-
// CHECK-LABEL: sil @test_end_lifetime : $@convention(thin) (@owned Builtin.NativeObject) -> () {
18+
// CHECK-LABEL: sil [serialized] @test_end_lifetime : $@convention(thin) (@owned Builtin.NativeObject) -> () {
1919
// CHECK: end_lifetime {{%.*}} : $Builtin.NativeObject
20-
sil @test_end_lifetime : $@convention(thin) (@owned Builtin.NativeObject) -> () {
20+
sil [serialized] @test_end_lifetime : $@convention(thin) (@owned Builtin.NativeObject) -> () {
2121
bb0(%0 : $Builtin.NativeObject):
2222
end_lifetime %0 : $Builtin.NativeObject
2323
return undef : $()

test/SIL/Serialization/borrow.sil

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ sil_stage canonical
1010
import Builtin
1111

1212
// We do not verify here, but just make sure that all of the combinations parse and print correctly.
13-
// CHECK-LABEL: sil @borrow_test : $@convention(thin) (@in Builtin.NativeObject, Builtin.NativeObject) -> () {
13+
// CHECK-LABEL: sil [serialized] @borrow_test : $@convention(thin) (@in Builtin.NativeObject, Builtin.NativeObject) -> () {
1414
// CHECK: bb0([[ARG1:%[0-9]+]] : $*Builtin.NativeObject, [[ARG2:%[0-9]+]] : $Builtin.NativeObject):
1515
// CHECK: begin_borrow [[ARG2]]
1616
// CHECK: [[MEM:%.*]] = alloc_stack $Builtin.NativeObject
@@ -19,7 +19,7 @@ import Builtin
1919
// CHECK: end_borrow [[ARG2]] from [[ARG1]] : $Builtin.NativeObject, $*Builtin.NativeObject
2020
// CHECK: end_borrow [[ARG1]] from [[ARG1]] : $*Builtin.NativeObject, $*Builtin.NativeObject
2121
// CHECK: end_borrow [[ARG2]] from [[ARG2]] : $Builtin.NativeObject, $Builtin.NativeObject
22-
sil @borrow_test : $@convention(thin) (@in Builtin.NativeObject, Builtin.NativeObject) -> () {
22+
sil [serialized] @borrow_test : $@convention(thin) (@in Builtin.NativeObject, Builtin.NativeObject) -> () {
2323
bb0(%0 : $*Builtin.NativeObject, %1 : $Builtin.NativeObject):
2424
%2 = begin_borrow %1 : $Builtin.NativeObject
2525
end_borrow %2 from %1 : $Builtin.NativeObject, $Builtin.NativeObject

test/SIL/Serialization/borrow_argument.sil

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,10 @@ sil_stage canonical
99

1010
import Builtin
1111

12-
// CHECK-LABEL: sil @borrow_argument_test : $@convention(thin) (@guaranteed Builtin.NativeObject) -> () {
12+
// CHECK-LABEL: sil [serialized] @borrow_argument_test : $@convention(thin) (@guaranteed Builtin.NativeObject) -> () {
1313
// CHECK: bb1([[PHIBBARG:%.*]] : @guaranteed $Builtin.NativeObject):
1414
// CHECK: end_borrow_argument [[PHIBBARG]] : $Builtin.NativeObject
15-
sil @borrow_argument_test : $@convention(thin) (@guaranteed Builtin.NativeObject) -> () {
15+
sil [serialized] @borrow_argument_test : $@convention(thin) (@guaranteed Builtin.NativeObject) -> () {
1616
bb0(%0 : @guaranteed $Builtin.NativeObject):
1717
br bb1(%0 : $Builtin.NativeObject)
1818

test/SIL/Serialization/boxes.sil

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@ struct Q: P {}
1616

1717
// TODO: Transform boxes by transforming their arguments, not as single-field,
1818
// so that they work as parameters in generic SIL functions.
19-
// CHECK-LABEL: sil hidden @box_type_parsing : $@convention(thin) (
20-
sil hidden @box_type_parsing : $@convention(thin) (
19+
// CHECK-LABEL: sil hidden [serialized] @box_type_parsing : $@convention(thin) (
20+
sil hidden [serialized] @box_type_parsing : $@convention(thin) (
2121
// CHECK: <τ_0_0> { var τ_0_0 } <F>,
2222
<B>{ var B }<F>,
2323
// CHECK: <τ_0_0 where τ_0_0 : P> { let τ_0_0 } <G>,
@@ -38,8 +38,8 @@ entry(%0 : $<E>{ var E }<F>, %1 : $<F: P>{ let F }<G>, %2 : $<G: P>{ var G }<Q>,
3838
unreachable
3939
}
4040

41-
// CHECK-LABEL: sil hidden @box_type_parsing_in_generic_function : $@convention(thin) <F, G where G : P> (
42-
sil hidden @box_type_parsing_in_generic_function : $@convention(thin) <F, G: P> (
41+
// CHECK-LABEL: sil hidden [serialized] @box_type_parsing_in_generic_function : $@convention(thin) <F, G where G : P> (
42+
sil hidden [serialized] @box_type_parsing_in_generic_function : $@convention(thin) <F, G: P> (
4343
// CHECK: <τ_0_0> { var τ_0_0 } <F>,
4444
<B>{ var B }<F>,
4545
// CHECK: <τ_0_0 where τ_0_0 : P> { let τ_0_0 } <G>,
@@ -60,8 +60,8 @@ entry(%0 : $<E>{ var E }<F>, %1 : $<F: P>{ let F }<G>, %2 : $<G: P>{ var G }<Q>,
6060
unreachable
6161
}
6262

63-
// CHECK-LABEL: sil hidden @same_generic_param_name_in_multiple_box_signatures : $@convention(thin) (
64-
sil hidden @same_generic_param_name_in_multiple_box_signatures : $@convention(thin) (
63+
// CHECK-LABEL: sil hidden [serialized] @same_generic_param_name_in_multiple_box_signatures : $@convention(thin) (
64+
sil hidden [serialized] @same_generic_param_name_in_multiple_box_signatures : $@convention(thin) (
6565
// CHECK: <τ_0_0> { var τ_0_0 } <Int>,
6666
<A> { var A } <Int>,
6767
// CHECK: <τ_0_0> { var τ_0_0 } <String>
@@ -72,8 +72,8 @@ entry(%0 : $<A> { var A } <Int>, %1 : $<A> { var A } <String>):
7272
unreachable
7373
}
7474

75-
// CHECK-LABEL: sil hidden @same_generic_param_name_in_outer_scope : $@convention(thin) <A> (
76-
sil hidden @same_generic_param_name_in_outer_scope : $@convention(thin) <A> (
75+
// CHECK-LABEL: sil hidden [serialized] @same_generic_param_name_in_outer_scope : $@convention(thin) <A> (
76+
sil hidden [serialized] @same_generic_param_name_in_outer_scope : $@convention(thin) <A> (
7777
// CHECK: <τ_0_0> { var τ_0_0 } <A>
7878
<A> { var A } <A>
7979
// CHECK: ) -> ()
@@ -82,20 +82,20 @@ entry(%0 : $<B> { var B } <A>):
8282
unreachable
8383
}
8484

85-
// CHECK-LABEL: sil hidden @box_ownership : $@convention(thin) (@owned { var Int }, @guaranteed <τ_0_0> { let τ_0_0 } <Int>) -> ()
86-
sil hidden @box_ownership : $@convention(thin) (@owned { var Int }, @guaranteed <T> { let T } <Int>) -> () {
85+
// CHECK-LABEL: sil hidden [serialized] @box_ownership : $@convention(thin) (@owned { var Int }, @guaranteed <τ_0_0> { let τ_0_0 } <Int>) -> ()
86+
sil hidden [serialized ]@box_ownership : $@convention(thin) (@owned { var Int }, @guaranteed <T> { let T } <Int>) -> () {
8787
entry(%0 : ${ var Int }, %1 : $<T> { let T } <Int>):
8888
unreachable
8989
}
9090

91-
// CHECK-LABEL: sil hidden @address_of_box
92-
sil hidden @address_of_box : $@convention(thin) (@in { var Int }, @in <T> { let T } <Int>) -> () {
91+
// CHECK-LABEL: sil hidden [serialized] @address_of_box
92+
sil hidden [serialized] @address_of_box : $@convention(thin) (@in { var Int }, @in <T> { let T } <Int>) -> () {
9393
// CHECK: %0 : $*{ var Int }, %1 : $*<τ_0_0> { let τ_0_0 } <Int>
9494
entry(%0 : $*{ var Int }, %1 : $*<T> { let T } <Int>):
9595
unreachable
9696
}
9797

98-
sil @serialize_all : $@convention(thin) () -> () {
98+
sil [serialized] @serialize_all : $@convention(thin) () -> () {
9999
entry:
100100
%0 = function_ref @box_type_parsing : $@convention(thin) (<B>{ var B }<F>, <C: P>{ let C }<G>, <D: P>{ var D }<Q>, { let Int }, { var Int, let String }, {}, <X, Y, Z>{ var X, let Z }<Int, String, Optional<Double>>) -> ()
101101
%1 = function_ref @box_type_parsing_in_generic_function : $@convention(thin) <F, G: P> (<B>{ var B }<F>, <C: P>{ let C }<G>, <D: P>{ var D }<Q>, { let Int }, { var Int, let String }, {}, <X, Y, Z>{ var X, let Z }<Int, String, Optional<Double>>) -> ()

test/SIL/Serialization/copy_value_destroy_value.sil

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,24 +10,24 @@ sil_stage canonical
1010
import Builtin
1111

1212

13-
// CHECK-LABEL: sil @test_copy_unowned_value : $@convention(thin) (@owned @sil_unowned Builtin.NativeObject) -> @owned Builtin.NativeObject {
13+
// CHECK-LABEL: sil [serialized] @test_copy_unowned_value : $@convention(thin) (@owned @sil_unowned Builtin.NativeObject) -> @owned Builtin.NativeObject {
1414
// CHECK: bb0([[T0:%[0-9]+]] : $@sil_unowned Builtin.NativeObject):
1515
// CHECK-NEXT: [[COPY_RESULT:%.*]] = copy_unowned_value [[T0]] : $@sil_unowned Builtin.NativeObject
1616
// CHECK-NEXT: destroy_value [[T0]] : $@sil_unowned Builtin.NativeObject
1717
// CHECK-NEXT: return [[COPY_RESULT]] : $Builtin.NativeObject
18-
sil @test_copy_unowned_value : $@convention(thin) (@owned @sil_unowned Builtin.NativeObject) -> @owned Builtin.NativeObject {
18+
sil [serialized] @test_copy_unowned_value : $@convention(thin) (@owned @sil_unowned Builtin.NativeObject) -> @owned Builtin.NativeObject {
1919
bb0(%0 : $@sil_unowned Builtin.NativeObject):
2020
%1 = copy_unowned_value %0 : $@sil_unowned Builtin.NativeObject
2121
destroy_value %0 : $@sil_unowned Builtin.NativeObject
2222
return %1 : $Builtin.NativeObject
2323
}
2424

25-
// CHECK-LABEL: sil @test : $@convention(thin) (@owned Builtin.NativeObject) -> @owned Builtin.NativeObject {
25+
// CHECK-LABEL: sil [serialized] @test : $@convention(thin) (@owned Builtin.NativeObject) -> @owned Builtin.NativeObject {
2626
// CHECK: bb0([[ARG1:%[0-9]+]] : $Builtin.NativeObject):
2727
// CHECK: [[COPY_VALUE_RESULT:%[0-9]+]] = copy_value [[ARG1]] : $Builtin.NativeObject
2828
// CHECK: destroy_value [[ARG1]]
2929
// CHECK: return [[COPY_VALUE_RESULT]]
30-
sil @test : $@convention(thin) (@owned Builtin.NativeObject) -> @owned Builtin.NativeObject {
30+
sil [serialized] @test : $@convention(thin) (@owned Builtin.NativeObject) -> @owned Builtin.NativeObject {
3131
bb0(%0 : $Builtin.NativeObject):
3232
%1 = copy_value %0 : $Builtin.NativeObject
3333
destroy_value %0 : $Builtin.NativeObject

test/SIL/Serialization/keypath.sil

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,8 @@ struct Gen<A: P, B: Q, C: R> {
4141
var z: C
4242
}
4343

44-
// CHECK-LABEL: sil shared @stored_properties
45-
sil shared @stored_properties : $@convention(thin) () -> () {
44+
// CHECK-LABEL: sil shared [serialized] @stored_properties
45+
sil shared [serialized] @stored_properties : $@convention(thin) () -> () {
4646
entry:
4747
// CHECK: keypath $WritableKeyPath<S, Int>, (root $S; stored_property #S.x : $Int)
4848
%a = keypath $WritableKeyPath<S, Int>, (root $S; stored_property #S.x : $Int)
@@ -56,8 +56,8 @@ entry:
5656
return undef : $()
5757
}
5858

59-
// CHECK-LABEL: sil shared @stored_properties_generic
60-
sil shared @stored_properties_generic : $@convention(thin) <D: P, E: Q, F: R> () -> () {
59+
// CHECK-LABEL: sil shared [serialized] @stored_properties_generic
60+
sil shared [serialized] @stored_properties_generic : $@convention(thin) <D: P, E: Q, F: R> () -> () {
6161
entry:
6262
// CHECK: keypath $WritableKeyPath<Gen<D, E, F>, D>, <τ_0_0, τ_0_1, τ_0_2 where {{.*}}> (root $Gen<τ_0_0, τ_0_1, τ_0_2>; stored_property #Gen.x : $τ_0_0) <D, E, F>
6363
%a = keypath $WritableKeyPath<Gen<D,E,F>, D>, <G: P, H: Q, I: R> (root $Gen<G, H, I>; stored_property #Gen.x : $G) <D, E, F>
@@ -83,8 +83,8 @@ sil @set_gen_int_subs : $@convention(thin) <A: Hashable, B: Hashable, C: Hashabl
8383
sil @gen_subs_eq : $@convention(thin) <A: Hashable, B: Hashable, C: Hashable> (UnsafeRawPointer, UnsafeRawPointer) -> Bool
8484
sil @gen_subs_hash : $@convention(thin) <A: Hashable, B: Hashable, C: Hashable> (UnsafeRawPointer) -> Int
8585

86-
// CHECK-LABEL: sil shared @computed_properties
87-
sil shared @computed_properties : $@convention(thin) () -> () {
86+
// CHECK-LABEL: sil shared [serialized] @computed_properties
87+
sil shared [serialized] @computed_properties : $@convention(thin) () -> () {
8888
entry:
8989
// CHECK: keypath $KeyPath<S, Int>, (root $S; gettable_property $Int, id @id_a : $@convention(thin) () -> (), getter @get_s_int : $@convention(thin) (@in S) -> @out Int)
9090
%a = keypath $KeyPath<S, Int>, (root $S; gettable_property $Int, id @id_a : $@convention(thin) () -> (), getter @get_s_int : $@convention(thin) (@in S) -> @out Int)
@@ -101,17 +101,17 @@ entry:
101101
sil @get_gen_a : $@convention(thin) <X1: P, Y1: Q, Z1: R> (@in Gen<X1, Y1, Z1>) -> @out X1
102102
sil @set_gen_a : $@convention(thin) <X2: P, Y2: Q, Z2: R> (@in X2, @in Gen<X2, Y2, Z2>) -> ()
103103

104-
// CHECK-LABEL: sil shared @computed_properties_generic
105-
sil shared @computed_properties_generic : $@convention(thin) <D: P, E: Q, F: R> () -> () {
104+
// CHECK-LABEL: sil shared [serialized] @computed_properties_generic
105+
sil shared [serialized] @computed_properties_generic : $@convention(thin) <D: P, E: Q, F: R> () -> () {
106106
entry:
107107
// CHECK: keypath $KeyPath<Gen<D, E, F>, D>, <τ_0_0, τ_0_1, τ_0_2 where τ_0_0 : P, τ_0_1 : Q, τ_0_2 : R> (root $Gen<τ_0_0, τ_0_1, τ_0_2>; settable_property $τ_0_0, id @id_a : $@convention(thin) () -> (), getter @get_gen_a : $@convention(thin) <τ_0_0, τ_0_1, τ_0_2 where τ_0_0 : P, τ_0_1 : Q, τ_0_2 : R> (@in Gen<τ_0_0, τ_0_1, τ_0_2>) -> @out τ_0_0, setter @set_gen_a : $@convention(thin) <τ_0_0, τ_0_1, τ_0_2 where τ_0_0 : P, τ_0_1 : Q, τ_0_2 : R> (@in τ_0_0, @in Gen<τ_0_0, τ_0_1, τ_0_2>) -> ()) <D, E, F>
108108
%a = keypath $KeyPath<Gen<D, E, F>, D>, <G: P, H: Q, I: R> (root $Gen<G, H, I>; settable_property $G, id @id_a : $@convention(thin) () -> (), getter @get_gen_a : $@convention(thin) <X3: P, Y3: Q, Z3: R> (@in Gen<X3, Y3, Z3>) -> @out X3, setter @set_gen_a : $@convention(thin) <X4: P, Y4: Q, Z4: R> (@in X4, @in Gen<X4, Y4, Z4>) -> ()) <D, E, F>
109109

110110
return undef : $()
111111
}
112112

113-
// CHECK-LABEL: sil shared @optional
114-
sil shared @optional : $@convention(thin) () -> () {
113+
// CHECK-LABEL: sil shared [serialized] @optional
114+
sil shared [serialized] @optional : $@convention(thin) () -> () {
115115
entry:
116116
// CHECK: keypath $KeyPath<Optional<Int>, Optional<Int>>, (root $Optional<Int>; optional_chain : $Int; optional_wrap : $Optional<Int>)
117117
%a = keypath $KeyPath<Optional<Int>, Optional<Int>>, (root $Optional<Int>; optional_chain : $Int; optional_wrap : $Optional<Int>)
@@ -121,8 +121,8 @@ entry:
121121
return undef : $()
122122
}
123123

124-
// CHECK-LABEL: sil shared @indexes
125-
sil shared @indexes : $@convention(thin) (S, C) -> () {
124+
// CHECK-LABEL: sil shared [serialized] @indexes
125+
sil shared [serialized] @indexes : $@convention(thin) (S, C) -> () {
126126
// CHECK: bb0([[S:%.*]] : $S, [[C:%.*]] : $C):
127127
entry(%s : $S, %c : $C):
128128
// CHECK: keypath $KeyPath<S, Int>, (root $S; settable_property $Int, id @id_a : $@convention(thin) () -> (), getter @get_s_int_subs : $@convention(thin) (@in S, UnsafeRawPointer) -> @out Int, setter @set_s_int_subs : $@convention(thin) (@in Int, @in S, UnsafeRawPointer) -> (), indices [%$0 : $S : $S, %$1 : $C : $C], indices_equals @subs_eq : $@convention(thin) (UnsafeRawPointer, UnsafeRawPointer) -> Bool, indices_hash @subs_hash : $@convention(thin) (UnsafeRawPointer) -> Int) ([[S]], [[C]])
@@ -140,7 +140,7 @@ entry(%s : $S, %c : $C):
140140
return undef : $()
141141
}
142142

143-
sil @serialize_all : $@convention(thin) () -> () {
143+
sil [serialized] @serialize_all : $@convention(thin) () -> () {
144144
entry:
145145
%0 = function_ref @stored_properties : $@convention(thin) () -> ()
146146
%1 = function_ref @stored_properties_generic : $@convention(thin) <D: P, E: Q, F: R> () -> ()

test/SIL/Serialization/literals.sil

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77

88
sil_stage canonical
99

10-
sil @test : $@convention(thin) () -> () {
10+
sil [serialized] @test : $@convention(thin) () -> () {
1111
bb0:
1212
// CHECK: string_literal utf8 "\u{0B}"
1313
%1 = string_literal utf8 "\u{0B}"

0 commit comments

Comments
 (0)