1
- // RUN: %target-sil-opt -enable-sil-verify-all %s -array-property-opt
1
+ // RUN: %target-sil-opt -enable-sil-verify-all %s -array-property-opt | %FileCheck %s
2
2
3
3
sil_stage canonical
4
4
@@ -21,6 +21,18 @@ enum MyBool{
21
21
class MyClass {
22
22
}
23
23
24
+ // CHECK-LABEL: sil @clone_switch_enum_exit :
25
+ // CHECK: bb1:
26
+ // CHECK: [[FUNC1:%.*]] = function_ref @arrayPropertyIsNative
27
+ // CHECK: apply [[FUNC1]]
28
+ // CHECK: cond_br {{.*}}, bb11, bb2
29
+ // CHECK: bb2:
30
+ // CHECK: br bb3
31
+ // CHECK: bb3:
32
+ // CHECK: [[FUNC2:%.*]] = function_ref @arrayPropertyIsNative
33
+ // CHECK: apply [[FUNC2]]
34
+ // CHECK_LABEL: } // end sil function 'clone_switch_enum_exit'
35
+
24
36
/// We need to split the loop exit edge from bb1 to bb3 before updating ssa form
25
37
/// after cloning.
26
38
sil @clone_switch_enum_exit : $@convention(thin) (@inout MyArray<MyClass>, @inout MyBool) -> MyBool {
55
67
protocol AProtocol : class {
56
68
}
57
69
70
+ // CHECK-LABEL: sil @cant_handle_open_existential_use_outside_loop :
71
+ // CHECK: bb1:
72
+ // CHECK: [[FUNC1:%.*]] = function_ref @arrayPropertyIsNative
73
+ // CHECK: apply [[FUNC1]]
74
+ // CHECK-NOT: [[FUNC2:%.*]] = function_ref @arrayPropertyIsNative
75
+ // CHECK-NOT: apply [[FUNC2]]
76
+ // CHECK-LABEL: } // end sil function 'cant_handle_open_existential_use_outside_loop'
58
77
sil @cant_handle_open_existential_use_outside_loop : $@convention(thin) (@inout MyArray<MyClass>, @inout MyBool, @owned AProtocol) -> MyBool {
59
78
bb0(%0 : $*MyArray<MyClass>, %1 : $*MyBool, %10 : $AProtocol):
60
79
%3 = load %0 : $*MyArray<MyClass>
@@ -95,6 +114,17 @@ bb0(%0: $MyArray<MyClass>):
95
114
96
115
sil @throwing_fun : $@convention(thin) () -> (MyBool, @error Error)
97
116
117
+ // CHECK-LABEL: sil @clone_try_apply_exit :
118
+ // CHECK: bb1:
119
+ // CHECK: [[FUNC1:%.*]] = function_ref @arrayPropertyIsNative
120
+ // CHECK: apply [[FUNC1]]
121
+ // CHECK: cond_br {{.*}}, bb10, bb2
122
+ // CHECK: bb2:
123
+ // CHECK: br bb3
124
+ // CHECK: bb3:
125
+ // CHECK: [[FUNC2:%.*]] = function_ref @arrayPropertyIsNative
126
+ // CHECK: apply [[FUNC2]]
127
+ // CHECK_LABEL: } // end sil function 'clone_try_apply_exit'
98
128
sil @clone_try_apply_exit : $@convention(thin) (@inout MyArray<MyClass>, @inout MyBool) -> (MyBool, @error Error) {
99
129
bb0(%0 : $*MyArray<MyClass>, %1 : $*MyBool):
100
130
%3 = load %0 : $*MyArray<MyClass>
@@ -122,6 +152,17 @@ bb6(%9 : $Error):
122
152
throw %9 : $Error
123
153
}
124
154
155
+ // CHECK-LABEL: sil @dominator_update_outside_non_exit_block :
156
+ // CHECK: bb1:
157
+ // CHECK: [[FUNC1:%.*]] = function_ref @arrayPropertyIsNative
158
+ // CHECK: apply [[FUNC1]]
159
+ // CHECK: cond_br {{.*}}, bb16, bb2
160
+ // CHECK: bb2:
161
+ // CHECK: br bb3
162
+ // CHECK: bb3:
163
+ // CHECK: [[FUNC2:%.*]] = function_ref @arrayPropertyIsNative
164
+ // CHECK: apply [[FUNC2]]
165
+ // CHECK_LABEL: } // end sil function 'dominator_update_outside_non_exit_block'
125
166
sil @dominator_update_outside_non_exit_block : $@convention(thin) (@inout MyArray<MyClass>, @inout Builtin.Int1) -> Builtin.Int1 {
126
167
bb0(%0 : $*MyArray<MyClass>, %1 : $*Builtin.Int1):
127
168
%3 = load %0 : $*MyArray<MyClass>
@@ -163,6 +204,17 @@ bb10:
163
204
return %4 : $Builtin.Int1
164
205
}
165
206
207
+ // CHECK-LABEL: sil @dominator_update_outside_non_exit_block_2 :
208
+ // CHECK: bb1:
209
+ // CHECK: [[FUNC1:%.*]] = function_ref @arrayPropertyIsNative
210
+ // CHECK: apply [[FUNC1]]
211
+ // CHECK: cond_br {{.*}}, bb17, bb2
212
+ // CHECK: bb2:
213
+ // CHECK: br bb3
214
+ // CHECK: bb3:
215
+ // CHECK: [[FUNC2:%.*]] = function_ref @arrayPropertyIsNative
216
+ // CHECK: apply [[FUNC2]]
217
+ // CHECK_LABEL: } // end sil function 'dominator_update_outside_non_exit_block_2'
166
218
sil @dominator_update_outside_non_exit_block_2 : $@convention(thin) (@inout MyArray<MyClass>, @inout Builtin.Int1) -> Builtin.Int1 {
167
219
bb0(%0 : $*MyArray<MyClass>, %1 : $*Builtin.Int1):
168
220
%3 = load %0 : $*MyArray<MyClass>
0 commit comments