mirror of
https://github.com/c3lang/c3c.git
synced 2026-02-27 12:01:16 +00:00
33 lines
550 B
Plaintext
33 lines
550 B
Plaintext
// #target: macos-x64
|
|
|
|
struct Abc {
|
|
long a;
|
|
long b;
|
|
long c;
|
|
long d;
|
|
long e;
|
|
}
|
|
|
|
extern fn Abc foo1();
|
|
extern fn Abc foo2();
|
|
|
|
fn void bar() {
|
|
Abc dummy1 = foo1();
|
|
Abc dummy2 = foo2();
|
|
}
|
|
|
|
/* #expect: test_sret.ll
|
|
|
|
declare void @foo1(ptr noalias sret(%Abc) align 8) #0
|
|
|
|
declare void @foo2(ptr noalias sret(%Abc) align 8) #0
|
|
|
|
define void @test_sret.bar() #0 {
|
|
entry:
|
|
%dummy1 = alloca %Abc, align 8
|
|
%dummy2 = alloca %Abc, align 8
|
|
call void @foo1(ptr sret(%Abc) align 8 %dummy1)
|
|
call void @foo2(ptr sret(%Abc) align 8 %dummy2)
|
|
ret void
|
|
}
|