llvm.org GIT mirror llvm / 5aa0307
New testcase for a switch lowering bug. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@30141 91177308-0d34-0410-b5e6-96231b3b80d8 Chris Lattner 13 years ago
1 changed file(s) with 96 addition(s) and 0 deletion(s). Raw diff Collapse all Expand all
0 ; RUN: llvm-as < %s | llc
1
2 void %foo() {
3 br label %cond_true813.i
4
5 cond_true813.i: ; preds = %0
6 br bool false, label %cond_true818.i, label %cond_next1146.i
7
8 cond_true818.i: ; preds = %cond_true813.i
9 br bool false, label %recog_memoized.exit52, label %cond_next1146.i
10
11 recog_memoized.exit52: ; preds = %cond_true818.i
12 switch int 0, label %bb886.i.preheader [
13 int 0, label %bb907.i
14 int 44, label %bb866.i
15 int 103, label %bb874.i
16 int 114, label %bb874.i
17 ]
18
19 bb857.i: ; preds = %bb886.i, %bb866.i
20 %tmp862.i494.24 = phi sbyte* [ null, %bb866.i ], [ %tmp862.i494.26, %bb886.i ] ; [#uses=4]
21 switch int 0, label %bb886.i.preheader [
22 int 0, label %bb907.i
23 int 44, label %bb866.i
24 int 103, label %bb874.i
25 int 114, label %bb874.i
26 ]
27
28 bb866.i.loopexit: ; preds = %bb874.i
29 br label %bb866.i
30
31 bb866.i.loopexit31: ; preds = %cond_true903.i
32 br label %bb866.i
33
34 bb866.i: ; preds = %bb866.i.loopexit31, %bb866.i.loopexit, %bb857.i, %recog_memoized.exit52
35 br bool false, label %bb907.i, label %bb857.i
36
37 bb874.i.preheader.loopexit: ; preds = %cond_true903.i, %cond_true903.i
38 ret void
39
40 bb874.i: ; preds = %bb857.i, %bb857.i, %recog_memoized.exit52, %recog_memoized.exit52
41 %tmp862.i494.25 = phi sbyte* [ %tmp862.i494.24, %bb857.i ], [ %tmp862.i494.24, %bb857.i ], [ undef, %recog_memoized.exit52 ], [ undef, %recog_memoized.exit52 ] ; [#uses=1]
42 switch int 0, label %bb886.i.preheader.loopexit [
43 int 0, label %bb907.i
44 int 44, label %bb866.i.loopexit
45 int 103, label %bb874.i.backedge
46 int 114, label %bb874.i.backedge
47 ]
48
49 bb874.i.backedge: ; preds = %bb874.i, %bb874.i
50 ret void
51
52 bb886.i.preheader.loopexit: ; preds = %bb874.i
53 ret void
54
55 bb886.i.preheader: ; preds = %bb857.i, %recog_memoized.exit52
56 %tmp862.i494.26 = phi sbyte* [ undef, %recog_memoized.exit52 ], [ %tmp862.i494.24, %bb857.i ] ; [#uses=1]
57 br label %bb886.i
58
59 bb886.i: ; preds = %cond_true903.i, %bb886.i.preheader
60 br bool false, label %bb857.i, label %cond_true903.i
61
62 cond_true903.i: ; preds = %bb886.i
63 switch int 0, label %bb886.i [
64 int 0, label %bb907.i
65 int 44, label %bb866.i.loopexit31
66 int 103, label %bb874.i.preheader.loopexit
67 int 114, label %bb874.i.preheader.loopexit
68 ]
69
70 bb907.i: ; preds = %cond_true903.i, %bb874.i, %bb866.i, %bb857.i, %recog_memoized.exit52
71 %tmp862.i494.0 = phi sbyte* [ %tmp862.i494.24, %bb857.i ], [ null, %bb866.i ], [ undef, %recog_memoized.exit52 ], [ %tmp862.i494.25, %bb874.i ], [ null, %cond_true903.i ] ; [#uses=1]
72 br bool false, label %cond_next1146.i, label %cond_true910.i
73
74 cond_true910.i: ; preds = %bb907.i
75 ret void
76
77 cond_next1146.i: ; preds = %bb907.i, %cond_true818.i, %cond_true813.i
78 %tmp862.i494.1 = phi sbyte* [ %tmp862.i494.0, %bb907.i ], [ undef, %cond_true818.i ], [ undef, %cond_true813.i ] ; [#uses=0]
79 ret void
80
81 bb2060.i: ; No predecessors!
82 br bool false, label %cond_true2064.i, label %bb2067.i
83
84 cond_true2064.i: ; preds = %bb2060.i
85 unreachable
86
87 bb2067.i: ; preds = %bb2060.i
88 ret void
89
90 cond_next3473: ; No predecessors!
91 ret void
92
93 cond_next3521: ; No predecessors!
94 ret void
95 }