mirror of
https://github.com/c3lang/c3c.git
synced 2026-02-27 20:11:17 +00:00
- Order of attribute declaration is changed for `alias`. - Added `LANGUAGE_DEV_VERSION` env constant. - Rename `anyfault` -> `fault`. - Changed `fault` -> `faultdef`. - Added `attrdef` instead of `alias` for attribute aliases.
38 lines
766 B
Plaintext
38 lines
766 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
|
|
br label %phi_block
|
|
|
|
phi_block: ; preds = %else_block
|
|
%1 = call i32 (ptr, ...) @printf(ptr @.str, i32 2)
|
|
%2 = call i32 (ptr, ...) @printf(ptr @.str.3)
|
|
ret void
|
|
}
|