mirror of
https://github.com/c3lang/c3c.git
synced 2026-02-27 12:01:16 +00:00
34 lines
797 B
C
34 lines
797 B
C
// #target: macos-x64
|
|
|
|
module test;
|
|
|
|
fn void tester()
|
|
{
|
|
bool! x = false;
|
|
x ?? true;
|
|
}
|
|
|
|
/* #expect: test.ll
|
|
|
|
define void @test_tester() #0 {
|
|
entry:
|
|
%x = alloca i8, align 1
|
|
%x.f = alloca i64, align 8
|
|
store i8 0, i8* %x, align 1
|
|
store i64 0, i64* %x.f, align 8
|
|
%optval = load i64, i64* %x.f, align 8
|
|
%not_err = icmp eq i64 %optval, 0
|
|
br i1 %not_err, label %after_check, label %else_block
|
|
|
|
after_check: ; preds = %entry
|
|
%0 = load i8, i8* %x, align 1
|
|
%1 = trunc i8 %0 to i1
|
|
br label %phi_block
|
|
|
|
else_block: ; preds = %entry
|
|
br label %phi_block
|
|
|
|
phi_block: ; preds = %else_block, %after_check
|
|
%val = phi i1 [ %1, %after_check ], [ true, %else_block ]
|
|
ret void
|
|
}
|