1 ; RUN: opt < %s -passes=partial-inliner -max-num-inline-blocks=2 -skip-partial-inlining-cost-analysis -S | FileCheck %s
3 ; This test checks to make sure that CodeExtractor updates
4 ; the exit branch probabilities for multiple exit blocks.
6 define i32 @inlinedFunc(i1 %cond) !prof !1 {
8 br i1 %cond, label %if.then, label %return, !prof !2
10 br i1 %cond, label %return, label %return.2, !prof !3
13 return: ; preds = %entry
18 define internal i32 @dummyCaller(i1 %cond) !prof !1 {
20 %val = call i32 @inlinedFunc(i1 %cond)
23 ; CHECK-LABEL: @dummyCaller
25 ; CHECK-NEXT: br i1 {{.*}}return.i{{.*}}return.2{{.*}}!prof [[COUNT1:![0-9]+]]
28 !llvm.module.flags = !{!0}
29 !0 = !{i32 1, !"MaxFunctionCount", i32 10000}
30 !1 = !{!"function_entry_count", i64 10000}
31 !2 = !{!"branch_weights", i32 5, i32 5}
32 !3 = !{!"branch_weights", i32 4, i32 1}
34 ; CHECK: [[COUNT1]] = !{!"branch_weights", i32 858993459, i32 214748365}