mirror of
https://github.com/c3lang/c3c.git
synced 2026-02-27 12:01:16 +00:00
60 lines
1.2 KiB
Plaintext
60 lines
1.2 KiB
Plaintext
// #target: macos-x64
|
|
|
|
module test;
|
|
|
|
attrdef @Foo = @noreturn, @weak;
|
|
|
|
attrdef @Align(y) = @align(y);
|
|
attrdef @Align16(x) @private = @Align(8 * x), @align(1024);
|
|
attrdef @Test = @noinline;
|
|
attrdef @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, i64 0, 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 uwtable "no-trapping-math"="true" "stack-protector-buffer-size"="8" }
|
|
attributes #1 = { noinline nounwind uwtable "no-trapping-math"="true" "stack-protector-buffer-size"="8" }
|
|
attributes #2 = { nounwind uwtable "no-trapping-math"="true" "stack-protector-buffer-size"="8" }
|