| ; 1. Trivial smoke test of compare and branch, with multiple basic |
| ; 2. For a conditional branch on a constant boolean value, make sure |
| ; we don't lower to a cmp instructions with an immediate as the first |
| ; RUN: %p2i -i %s --args -O2 --verbose inst | FileCheck %s |
| ; RUN: %p2i -i %s --args -Om1 --verbose inst | FileCheck %s |
| ; RUN: %p2i -i %s --args --verbose none | FileCheck --check-prefix=ERRORS %s |
| ; RUN: %p2i -i %s --insts | %szdiff %s | FileCheck --check-prefix=DUMP %s |
| define i32 @simple_cond_branch(i32 %foo, i32 %bar) { |
| %r1 = icmp eq i32 %foo, %bar |
| br i1 %r1, label %Equal, label %Unequal |
| ; CHECK-LABEL: simple_cond_branch |
| ; CHECK: br i1 %r1, label %Equal, label %Unequal |
| define internal i32 @test_br_const() { |
| br i1 true, label %__1, label %__2 |
| ; CHECK-LABEL: test_br_const |
| ; CHECK-NOT: cmp {{[0-9]*}}, |
| ; ERRORS-NOT: ICE translation error |