@@ -5,6 +5,7 @@ sil_stage canonical
55
66import Builtin
77import Swift
8+ import SwiftShims
89
910// CHECK-LABEL: sil_global private @privateGlobal
1011sil_global private @privateGlobal : $Int64
@@ -43,6 +44,27 @@ sil_global @referencing_private_globals : $Builtin.RawPointer = {
4344 %initval = address_to_pointer %0 : $*Builtin.RawPointer to $Builtin.RawPointer
4445}
4546
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+
4668// KEEP-NOT: @dead_self_referencing_private_global
4769sil_global private @dead_self_referencing_private_global : $Builtin.RawPointer = {
4870 %0 = global_addr @dead_self_referencing_private_global : $*Builtin.RawPointer
0 commit comments