mirror of
https://github.com/c3lang/c3c.git
synced 2026-02-27 12:01:16 +00:00
Compiler segfault when modifying variable using an inline assembly block inside defer #2450.
This commit is contained in:
28
test/test_suite/asm/asm_defer.c3t
Normal file
28
test/test_suite/asm/asm_defer.c3t
Normal file
@@ -0,0 +1,28 @@
|
||||
// #target: macos-x64
|
||||
module test;
|
||||
fn int main(String[] args)
|
||||
{
|
||||
defer
|
||||
{
|
||||
int x;
|
||||
asm
|
||||
{
|
||||
movl [x], 1;
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* #expect: test.ll
|
||||
|
||||
entry:
|
||||
%args = alloca %"char[][]", align 8
|
||||
%x = alloca i32, align 4
|
||||
store ptr %0, ptr %args, align 8
|
||||
%ptradd = getelementptr inbounds i8, ptr %args, i64 8
|
||||
store i64 %1, ptr %ptradd, align 8
|
||||
store i32 0, ptr %x, align 4
|
||||
%2 = load i32, ptr %x, align 4
|
||||
call void asm sideeffect alignstack "movl $$1, ($0)\0A", "r,~{flags},~{dirflag},~{fspr}"(i32 %2)
|
||||
ret i32 0
|
||||
}
|
||||
Reference in New Issue
Block a user