Skip to content

Commit 2848bc7

Browse files
committed
[Test] Backport SIL test to 6.1.
On main type annotations are not always required but on 6.1 they are.
1 parent f9cdf26 commit 2848bc7

File tree

1 file changed

+16
-15
lines changed

1 file changed

+16
-15
lines changed

test/SILOptimizer/canonicalize_ossa_lifetime_unit.sil

Lines changed: 16 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -162,9 +162,9 @@ exit(%phi : @owned $C, %typhi : $S):
162162
sil @empty : $@convention(thin) () -> () {
163163
[global: ]
164164
bb0:
165-
%0 = tuple ()
166-
return %0 : $()
167-
}
165+
%0 = tuple ()
166+
return %0 : $()
167+
}
168168

169169
// Even though the apply of %empty is not a deinit barrier, verify that the
170170
// destroy is not hoisted, because MoS is move-only.
@@ -568,16 +568,16 @@ entry(%c1 : @owned $C):
568568
// CHECK: bb0([[C1:%[^,]+]] : @owned $C):
569569
// CHECK: [[TAKE_C:%[^,]+]] = function_ref @takeC
570570
// CHECK: [[BARRIER:%[^,]+]] = function_ref @barrier
571-
// CHECK: cond_br undef, [[LEFT]], [[RIGHT]]
572-
// CHECK: [[LEFT]]:
571+
// CHECK: cond_br undef, [[LEFT]], [[RIGHT]]
572+
// CHECK: [[LEFT]]:
573573
// CHECK: [[M:%[^,]+]] = move_value [[C1]]
574574
// CHECK: apply [[TAKE_C]]([[M]])
575-
// CHECK: br [[EXIT]]
576-
// CHECK: [[RIGHT]]:
575+
// CHECK: br [[EXIT]]
576+
// CHECK: [[RIGHT]]:
577577
// CHECK: apply [[BARRIER]]()
578578
// CHECK: destroy_value [[C1]]
579-
// CHECK: br [[EXIT]]
580-
// CHECK: [[EXIT]]:
579+
// CHECK: br [[EXIT]]
580+
// CHECK: [[EXIT]]:
581581
// CHECK: apply [[BARRIER]]()
582582
// CHECK-LABEL: } // end sil function 'lexical_end_at_end_2'
583583
// CHECK-LABEL: end running test {{.*}} on lexical_end_at_end_2: canonicalize_ossa_lifetime
@@ -858,6 +858,7 @@ exit:
858858
return %retval : $()
859859
}
860860

861+
861862
// CHECK-LABEL: begin running test {{.*}} on consume_copy_before_use_in_dead_end
862863
// CHECK-LABEL: sil [ossa] @consume_copy_before_use_in_dead_end : {{.*}} {
863864
// CHECK-NOT: destroy_value [dead_end]
@@ -868,19 +869,19 @@ entry(%c : @owned $C):
868869
cond_br undef, exit, die
869870

870871
exit:
871-
destroy_value %c
872+
destroy_value %c : $C
872873
%retval = tuple ()
873-
return %retval
874+
return %retval : $()
874875

875876
die:
876-
%move = move_value [lexical] %c
877-
%copy = copy_value %move
877+
%move = move_value [lexical] %c : $C
878+
%copy = copy_value %move : $C
878879
specify_test "canonicalize_ossa_lifetime true false true %move"
879880
apply undef(%move) : $@convention(thin) (@owned C) -> ()
880881
%addr = alloc_stack $C
881-
%token = store_borrow %copy to %addr
882+
%token = store_borrow %copy to %addr : $*C
882883
apply undef() : $@convention(thin) () -> ()
883-
%reload = load_borrow %token
884+
%reload = load_borrow %token : $*C
884885
apply undef(%reload) : $@convention(thin) (@guaranteed C) -> ()
885886
unreachable
886887
}

0 commit comments

Comments
 (0)