Skip to content

Commit df6f1d6

Browse files
committed
Add a unit test for get_access_base with mark_uninitialized.
1 parent e3540f0 commit df6f1d6

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed

test/SILOptimizer/accessbase_unit.sil

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,3 +65,24 @@ sil @test_access_global : $@convention(thin) () -> () {
6565
%retval = tuple ()
6666
return %retval : $()
6767
}
68+
69+
// CHECK-LABEL: begin running test {{.*}} on test_mark_uninitialized_inst: get_access_base
70+
// CHECK: Address: %{{.*}} = mark_uninitialized [var] [[ALLOC:%.*]] : $*C
71+
// CHECK: Base: [[ALLOC]] = alloc_stack [var_decl] $C
72+
// CHECK-LABEL: end running test {{.*}} on test_mark_uninitialized_inst: get_access_base
73+
// CHECK-LABEL: begin running test {{.*}} on test_mark_uninitialized_inst: swift_get_access_base
74+
// CHECK: Address: %{{.*}} = mark_uninitialized [var] [[ALLOC:%.*]] : $*C
75+
// CHECK: Base: stack - [[ALLOC]] = alloc_stack [var_decl] $C
76+
// CHECK-LABEL: end running test {{.*}} on test_mark_uninitialized_inst: swift_get_access_base
77+
sil [ossa] @test_mark_uninitialized_inst : $@convention(thin) (@owned C) -> () {
78+
bb0(%0 : @owned $C):
79+
%1 = alloc_stack [var_decl] $C, let
80+
%2 = mark_uninitialized [var] %1 : $*C
81+
specify_test "get_access_base %2"
82+
specify_test "swift_get_access_base %2"
83+
assign %0 to %2 : $*C
84+
destroy_addr %2 : $*C
85+
dealloc_stack %1 : $*C
86+
%9999 = tuple()
87+
return %9999 : $()
88+
}

0 commit comments

Comments
 (0)