Skip to content

Commit 70536fb

Browse files
committed
EscapeInfo: add a test for the destroyArray builtin
1 parent ad67883 commit 70536fb

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed

test/SILOptimizer/escape_info.sil

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1240,3 +1240,24 @@ bb0:
12401240
return %14 : $()
12411241
}
12421242

1243+
// CHECK-LABEL: Escape information for test_destroyArray:
1244+
// CHECK: global: %0 = alloc_ref $Y
1245+
// CHECK: - : %1 = alloc_ref $Z
1246+
// CHECK: End function test_destroyArray
1247+
sil @test_destroyArray : $@convention(thin) () -> () {
1248+
bb0:
1249+
%0 = alloc_ref $Y
1250+
%1 = alloc_ref $Z
1251+
%2 = ref_element_addr %1 : $Z, #Z.y
1252+
store %0 to %2 : $*Y
1253+
%4 = alloc_stack $Z
1254+
store %1 to %4 : $*Z
1255+
%6 = metatype $@thick Z.Type
1256+
%7 = address_to_pointer %4 : $*Z to $Builtin.RawPointer
1257+
%8 = integer_literal $Builtin.Word, 1
1258+
%9 = builtin "destroyArray"<Z>(%6 : $@thick Z.Type, %7 : $Builtin.RawPointer, %8 : $Builtin.Word) : $()
1259+
dealloc_stack %4 : $*Z
1260+
%11 = tuple ()
1261+
return %11 : $()
1262+
}
1263+

0 commit comments

Comments
 (0)