1
- // RUN: %target-sil-opt -inline -verify %s | %FileCheck %s
2
- // RUN: %target-sil-opt -mandatory-inlining -verify %s | %FileCheck %s
1
+ // RUN: %target-sil-opt -verify-sil-ownership - inline -verify %s | %FileCheck %s
2
+ // RUN: %target-sil-opt -verify-sil-ownership - mandatory-inlining -verify %s | %FileCheck %s
3
3
4
4
import Builtin
5
5
import Swift
@@ -185,23 +185,22 @@ cont:
185
185
// CHECK-NEXT: %2 = function_ref @marker
186
186
// CHECK-NEXT: %3 = integer_literal $Builtin.Int32, 1000
187
187
// CHECK-NEXT: %4 = apply %2(%3)
188
+ // CHECK-NEXT: destroy_value %1
188
189
// CHECK-NEXT: cond_br %0, bb1, bb2
189
190
// CHECK: bb1:
190
191
// CHECK-NEXT: [[T0:%.*]] = integer_literal $Builtin.Int32, 2000
191
192
// CHECK-NEXT: apply %2([[T0]])
192
- // CHECK-NEXT: destroy_value %1 : $SomeClass
193
193
// CHECK-NEXT: tuple ()
194
194
// CHECK-NEXT: br bb3
195
195
// CHECK: bb2:
196
196
// CHECK-NEXT: [[T1:%.*]] = integer_literal $Builtin.Int32, 3000
197
197
// CHECK-NEXT: apply %2([[T1]])
198
- // CHECK-NEXT: destroy_value %1 : $SomeClass
199
198
// CHECK-NEXT: br bb3
200
199
// CHECK: bb3:
201
200
// CHECK-NEXT: [[T0:%.*]] = tuple ()
202
201
// CHECK-NEXT: return [[T0]] : $()
203
202
204
- sil [transparent] [ossa] [ossa] @yield_owned : $@yield_once(@owned SomeClass) -> (@yields @owned SomeClass) {
203
+ sil [transparent] [ossa] @yield_owned : $@yield_once(@owned SomeClass) -> (@yields @owned SomeClass) {
205
204
entry(%0 : @owned $SomeClass):
206
205
%marker = function_ref @marker : $@convention(thin) (Builtin.Int32) -> ()
207
206
%1000 = integer_literal $Builtin.Int32, 1000
@@ -211,21 +210,20 @@ entry(%0 : @owned $SomeClass):
211
210
resume:
212
211
%2000 = integer_literal $Builtin.Int32, 2000
213
212
apply %marker(%2000) : $@convention(thin) (Builtin.Int32) -> ()
214
- destroy_value %0: $SomeClass
215
213
%ret = tuple ()
216
214
return %ret : $()
217
215
218
216
unwind:
219
217
%3000 = integer_literal $Builtin.Int32, 3000
220
218
apply %marker(%3000) : $@convention(thin) (Builtin.Int32) -> ()
221
- destroy_value %0: $SomeClass
222
219
unwind
223
220
}
224
221
225
222
sil [ossa] @test_simple_call_yield_owned : $(Builtin.Int1, @owned SomeClass) -> () {
226
223
entry(%flag : $Builtin.Int1, %c: @owned $SomeClass):
227
224
%0 = function_ref @yield_owned : $@convention(thin) @yield_once(@owned SomeClass) -> (@yields @owned SomeClass)
228
225
(%value, %token) = begin_apply %0(%c) : $@convention(thin) @yield_once(@owned SomeClass) -> (@yields @owned SomeClass)
226
+ destroy_value %value : $SomeClass
229
227
cond_br %flag, yes, no
230
228
231
229
yes:
0 commit comments