mirror of
https://github.com/c3lang/c3c.git
synced 2026-02-27 12:01:16 +00:00
31 lines
389 B
C
31 lines
389 B
C
// #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
|
|
}
|