mirror of
https://github.com/c3lang/c3c.git
synced 2026-02-27 12:01:16 +00:00
Fixing distinct, typedef and bitstruct copying. Fix where global constants did not need to be constant. Bump to 0.2.26
This commit is contained in:
committed by
Christoffer Lerno
parent
64d883cb99
commit
6f5f5feb97
25
test/test_suite/constants/init_order.c3t
Normal file
25
test/test_suite/constants/init_order.c3t
Normal file
@@ -0,0 +1,25 @@
|
||||
// #target: macos-x64
|
||||
module test;
|
||||
|
||||
macro foo()
|
||||
{
|
||||
$if ($defined(A)):
|
||||
return A + 1;
|
||||
$else:
|
||||
return 1;
|
||||
$endif;
|
||||
}
|
||||
|
||||
const Z = foo();
|
||||
|
||||
$if (!$defined(A) && Z == 1):
|
||||
const A = 222;
|
||||
$endif;
|
||||
|
||||
const B = foo();
|
||||
|
||||
/* #expect: test.ll
|
||||
|
||||
@test_Z = local_unnamed_addr constant i32 1, align 4
|
||||
@test_B = local_unnamed_addr constant i32 223, align 4
|
||||
@test_A = local_unnamed_addr constant i32 222, align 4
|
||||
Reference in New Issue
Block a user