mirror of
https://github.com/c3lang/c3c.git
synced 2026-02-27 12:01:16 +00:00
32 lines
430 B
Plaintext
32 lines
430 B
Plaintext
// #target: macos-x64
|
|
|
|
module test;
|
|
typedef Kind = int;
|
|
const Kind KIND_0 = 0;
|
|
const Kind KIND_1 = 1;
|
|
|
|
struct Foo
|
|
{
|
|
int a;
|
|
}
|
|
struct Descriptor2
|
|
{
|
|
Kind kind;
|
|
Foo flags;
|
|
}
|
|
|
|
Descriptor2 descriptor1 = {
|
|
.kind = KIND_1,
|
|
.flags = {},
|
|
};
|
|
|
|
fn int main()
|
|
{
|
|
Descriptor2 d = descriptor1;
|
|
return 0;
|
|
}
|
|
|
|
/* #expect: test.ll
|
|
|
|
@test.descriptor1 = local_unnamed_addr global %Descriptor2 { i32 1, %Foo zeroinitializer }, align 4
|