Files
c3c/test/test_suite/attributes/user_defined_attributes.c3t

45 lines
698 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] }
@.typeid.test.Foo = linkonce constant { i8, i64 } { i8 10, i64 2 }, 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, i32* %x, align 4
ret void
}
define void @test.main() #1 {
entry:
call void @test.testme()
ret void
}