@@ -5,6 +5,7 @@ sil_stage canonical
5
5
6
6
import Builtin
7
7
import Swift
8
+ import SwiftShims
8
9
9
10
// CHECK-LABEL: sil_global private @privateGlobal
10
11
sil_global private @privateGlobal : $Int64
@@ -43,6 +44,27 @@ sil_global @referencing_private_globals : $Builtin.RawPointer = {
43
44
%initval = address_to_pointer %0 : $*Builtin.RawPointer to $Builtin.RawPointer
44
45
}
45
46
47
+ // CHECK-LABEL: sil_global private @array_buffer
48
+ sil_global private @array_buffer : $_ContiguousArrayStorage<Int> = {
49
+ %0 = integer_literal $Builtin.Int64, 3
50
+ %1 = struct $Int (%0 : $Builtin.Int64)
51
+ %2 = integer_literal $Builtin.Int64, 6
52
+ %3 = struct $UInt (%2 : $Builtin.Int64)
53
+ %4 = struct $_SwiftArrayBodyStorage (%1 : $Int, %3 : $UInt)
54
+ %5 = struct $_ArrayBody (%4 : $_SwiftArrayBodyStorage)
55
+ %6 = integer_literal $Builtin.Int64, 1
56
+ %7 = struct $Int (%6 : $Builtin.Int64)
57
+ %8 = integer_literal $Builtin.Int64, 2
58
+ %9 = struct $Int (%8 : $Builtin.Int64)
59
+ %initval = object $_ContiguousArrayStorage<Int> (%5 : $_ArrayBody, [tail_elems] %7 : $Int, %9 : $Int, %1 : $Int)
60
+ }
61
+
62
+ // CHECK-LABEL: sil_global @referencing_object
63
+ sil_global @referencing_object : $Builtin.BridgeObject = {
64
+ %0 = global_value @array_buffer : $_ContiguousArrayStorage<Int>
65
+ %initval = unchecked_ref_cast %0 : $_ContiguousArrayStorage<Int> to $Builtin.BridgeObject
66
+ }
67
+
46
68
// KEEP-NOT: @dead_self_referencing_private_global
47
69
sil_global private @dead_self_referencing_private_global : $Builtin.RawPointer = {
48
70
%0 = global_addr @dead_self_referencing_private_global : $*Builtin.RawPointer
0 commit comments