mirror of
https://github.com/c3lang/c3c.git
synced 2026-02-27 12:01:16 +00:00
34 lines
1.2 KiB
C
34 lines
1.2 KiB
C
// #target: macos-x64
|
|
module structo;
|
|
|
|
struct Foo
|
|
{
|
|
int foo;
|
|
long bar;
|
|
}
|
|
|
|
private usize x = Foo.sizeof;
|
|
|
|
private Foo foo1 = { 1, 2 };
|
|
private Foo foo2 = { .foo = 2 };
|
|
private Foo foo3 = { .bar = 3 };
|
|
private Foo foo4 = { .bar = 4, .foo = 4, .bar = 1 };
|
|
private Foo foo5 = {};
|
|
private Foo foo6;
|
|
private const Foo FOO7 = { 1, 2 };
|
|
private Foo foo8 = FOO7;
|
|
|
|
/* #expect: structo.ll
|
|
%Foo = type { i32, i64 }
|
|
|
|
@"ct$structo_Foo" = linkonce constant %.introspect { i8 10, i64 16, i64 0, i64 2, [0 x i64] zeroinitializer }, align 8
|
|
@structo_x = protected unnamed_addr global i64 16, align 8
|
|
@structo_foo1 = protected unnamed_addr global %Foo { i32 1, i64 2 }, align 8
|
|
@structo_foo2 = protected unnamed_addr global %Foo { i32 2, i64 0 }, align 8
|
|
@structo_foo3 = protected unnamed_addr global %Foo { i32 0, i64 3 }, align 8
|
|
@structo_foo4 = protected unnamed_addr global %Foo { i32 4, i64 1 }, align 8
|
|
@structo_foo5 = protected unnamed_addr global %Foo zeroinitializer, align 8
|
|
@structo_foo6 = protected unnamed_addr global %Foo zeroinitializer, align 8
|
|
@structo_FOO7 = protected unnamed_addr constant %Foo { i32 1, i64 2 }, align 8
|
|
@structo_foo8 = protected unnamed_addr global %Foo { i32 1, i64 2 }, align 8
|