Files
c3c/test/test_suite/attributes/user_defined_attributes.c3t
Christoffer Lerno 3e54d13b62 Prefer def
2023-06-02 20:08:45 +02:00

57 lines
985 B
C

// #target: macos-x64
module test;
def @Foo = { @noreturn @weak };
def @Align(y) = { @align(y) };
def @Align16(x) @private = { @Align(8 * x) @align(1024) };
def @Test = { @noinline };
def @TestZero = { };
struct Foo
{
int z;
int xy @Align16(8);
}
Foo f;
fn void testme2() @Foo
{}
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 global %.introspect { i8 10, ptr null, i64 2048, i64 0, i64 2, [0 x i64] zeroinitializer }, align 8
@test.f = local_unnamed_addr global %Foo zeroinitializer, align 1024
define weak void @test.testme2() #0 {
entry:
ret void
}
define void @test.testme() #1 {
entry:
%x = alloca i32, align 4
store i32 0, ptr %x, align 4
ret void
}
define void @test.main() #2 {
entry:
call void @test.testme()
ret void
}
attributes #0 = { noreturn nounwind }
attributes #1 = { noinline nounwind }
attributes #2 = { nounwind }