mirror of
https://github.com/c3lang/c3c.git
synced 2026-02-27 20:11:17 +00:00
40 lines
767 B
C
40 lines
767 B
C
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 |