1 ; RUN: opt < %s -passes='print<branch-prob>' -disable-output 2>&1 | FileCheck %s
5 ; Check correctness of reported probabilities in case of multiple edges between
6 ; basic blocks. In this case sum of probabilities over all edges should be
7 ; returned by BranchProbabilityInfo::getEdgeProbability.
9 define void @test1(i32 %x) {
10 ;CHECK: edge %entry -> %return probability is 0x0ccccccd / 0x80000000 = 10.00%
11 ;CHECK: edge %entry -> %bb0 probability is 0x26666666 / 0x80000000 = 30.00%
12 ;CHECK: edge %entry -> %bb0 probability is 0x26666666 / 0x80000000 = 30.00%
13 ;CHECK: edge %entry -> %bb0 probability is 0x26666666 / 0x80000000 = 30.00%
14 ;CHECK: edge %entry -> %bb1 probability is 0x26666666 / 0x80000000 = 30.00%
15 ;CHECK: edge %entry -> %bb1 probability is 0x26666666 / 0x80000000 = 30.00%
16 ;CHECK: edge %entry -> %bb1 probability is 0x26666666 / 0x80000000 = 30.00%
17 ;CHECK: edge %entry -> %bb2 probability is 0x26666666 / 0x80000000 = 30.00%
18 ;CHECK: edge %entry -> %bb2 probability is 0x26666666 / 0x80000000 = 30.00%
19 ;CHECK: edge %entry -> %bb2 probability is 0x26666666 / 0x80000000 = 30.00%
20 ;CHECK: edge %bb0 -> %return probability is 0x80000000 / 0x80000000 = 100.00% [HOT edge]
21 ;CHECK: edge %bb1 -> %return probability is 0x80000000 / 0x80000000 = 100.00% [HOT edge]
22 ;CHECK: edge %bb2 -> %return probability is 0x80000000 / 0x80000000 = 100.00% [HOT edge]
25 switch i32 %x, label %return [
37 bb0: ; preds = %entry, %entry, %entry
38 tail call void @g(i32 0)
41 bb1: ; preds = %entry, %entry, %entry
42 tail call void @g(i32 1)
45 bb2: ; preds = %entry, %entry, %entry
46 tail call void @g(i32 2)
49 return: ; preds = %bb2, %bb1, %bb0, %entry