1; Tests if we handle a branch instructions. 2 3; RUN: %p2i -i %s --insts | FileCheck %s 4; RUN: %p2i -i %s --args -notranslate -timing | \ 5; RUN: FileCheck --check-prefix=NOIR %s 6 7define internal void @SimpleBranch() { 8entry: 9 br label %b3 10b1: 11 br label %b2 12b2: 13 ret void 14b3: 15 br label %b1 16} 17 18; CHECK: define internal void @SimpleBranch() { 19; CHECK-NEXT: entry: 20; CHECK-NEXT: br label %b3 21; CHECK-NEXT: b1: 22; CHECK-NEXT: br label %b2 23; CHECK-NEXT: b2: 24; CHECK-NEXT: ret void 25; CHECK-NEXT: b3: 26; CHECK-NEXT: br label %b1 27; CHECK-NEXT: } 28 29define internal void @CondBranch(i32 %p) { 30entry: 31 %test = trunc i32 %p to i1 32 br i1 %test, label %b1, label %b2 33b1: 34 ret void 35b2: 36 br i1 %test, label %b2, label %b1 37} 38 39; CHECK-NEXT: define internal void @CondBranch(i32 %p) { 40; CHECK-NEXT: entry: 41; CHECK-NEXT: %test = trunc i32 %p to i1 42; CHECK-NEXT: br i1 %test, label %b1, label %b2 43; CHECK-NEXT: b1: 44; CHECK-NEXT: ret void 45; CHECK-NEXT: b2: 46; CHECK-NEXT: br i1 %test, label %b2, label %b1 47; CHECK-NEXT: } 48 49; NOIR: Total across all functions 50