Files
c3c/test/test_suite/errors/or_err_bool.c3t
2022-03-21 13:22:59 +01:00

32 lines
764 B
C

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
%0 = load i64, i64* %x.f, align 8
%not_err = icmp eq i64 %0, 0
br i1 %not_err, label %after_check, label %else_block
after_check: ; preds = %entry
%1 = load i8, i8* %x, align 1
%2 = trunc i8 %1 to i1
br label %phi_block
else_block: ; preds = %entry
br label %phi_block
phi_block: ; preds = %else_block, %after_check
%val = phi i1 [ %2, %after_check ], [ true, %else_block ]
ret void
}