@@ -10,6 +10,11 @@ sil_stage canonical
10
10
11
11
import Builtin
12
12
13
+ struct NCInt : ~Copyable {
14
+ var i: Builtin.Int64
15
+ deinit {}
16
+ }
17
+
13
18
enum FakeOptional<T> {
14
19
case none
15
20
case some(T)
@@ -243,7 +248,7 @@ exit(%reborrow : @guaranteed $C, %phi : @guaranteed $D):
243
248
}
244
249
245
250
// =============================================================================
246
- // InteriorLiveness and visitAdjacentPhis
251
+ // InteriorLiveness
247
252
// =============================================================================
248
253
249
254
// CHECK-LABEL: testInteriorRefElementEscape: interior-liveness with: %0
@@ -312,6 +317,40 @@ bb0(%0 : $*D, %1 : @guaranteed $D):
312
317
return %99 : $()
313
318
}
314
319
320
+ // CHECK-LABEL: begin running test 1 of 2 on testInteriorDropDeinit: interior-liveness with: %0
321
+ // CHECK: Interior liveness: %0 = argument of bb0 : $NCInt
322
+ // CHECK-NEXT: bb0: LiveWithin
323
+ // CHECK-NEXT: lifetime-ending user: [[DD:%.*]] = drop_deinit %0 : $NCInt
324
+ // CHECK-NEXT: Complete liveness
325
+ // CHECK-NEXT: Unenclosed phis {
326
+ // CHECK-NEXT: }
327
+ // CHECK-NEXT: last user: [[DD]] = drop_deinit %0 : $NCInt
328
+ // CHECK-LABEL: end running test 1 of 2 on testInteriorDropDeinit: interior-liveness with: %0
329
+
330
+ // CHECK-LABEL: begin running test 2 of 2 on testInteriorDropDeinit: interior_liveness_swift with: %0
331
+ // CHECK: Interior liveness: %0 = argument of bb0 : $NCInt
332
+ // CHECK-NEXT: begin: [[DD:%.*]] = drop_deinit %0 : $NCInt
333
+ // CHECK-NEXT: ends: [[DD]] = drop_deinit %0 : $NCInt
334
+ // CHECK-NEXT: exits:
335
+ // CHECK-NEXT: interiors:
336
+ // CHECK-NEXT: Unenclosed phis {
337
+ // CHECK-NEXT: }
338
+ // CHECK-NEXT: last user: [[DD]] = drop_deinit %0 : $NCInt
339
+ // CHECK-LABEL: end running test 2 of 2 on testInteriorDropDeinit: interior_liveness_swift with: %0
340
+ sil [ossa] @testInteriorDropDeinit : $@convention(thin) (@owned NCInt) -> () {
341
+ bb0(%0 : @owned $NCInt):
342
+ specify_test "interior-liveness %0"
343
+ specify_test "interior_liveness_swift %0"
344
+ %nd = drop_deinit %0 : $NCInt
345
+ destroy_value %nd : $NCInt
346
+ %99 = tuple()
347
+ return %99 : $()
348
+ }
349
+
350
+ // =============================================================================
351
+ // InteriorLiveness and visitAdjacentPhis
352
+ // =============================================================================
353
+
315
354
// CHECK-LABEL: testInteriorReborrow: interior-liveness with: %borrow
316
355
// CHECK: Complete liveness
317
356
// CHECK-NEXT: Unenclosed phis {
0 commit comments