Files
c3c/test/test_suite/stdlib/volatile.c3t
Christoffer Lerno 428165590e Add Volatile type.
2025-07-22 14:13:48 +02:00

25 lines
449 B
Plaintext

// #target: macos-x64
module test;
import std;
fn void main()
{
Volatile{int} y;
y.set(20);
y.get();
}
/* #expect: test.ll
define void @test.main() #0 {
entry:
%y = alloca i32, align 4
store i32 0, ptr %y, align 4
%neq = icmp ne ptr %y, null
call void @llvm.assume(i1 %neq)
store volatile i32 20, ptr %y, align 4
%neq1 = icmp ne ptr %y, null
call void @llvm.assume(i1 %neq1)
%0 = load volatile i32, ptr %y, align 4
ret void
}