Files
c3c/test/test_suite/compile_time/ct_through_constant.c3t

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
}