mirror of
https://github.com/c3lang/c3c.git
synced 2026-02-27 12:01:16 +00:00
23 lines
389 B
C
23 lines
389 B
C
module foo;
|
|
|
|
fn int test()
|
|
{
|
|
static int x = 1;
|
|
tlocal int y = 2;
|
|
x++;
|
|
return x;
|
|
}
|
|
|
|
// #expect: foo.ll
|
|
|
|
@test.x = hidden global i32 1, align 4
|
|
@test.y = hidden thread_local global i32 2, align 4
|
|
|
|
define i32 @foo.test()
|
|
|
|
%0 = load i32, i32* @test.x, align 4
|
|
%add = add i32 %0, 1
|
|
store i32 %add, i32* @test.x, align 4
|
|
%1 = load i32, i32* @test.x, align 4
|
|
ret i32 %1
|