Files
c3c/test/test_suite/union/union_codegen_overwrite_call.c3t
2024-05-16 11:28:04 +02:00

31 lines
389 B
Plaintext

// #target: macos-x64
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
define void @test.test() #0 {
entry:
%b = alloca %UnionB, align 8
%0 = call i32 @bar()
store i32 %0, ptr %b, align 8
store i32 0, ptr %b, align 8
ret void
}