mirror of
https://github.com/c3lang/c3c.git
synced 2026-02-27 12:01:16 +00:00
34 lines
933 B
Plaintext
34 lines
933 B
Plaintext
module structo;
|
|
|
|
struct Foo
|
|
{
|
|
int foo;
|
|
long bar;
|
|
}
|
|
|
|
usize x = Foo.sizeof;
|
|
|
|
Foo foo1 = { 1, 2 };
|
|
Foo foo2 = { .foo = 2 };
|
|
Foo foo3 = { .bar = 3 };
|
|
Foo foo4 = { .bar = 4, .foo = 4, .bar = 1 };
|
|
Foo foo5 = {};
|
|
Foo foo6;
|
|
const Foo FOO7 = { 1, 2 };
|
|
Foo foo8 = FOO7;
|
|
|
|
// #expect: struct_const_construct_simple.ll
|
|
|
|
%structo.Foo = type { i32, i64 }
|
|
|
|
@Foo = linkonce_odr constant i8 1
|
|
@x = protected global i64 16, align 8
|
|
@foo1 = protected global %structo.Foo { i32 1, i64 2 }, align 8
|
|
@foo2 = protected global %structo.Foo { i32 2, i64 0 }, align 8
|
|
@foo3 = protected global %structo.Foo { i32 0, i64 3 }, align 8
|
|
@foo4 = protected global %structo.Foo { i32 4, i64 1 }, align 8
|
|
@foo5 = protected global %structo.Foo zeroinitializer, align 8
|
|
@foo6 = protected global %structo.Foo zeroinitializer, align 8
|
|
@FOO7 = protected constant %structo.Foo { i32 1, i64 2 }, align 8
|
|
@foo8 = protected global %structo.Foo { i32 1, i64 2 }, align 8
|