Files
swift-mirror/test/IRGen/constant_struct_with_padding.sil
Erik Eckstein 1ab582e121 SIL: A new representation of static initializers for global variables.
Static initializers are now represented by a list of literal and aggregate instructions in a SILGlobalVariable.
For details see SIL.rst.

This representation is cleaner than what we did so far (point to the initializer function and do some pattern matching).

One implication of that change is that now (a subset of) instructions not necessarily have a parent function.
Regarding the generated code it's a NFC.
Also the swift module format didn't change because so far we don't serializer global variables.
2017-08-23 09:15:01 -07:00

20 lines
558 B
Plaintext

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