mirror of
https://github.com/c3lang/c3c.git
synced 2026-02-27 03:51:18 +00:00
45 lines
739 B
C
45 lines
739 B
C
// #target: macos-x64
|
|
|
|
module test;
|
|
|
|
define @Align(y) = @align(y);
|
|
define @Align16(x) = @Align(8 * x), @align(1024);
|
|
define @Test = @noinline;
|
|
define @TestZero;
|
|
struct Foo
|
|
{
|
|
int z;
|
|
int xy @Align16(8);
|
|
}
|
|
|
|
Foo f;
|
|
|
|
fn void testme() @Test
|
|
{
|
|
int x;
|
|
}
|
|
|
|
fn void main() @TestZero
|
|
{
|
|
testme();
|
|
}
|
|
|
|
/* #expect: test.ll
|
|
|
|
%Foo = type { i32, [1020 x i8], i32, [1020 x i8] }
|
|
|
|
@"ct$test_Foo" = linkonce constant %.introspect { i8 10, i64 2048, i64 0, i64 2, [0 x i64] zeroinitializer }, align 8
|
|
@test_f = local_unnamed_addr global %Foo zeroinitializer, align 1024
|
|
|
|
define void @test_testme() #0 {
|
|
entry:
|
|
%x = alloca i32, align 4
|
|
store i32 0, ptr %x, align 4
|
|
ret void
|
|
}
|
|
|
|
define void @test_main() #1 {
|
|
entry:
|
|
call void @test_testme()
|
|
ret void
|
|
}
|