1; RUN: opt -debug-only=branch-prob -jump-threading -S %s 2>&1 | FileCheck %s
2; REQUIRES: asserts
3
4; Make sure that we clear edge probabilities for bb.cond as we fold
5; the conditional branch in it.
6
7; CHECK: eraseBlock bb.cond
8
9define i32 @foo(i1 %cond) !prof !0 {
10; CHECK-LABEL: @foo
11; CHECK: bb.entry:
12; CHECK-NEXT: br i1 %cond, label %bb.31, label %bb.12
13; CHECK-NOT: bb.cond:
14bb.entry:
15  br i1 %cond, label %bb.31, label %bb.cond
16
17bb.cond:
18  br i1 %cond, label %bb.31, label %bb.12
19
20bb.31:
21  ret i32 31
22
23bb.12:
24  ret i32 12
25}
26
27!0 = !{!"function_entry_count", i64 0}
28