Files
c3c/test/test_suite/assert/unreachable.c3t
Christoffer Lerno f2e5c5e9b9 - Fix bug with @jump miscompile
- Remove "panic" text from unreachable() when safe mode is turned off.
2024-06-22 23:20:23 +02:00

31 lines
568 B
Plaintext

// #target: macos-x64
fn int foo()
{
return 1;
}
fn void test()
{
int x = foo();
if (x > 0) return;
unreachable();
}
/* #expect: unreachable.ll
define void @unreachable.test() #0 {
entry:
%x = alloca i32, align 4
%0 = call i32 @unreachable.foo()
store i32 %0, ptr %x, align 4
%1 = load i32, ptr %x, align 4
%gt = icmp sgt i32 %1, 0
br i1 %gt, label %if.then, label %if.exit
if.then: ; preds = %entry
ret void
if.exit: ; preds = %entry
unreachable
}