1 ; RUN: opt -S < %s -jump-threading | FileCheck %s
3 ; PR40992: Do not incorrectly fold %bb5 into an unconditional br to %bb7.
4 ; Also verify we correctly thread %bb1 -> %bb7 when %c is false.
6 define i32 @jtbr(i1 %v1, i1 %v2, i1 %v3) {
13 ; CHECK-NEXT: br i1 %c, label %bb2, label %bb7
16 br i1 %c, label %bb2, label %bb5
20 ; CHECK-NEXT: indirectbr i8* %ba, [label %bb3, label %bb5]
22 %ba = select i1 %v3, i8* blockaddress(@jtbr, %bb3), i8* blockaddress(@jtbr, %bb4)
23 indirectbr i8* %ba, [label %bb3, label %bb4]
35 br i1 %c, label %bb6, label %bb7