d2b8cc383945e89c53e4453e1c6571a7c83f32a8
[oota-llvm.git] / test / CodeGen / X86 / test-pic-jtbl.ll
1 ; RUN: llvm-as < %s | llc -mtriple=i686-pc-linux-gnu -relocation-model=pic \
2 ; RUN:   -o %t -f
3 ; RUN: grep _GLOBAL_OFFSET_TABLE_ %t
4 ; RUN: grep piclabel %t | wc -l | grep 3 
5 ; RUN: grep PLT %t | wc -l | grep 11 
6 ; RUN: grep GOTOFF %t | wc -l | grep 1 
7 ; RUN: grep JTI %t | wc -l | grep 13
8 ; Improved tail merging could reduce the number of PLT's and JTI's further.
9
10 define void @bar(i32 %n.u) {
11 entry:
12     switch i32 %n.u, label %bb12 [i32 1, label %bb i32 2, label %bb6 i32 4, label %bb7 i32 5, label %bb8 i32 6, label %bb10 i32 7, label %bb1 i32 8, label %bb3 i32 9, label %bb4 i32 10, label %bb9 i32 11, label %bb2 i32 12, label %bb5 i32 13, label %bb11 ]
13 bb:
14     tail call void(...)* @foo1()
15     ret void
16 bb1:
17     tail call void(...)* @foo2()
18     ret void
19 bb2:
20     tail call void(...)* @foo6()
21     ret void
22 bb3:
23     tail call void(...)* @foo3()
24     ret void
25 bb4:
26     tail call void(...)* @foo4()
27     ret void
28 bb5:
29     tail call void(...)* @foo5()
30     ret void
31 bb6:
32     tail call void(...)* @foo1()
33     ret void
34 bb7:
35     tail call void(...)* @foo2()
36     ret void
37 bb8:
38     tail call void(...)* @foo6()
39     ret void
40 bb9:
41     tail call void(...)* @foo3()
42     ret void
43 bb10:
44     tail call void(...)* @foo4()
45     ret void
46 bb11:
47     tail call void(...)* @foo5()
48     ret void
49 bb12:
50     tail call void(...)* @foo6()
51     ret void
52 }
53
54 declare void @foo1(...)
55 declare void @foo2(...)
56 declare void @foo6(...)
57 declare void @foo3(...)
58 declare void @foo4(...)
59 declare void @foo5(...)