Files
c3c/test/test_suite/errors/macro_err3.c3t
Christoffer Lerno 69b3263a00 - Added path::home_directory, path::documents_directory, path::videos_directory, path::pictures_directory, path::desktop_directory, path::screenshots_directory,
`path::public_share_directory`, `path::templates_directory`, `path::saved_games_directory`, `path::music_directory`, `path::downloads_directory`.
  Fix codegen bug in expressions like `foo(x()) ?? io::EOF?` causing irregular crashes.
2025-09-06 02:27:10 +02:00

35 lines
671 B
Plaintext

// #target: macos-x64
module test;
import libc;
faultdef FOO;
macro test()
{
defer libc::printf("Test2\n");
return 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 (ptr, ...) @printf(ptr @.str.2)
br label %else_block
else_block: ; preds = %opt_block_cleanup
%1 = call i32 (ptr, ...) @printf(ptr @.str, i32 2)
%2 = call i32 (ptr, ...) @printf(ptr @.str.3)
ret void
}