mirror of
https://github.com/c3lang/c3c.git
synced 2026-02-27 12:01:16 +00:00
Assert when a macro with compile time value is discarded, e.g. foo(); where foo() returns an untyped list. #2117
This commit is contained in:
25
test/test_suite/macros/macro_untyped_output.c3t
Normal file
25
test/test_suite/macros/macro_untyped_output.c3t
Normal file
@@ -0,0 +1,25 @@
|
||||
// #target: macos-x64
|
||||
module test;
|
||||
fn int main()
|
||||
{
|
||||
foo();
|
||||
bar(0);
|
||||
int x;
|
||||
bar(x++);
|
||||
return 0;
|
||||
}
|
||||
|
||||
macro foo() => {};
|
||||
macro bar(x) => {};
|
||||
|
||||
/* #expect: test.ll
|
||||
|
||||
define i32 @main() #0 {
|
||||
entry:
|
||||
%x = alloca i32, align 4
|
||||
store i32 0, ptr %x, align 4
|
||||
%0 = load i32, ptr %x, align 4
|
||||
%add = add i32 %0, 1
|
||||
store i32 %add, ptr %x, align 4
|
||||
ret i32 0
|
||||
}
|
||||
Reference in New Issue
Block a user