mirror of
https://github.com/c3lang/c3c.git
synced 2026-02-27 20:11:17 +00:00
34 lines
985 B
Plaintext
34 lines
985 B
Plaintext
module structo;
|
|
|
|
struct Foo
|
|
{
|
|
int foo;
|
|
long bar;
|
|
}
|
|
|
|
private usize x = $sizeof(Foo);
|
|
|
|
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 }
|
|
|
|
@Foo = linkonce_odr constant i8 1
|
|
@structo.x = protected global i64 16, align 8
|
|
@structo.foo1 = protected global %Foo { i32 1, i64 2 }, align 8
|
|
@structo.foo2 = protected global %Foo { i32 2, i64 0 }, align 8
|
|
@structo.foo3 = protected global %Foo { i32 0, i64 3 }, align 8
|
|
@structo.foo4 = protected global %Foo { i32 4, i64 1 }, align 8
|
|
@structo.foo5 = protected global %Foo zeroinitializer, align 8
|
|
@structo.foo6 = protected global %Foo zeroinitializer, align 8
|
|
@structo.FOO7 = protected constant %Foo { i32 1, i64 2 }, align 8
|
|
@structo.foo8 = protected global %Foo { i32 1, i64 2 }, align 8
|