mirror of
https://github.com/c3lang/c3c.git
synced 2026-02-27 12:01:16 +00:00
24 lines
427 B
Plaintext
24 lines
427 B
Plaintext
// #target: macos-x64
|
|
module test;
|
|
|
|
const FOO = "123";
|
|
int[FOO.len] x;
|
|
|
|
fn void main()
|
|
{
|
|
int z = x[0];
|
|
}
|
|
|
|
/* #expect: test.ll
|
|
|
|
@test.FOO = local_unnamed_addr constant %"char[]" { ptr @.str, i64 3 }, align 8
|
|
@test.x = local_unnamed_addr global [3 x i32] zeroinitializer, align 4
|
|
|
|
define void @test.main() #0 {
|
|
entry:
|
|
%z = alloca i32, align 4
|
|
%0 = load i32, ptr @test.x, align 4
|
|
store i32 %0, ptr %z, align 4
|
|
ret void
|
|
}
|