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

41 lines
789 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
%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
%0 = bitcast %StructA* %a to i32*
store i32 0, i32* %0, align 4
%1 = bitcast %StructA* %a2 to i32*
store i32 0, i32* %1, align 4
%2 = bitcast %StructB* %b to i32*
store i32 0, i32* %2, align 4
%3 = bitcast %StructB* %b2 to i32*
store i32 0, i32* %3, align 4
%4 = bitcast %StructB* %b3 to i32*
store i32 0, i32* %4, align 4
ret void