blob: c4cba436ebba84e82f2ae40dc2cffff2faac7258 [file] [log] [blame]
Cong Hou08cb4fc2015-08-27 00:37:40 +00001; RUN: llc -march=x86-64 -print-machineinstrs=expand-isel-pseudos %s -o /dev/null 2>&1 | FileCheck %s
2
3
4; CHECK-LABEL: test
5
6define void @test(i32 %x) nounwind {
7entry:
8 switch i32 %x, label %sw.default [
9 i32 54, label %sw.bb
10 i32 55, label %sw.bb
11 i32 56, label %sw.bb
12 i32 58, label %sw.bb
13 i32 67, label %sw.bb
14 i32 68, label %sw.bb
15 i32 134, label %sw.bb
16 i32 140, label %sw.bb
17 ], !prof !1
18
19sw.bb:
20 call void @foo(i32 0)
21 br label %sw.epilog
22
23sw.default:
24 call void @foo(i32 1)
25 br label %sw.epilog
26
27sw.epilog:
28 ret void
29
30; Check if weights are correctly assigned to edges generated from switch
31; statement.
32;
33; CHECK: BB#4:
34; CHECK: Successors according to CFG: BB#1(10) BB#6(10)
35; CHECK: BB#6:
36; CHECK: Successors according to CFG: BB#1(10) BB#2(10)
37}
38
39declare void @foo(i32)
40
41!1 = !{!"branch_weights", i32 10, i32 10, i32 10, i32 10, i32 10, i32 10, i32 10, i32 10, i32 10}