Files
c3c/test/test_suite2/struct/struct_codegen_empty.c3t

39 lines
673 B
C

// #target: macos-x64
struct StructA
{
int a;
}
struct StructB
{
struct b
{
int a;
}
}
fn void test()
{
StructA a = {};
StructA a2;
StructB b = {};
StructB b2;
StructB b3 = { .b = { } };
}
/* #expect: struct_codegen_empty.ll
define void @struct_codegen_empty.test() #0 {
entry:
%a = alloca %StructA, align 4
%a2 = alloca %StructA, align 4
%b = alloca %StructB, align 4
%b2 = alloca %StructB, align 4
%b3 = alloca %StructB, align 4
store i32 0, ptr %a, align 4
store i32 0, ptr %a2, align 4
store i32 0, ptr %b, align 4
store i32 0, ptr %b2, align 4
store i32 0, ptr %b3, align 4
ret void
}