mirror of
https://github.com/ldc-developers/ldc.git
synced 2025-05-08 20:06:03 +03:00
25 lines
419 B
D
25 lines
419 B
D
// RUN: %ldc -O -output-ll -of=%t.ll %s && FileCheck %s < %t.ll
|
|
|
|
// CHECK: define {{.*}}11unreachableFZv
|
|
void unreachable()
|
|
{
|
|
import ldc.llvmasm;
|
|
// CHECK-NEXT: unreachable
|
|
__ir!("unreachable", void)();
|
|
// CHECK-NEXT: }
|
|
}
|
|
|
|
extern bool flag;
|
|
|
|
// CHECK: define {{.*}}3bar
|
|
int bar()
|
|
{
|
|
int r = 123;
|
|
if (flag)
|
|
{
|
|
r = 456;
|
|
unreachable();
|
|
}
|
|
// CHECK: ret i32 123
|
|
return r;
|
|
}
|