Files
c3c/test/test_suite/union/union_codegen_overwrite_call.c3t
2021-11-16 17:46:44 +01:00

32 lines
437 B
C

module test;
union UnionB
{
struct b
{
int a;
}
int c;
double d;
}
extern fn int bar();
fn void test()
{
UnionB b = { .c = bar(), .b = {} };
}
// #expect: test.ll
entry:
%b = alloca %UnionB, align 8
%0 = bitcast %UnionB* %b to i32*
%1 = call i32 @bar()
store i32 %1, i32* %0, align 8
%2 = bitcast %UnionB* %b to %b*
%3 = bitcast %b* %2 to i32*
store i32 0, i32* %3, align 8
ret void