mirror of
https://github.com/c3lang/c3c.git
synced 2026-02-27 12:01:16 +00:00
0.5.3: Single-module not respected. Fix issue with compiler defined types. Fix optimization levels for projects. Use GEP i8 on offsets. Optimize foreach on len 1 arrays. Move panic blocks last. Fix generic module wildcard imports. Deprecate init_temp / init_new. Fix issue with macro vaarg and untyped lists. Fix extern const globals.
This commit is contained in:
committed by
Christoffer Lerno
parent
e91f6e268e
commit
deb4cc7c4b
1
test/test_suite/globals/ext_global_init.c3
Normal file
1
test/test_suite/globals/ext_global_init.c3
Normal file
@@ -0,0 +1 @@
|
||||
extern int a = 1; // #error: Extern globals may not have initializers
|
||||
16
test/test_suite/globals/extern_const.c3t
Normal file
16
test/test_suite/globals/extern_const.c3t
Normal file
@@ -0,0 +1,16 @@
|
||||
module test;
|
||||
|
||||
extern const int FOO @extern("foo1");
|
||||
fn int main()
|
||||
{
|
||||
return FOO;
|
||||
}
|
||||
|
||||
module bar;
|
||||
const int FOO @export("foo1") = 123;
|
||||
|
||||
|
||||
|
||||
/* #expect: bar.ll
|
||||
|
||||
@foo1 = local_unnamed_addr constant i32 123, align 4
|
||||
@@ -30,6 +30,6 @@ fn int extract_or_test_files()
|
||||
@g = external global %UzGlobs, align 8
|
||||
|
||||
entry:
|
||||
store ptr getelementptr inbounds (%UzGlobs, ptr @g, i32 0, i32 1), ptr getelementptr inbounds (%UzGlobs, ptr @g, i32 0, i32 2), align 8
|
||||
store ptr getelementptr inbounds (i8, ptr @g, i64 8), ptr getelementptr inbounds (i8, ptr @g, i64 24), align 8
|
||||
ret i32 0
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user