Use the llvm-upgrade program to upgrade llvm assembly.
[oota-llvm.git] / test / Transforms / SimplifyCFG / switch-simplify-crash.ll
1 ; RUN: llvm-upgrade < %s | llvm-as | opt -simplifycfg -disable-output
2
3
4 void %NewExtractNames() {
5 entry:
6         br bool false, label %endif.0, label %then.0
7
8 then.0:         ; preds = %entry
9         br bool false, label %shortcirc_next.i, label %shortcirc_done.i
10
11 shortcirc_next.i:               ; preds = %then.0
12         br label %shortcirc_done.i
13
14 shortcirc_done.i:               ; preds = %shortcirc_next.i, %then.0
15         br bool false, label %then.0.i, label %else.0.i
16
17 then.0.i:               ; preds = %shortcirc_done.i
18         br label %NewBase.exit
19
20 else.0.i:               ; preds = %shortcirc_done.i
21         br bool false, label %endif.0.i, label %else.1.i
22
23 else.1.i:               ; preds = %else.0.i
24         br bool false, label %endif.0.i, label %else.2.i
25
26 else.2.i:               ; preds = %else.1.i
27         br label %NewBase.exit
28
29 endif.0.i:              ; preds = %else.1.i, %else.0.i
30         br label %NewBase.exit
31
32 NewBase.exit:           ; preds = %endif.0.i, %else.2.i, %then.0.i
33         br label %endif.0
34
35 endif.0:                ; preds = %NewBase.exit, %entry
36         %tmp.32.mask = and uint 0, 31           ; <uint> [#uses=1]
37         switch uint %tmp.32.mask, label %label.9 [
38                  uint 16, label %loopentry.2
39                  uint 15, label %loopentry.2
40                  uint 14, label %loopentry.2
41                  uint 13, label %loopentry.2
42                  uint 10, label %loopentry.2
43                  uint 20, label %loopentry.1
44                  uint 19, label %loopentry.1
45                  uint 2, label %loopentry.0
46                  uint 0, label %switchexit
47         ]
48
49 loopentry.0:            ; preds = %endif.1, %endif.0
50         br bool false, label %no_exit.0, label %switchexit
51
52 no_exit.0:              ; preds = %loopentry.0
53         br bool false, label %then.1, label %else.1
54
55 then.1:         ; preds = %no_exit.0
56         br label %endif.1
57
58 else.1:         ; preds = %no_exit.0
59         br bool false, label %shortcirc_next.0, label %shortcirc_done.0
60
61 shortcirc_next.0:               ; preds = %else.1
62         br label %shortcirc_done.0
63
64 shortcirc_done.0:               ; preds = %shortcirc_next.0, %else.1
65         br bool false, label %then.2, label %endif.2
66
67 then.2:         ; preds = %shortcirc_done.0
68         br label %endif.2
69
70 endif.2:                ; preds = %then.2, %shortcirc_done.0
71         br label %endif.1
72
73 endif.1:                ; preds = %endif.2, %then.1
74         br label %loopentry.0
75
76 loopentry.1:            ; preds = %endif.3, %endif.0, %endif.0
77         br bool false, label %no_exit.1, label %switchexit
78
79 no_exit.1:              ; preds = %loopentry.1
80         br bool false, label %then.3, label %else.2
81
82 then.3:         ; preds = %no_exit.1
83         br label %endif.3
84
85 else.2:         ; preds = %no_exit.1
86         br bool false, label %shortcirc_next.1, label %shortcirc_done.1
87
88 shortcirc_next.1:               ; preds = %else.2
89         br label %shortcirc_done.1
90
91 shortcirc_done.1:               ; preds = %shortcirc_next.1, %else.2
92         br bool false, label %then.4, label %endif.4
93
94 then.4:         ; preds = %shortcirc_done.1
95         br label %endif.4
96
97 endif.4:                ; preds = %then.4, %shortcirc_done.1
98         br label %endif.3
99
100 endif.3:                ; preds = %endif.4, %then.3
101         br label %loopentry.1
102
103 loopentry.2:            ; preds = %endif.5, %endif.0, %endif.0, %endif.0, %endif.0, %endif.0
104         %i.3 = phi int [ 0, %endif.5 ], [ 0, %endif.0 ], [ 0, %endif.0 ], [ 0, %endif.0 ], [ 0, %endif.0 ], [ 0, %endif.0 ]             ; <int> [#uses=1]
105         %tmp.158 = setlt int %i.3, 0            ; <bool> [#uses=1]
106         br bool %tmp.158, label %no_exit.2, label %switchexit
107
108 no_exit.2:              ; preds = %loopentry.2
109         br bool false, label %shortcirc_next.2, label %shortcirc_done.2
110
111 shortcirc_next.2:               ; preds = %no_exit.2
112         br label %shortcirc_done.2
113
114 shortcirc_done.2:               ; preds = %shortcirc_next.2, %no_exit.2
115         br bool false, label %then.5, label %endif.5
116
117 then.5:         ; preds = %shortcirc_done.2
118         br label %endif.5
119
120 endif.5:                ; preds = %then.5, %shortcirc_done.2
121         br label %loopentry.2
122
123 label.9:                ; preds = %endif.0
124         br bool false, label %then.6, label %endif.6
125
126 then.6:         ; preds = %label.9
127         br label %endif.6
128
129 endif.6:                ; preds = %then.6, %label.9
130         store int 0, int* null
131         br label %switchexit
132
133 switchexit:             ; preds = %endif.6, %loopentry.2, %loopentry.1, %loopentry.0, %endif.0
134         br bool false, label %endif.7, label %then.7
135
136 then.7:         ; preds = %switchexit
137         br bool false, label %shortcirc_next.3, label %shortcirc_done.3
138
139 shortcirc_next.3:               ; preds = %then.7
140         br label %shortcirc_done.3
141
142 shortcirc_done.3:               ; preds = %shortcirc_next.3, %then.7
143         br bool false, label %then.8, label %endif.8
144
145 then.8:         ; preds = %shortcirc_done.3
146         br label %endif.8
147
148 endif.8:                ; preds = %then.8, %shortcirc_done.3
149         br label %endif.7
150
151 endif.7:                ; preds = %endif.8, %switchexit
152         ret void
153 }