Files
swift-mirror/test/IRGen/constant_struct_with_padding.sil
Doug Gregor 4009814783 [IRGen] Lazily emit SIL global variables
Delay the emission of SIL global variables that aren't externally
visible until they are actually used. This is the same lazy emission
approach that we use for a number of other entities, such as SIL
functions.

Part of rdar://158363967.
2025-09-04 13:03:15 -07:00

20 lines
525 B
Plaintext

// RUN: %target-swift-frontend -module-name main %s -emit-ir -o - | %FileCheck %s
sil_stage canonical
import Builtin
import Swift
struct T {
@_hasStorage var a: Builtin.Int1 { get set }
@_hasStorage var b: Builtin.Int32 { get set }
}
// CHECK: @global = hidden global %T4main1TV <{ i1 false, [3 x i8] undef, i32 0 }>, align 4
sil_global hidden [used] @global : $T = {
%2 = integer_literal $Builtin.Int1, 0
%3 = integer_literal $Builtin.Int32, 0
%initval = struct $T (%2 : $Builtin.Int1, %3 : $Builtin.Int32)
}