@@ -10,6 +10,11 @@ sil_stage canonical
1010
1111import Builtin
1212
13+ struct NCInt : ~Copyable {
14+ var i: Builtin.Int64
15+ deinit {}
16+ }
17+
1318enum FakeOptional<T> {
1419case none
1520case some(T)
@@ -243,7 +248,7 @@ exit(%reborrow : @guaranteed $C, %phi : @guaranteed $D):
243248}
244249
245250// =============================================================================
246- // InteriorLiveness and visitAdjacentPhis
251+ // InteriorLiveness
247252// =============================================================================
248253
249254// CHECK-LABEL: testInteriorRefElementEscape: interior-liveness with: %0
@@ -312,6 +317,40 @@ bb0(%0 : $*D, %1 : @guaranteed $D):
312317 return %99 : $()
313318}
314319
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+
315354// CHECK-LABEL: testInteriorReborrow: interior-liveness with: %borrow
316355// CHECK: Complete liveness
317356// CHECK-NEXT: Unenclosed phis {
0 commit comments