Files
c3c/test/test_suite/errors/macro_err3.c3t

37 lines
944 B
C

// #target: macos-x64
module test;
fault Tester { FOO }
macro test()
{
defer libc::printf("Test2\n");
return Tester.FOO!;
}
fn void main()
{
defer libc::printf("Test1\n");
libc::printf("%d\n", test() ?? 2);
}
/* #expect: test.ll
define void @test.main() #0 {
entry:
%blockret = alloca i32, align 4
br label %opt_block_cleanup
opt_block_cleanup: ; preds = %entry
%0 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.2, i32 0, i32 0))
br label %else_block
else_block: ; preds = %opt_block_cleanup
br label %phi_block
phi_block: ; preds = %else_block
%1 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i32 0, i32 0), i32 2)
%2 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.3, i32 0, i32 0))
ret void
}