2009-08-12-badswitch.ll
9.16 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
; RUN: llc < %s | FileCheck %s
target datalayout = "e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v64:64:64-v128:128:128-a0:0:64-s0:64:64-f80:128:128"
target triple = "x86_64-apple-darwin10"
declare void @f1() nounwind readnone
declare void @f2() nounwind readnone
declare void @f3() nounwind readnone
declare void @f4() nounwind readnone
declare void @f5() nounwind readnone
declare void @f6() nounwind readnone
declare void @f7() nounwind readnone
declare void @f8() nounwind readnone
declare void @f9() nounwind readnone
declare void @f10() nounwind readnone
declare void @f11() nounwind readnone
declare void @f12() nounwind readnone
declare void @f13() nounwind readnone
declare void @f14() nounwind readnone
declare void @f15() nounwind readnone
declare void @f16() nounwind readnone
declare void @f17() nounwind readnone
declare void @f18() nounwind readnone
declare void @f19() nounwind readnone
declare void @f20() nounwind readnone
declare void @f21() nounwind readnone
declare void @f22() nounwind readnone
declare void @f23() nounwind readnone
declare void @f24() nounwind readnone
declare void @f25() nounwind readnone
declare void @f26() nounwind readnone
define internal fastcc i32 @foo(i64 %bar) nounwind ssp {
; CHECK-LABEL: foo:
; CHECK: ## %bb.0: ## %entry
; CHECK-NEXT: pushq %rax
; CHECK-NEXT: addq $-2, %rdi
; CHECK-NEXT: cmpq $25, %rdi
; CHECK-NEXT: ja LBB0_2
; CHECK-NEXT: ## %bb.1: ## %bb49
; CHECK-NEXT: leaq {{.*}}(%rip), %rax
; CHECK-NEXT: movslq (%rax,%rdi,4), %rcx
; CHECK-NEXT: addq %rax, %rcx
; CHECK-NEXT: jmpq *%rcx
; CHECK-NEXT: LBB0_3: ## %RRETURN_6
; CHECK-NEXT: callq _f2
; CHECK-NEXT: jmp LBB0_28
; CHECK-NEXT: LBB0_2: ## %RETURN
; CHECK-NEXT: callq _f1
; CHECK-NEXT: jmp LBB0_28
; CHECK-NEXT: LBB0_4: ## %RRETURN_7
; CHECK-NEXT: callq _f3
; CHECK-NEXT: jmp LBB0_28
; CHECK-NEXT: LBB0_5: ## %RRETURN_14
; CHECK-NEXT: callq _f4
; CHECK-NEXT: jmp LBB0_28
; CHECK-NEXT: LBB0_6: ## %RRETURN_15
; CHECK-NEXT: callq _f5
; CHECK-NEXT: jmp LBB0_28
; CHECK-NEXT: LBB0_7: ## %RRETURN_16
; CHECK-NEXT: callq _f6
; CHECK-NEXT: jmp LBB0_28
; CHECK-NEXT: LBB0_8: ## %RRETURN_17
; CHECK-NEXT: callq _f7
; CHECK-NEXT: jmp LBB0_28
; CHECK-NEXT: LBB0_9: ## %RRETURN_18
; CHECK-NEXT: callq _f8
; CHECK-NEXT: jmp LBB0_28
; CHECK-NEXT: LBB0_10: ## %RRETURN_19
; CHECK-NEXT: callq _f9
; CHECK-NEXT: jmp LBB0_28
; CHECK-NEXT: LBB0_11: ## %RRETURN_20
; CHECK-NEXT: callq _f10
; CHECK-NEXT: jmp LBB0_28
; CHECK-NEXT: LBB0_12: ## %RRETURN_21
; CHECK-NEXT: callq _f11
; CHECK-NEXT: jmp LBB0_28
; CHECK-NEXT: LBB0_13: ## %RRETURN_22
; CHECK-NEXT: callq _f12
; CHECK-NEXT: jmp LBB0_28
; CHECK-NEXT: LBB0_14: ## %RRETURN_24
; CHECK-NEXT: callq _f13
; CHECK-NEXT: jmp LBB0_28
; CHECK-NEXT: LBB0_15: ## %RRETURN_26
; CHECK-NEXT: callq _f14
; CHECK-NEXT: jmp LBB0_28
; CHECK-NEXT: LBB0_16: ## %RRETURN_27
; CHECK-NEXT: callq _f15
; CHECK-NEXT: jmp LBB0_28
; CHECK-NEXT: LBB0_17: ## %RRETURN_28
; CHECK-NEXT: callq _f16
; CHECK-NEXT: jmp LBB0_28
; CHECK-NEXT: LBB0_18: ## %RRETURN_29
; CHECK-NEXT: callq _f17
; CHECK-NEXT: jmp LBB0_28
; CHECK-NEXT: LBB0_19: ## %RRETURN_30
; CHECK-NEXT: callq _f18
; CHECK-NEXT: jmp LBB0_28
; CHECK-NEXT: LBB0_20: ## %RRETURN_31
; CHECK-NEXT: callq _f19
; CHECK-NEXT: jmp LBB0_28
; CHECK-NEXT: LBB0_21: ## %RRETURN_38
; CHECK-NEXT: callq _f20
; CHECK-NEXT: jmp LBB0_28
; CHECK-NEXT: LBB0_22: ## %RRETURN_40
; CHECK-NEXT: callq _f21
; CHECK-NEXT: jmp LBB0_28
; CHECK-NEXT: LBB0_23: ## %RRETURN_42
; CHECK-NEXT: callq _f22
; CHECK-NEXT: jmp LBB0_28
; CHECK-NEXT: LBB0_24: ## %RRETURN_44
; CHECK-NEXT: callq _f23
; CHECK-NEXT: jmp LBB0_28
; CHECK-NEXT: LBB0_25: ## %RRETURN_48
; CHECK-NEXT: callq _f24
; CHECK-NEXT: jmp LBB0_28
; CHECK-NEXT: LBB0_26: ## %RRETURN_52
; CHECK-NEXT: callq _f25
; CHECK-NEXT: jmp LBB0_28
; CHECK-NEXT: LBB0_27: ## %RRETURN_1
; CHECK-NEXT: callq _f26
; CHECK-NEXT: LBB0_28: ## %EXIT
; CHECK-NEXT: xorl %eax, %eax
; CHECK-NEXT: popq %rcx
; CHECK-NEXT: retq
; CHECK-NEXT: .p2align 2, 0x90
; CHECK-NEXT: .data_region jt32
; CHECK-NEXT: .set L0_0_set_3, LBB0_3-LJTI0_0
; CHECK-NEXT: .set L0_0_set_4, LBB0_4-LJTI0_0
; CHECK-NEXT: .set L0_0_set_5, LBB0_5-LJTI0_0
; CHECK-NEXT: .set L0_0_set_6, LBB0_6-LJTI0_0
; CHECK-NEXT: .set L0_0_set_7, LBB0_7-LJTI0_0
; CHECK-NEXT: .set L0_0_set_8, LBB0_8-LJTI0_0
; CHECK-NEXT: .set L0_0_set_9, LBB0_9-LJTI0_0
; CHECK-NEXT: .set L0_0_set_10, LBB0_10-LJTI0_0
; CHECK-NEXT: .set L0_0_set_11, LBB0_11-LJTI0_0
; CHECK-NEXT: .set L0_0_set_12, LBB0_12-LJTI0_0
; CHECK-NEXT: .set L0_0_set_13, LBB0_13-LJTI0_0
; CHECK-NEXT: .set L0_0_set_14, LBB0_14-LJTI0_0
; CHECK-NEXT: .set L0_0_set_15, LBB0_15-LJTI0_0
; CHECK-NEXT: .set L0_0_set_16, LBB0_16-LJTI0_0
; CHECK-NEXT: .set L0_0_set_17, LBB0_17-LJTI0_0
; CHECK-NEXT: .set L0_0_set_18, LBB0_18-LJTI0_0
; CHECK-NEXT: .set L0_0_set_19, LBB0_19-LJTI0_0
; CHECK-NEXT: .set L0_0_set_20, LBB0_20-LJTI0_0
; CHECK-NEXT: .set L0_0_set_21, LBB0_21-LJTI0_0
; CHECK-NEXT: .set L0_0_set_22, LBB0_22-LJTI0_0
; CHECK-NEXT: .set L0_0_set_23, LBB0_23-LJTI0_0
; CHECK-NEXT: .set L0_0_set_24, LBB0_24-LJTI0_0
; CHECK-NEXT: .set L0_0_set_25, LBB0_25-LJTI0_0
; CHECK-NEXT: .set L0_0_set_26, LBB0_26-LJTI0_0
; CHECK-NEXT: .set L0_0_set_27, LBB0_27-LJTI0_0
; CHECK-NEXT: LJTI0_0:
; CHECK-NEXT: .long L0_0_set_3
; CHECK-NEXT: .long L0_0_set_3
; CHECK-NEXT: .long L0_0_set_4
; CHECK-NEXT: .long L0_0_set_5
; CHECK-NEXT: .long L0_0_set_6
; CHECK-NEXT: .long L0_0_set_7
; CHECK-NEXT: .long L0_0_set_8
; CHECK-NEXT: .long L0_0_set_9
; CHECK-NEXT: .long L0_0_set_10
; CHECK-NEXT: .long L0_0_set_11
; CHECK-NEXT: .long L0_0_set_12
; CHECK-NEXT: .long L0_0_set_13
; CHECK-NEXT: .long L0_0_set_14
; CHECK-NEXT: .long L0_0_set_15
; CHECK-NEXT: .long L0_0_set_16
; CHECK-NEXT: .long L0_0_set_17
; CHECK-NEXT: .long L0_0_set_18
; CHECK-NEXT: .long L0_0_set_19
; CHECK-NEXT: .long L0_0_set_20
; CHECK-NEXT: .long L0_0_set_21
; CHECK-NEXT: .long L0_0_set_22
; CHECK-NEXT: .long L0_0_set_23
; CHECK-NEXT: .long L0_0_set_24
; CHECK-NEXT: .long L0_0_set_25
; CHECK-NEXT: .long L0_0_set_26
; CHECK-NEXT: .long L0_0_set_27
; CHECK-NEXT: .end_data_region
entry:
br label %bb49
bb49:
switch i64 %bar, label %RETURN [
i64 2, label %RRETURN_2
i64 3, label %RRETURN_6
i64 4, label %RRETURN_7
i64 5, label %RRETURN_14
i64 6, label %RRETURN_15
i64 7, label %RRETURN_16
i64 8, label %RRETURN_17
i64 9, label %RRETURN_18
i64 10, label %RRETURN_19
i64 11, label %RRETURN_20
i64 12, label %RRETURN_21
i64 13, label %RRETURN_22
i64 14, label %RRETURN_24
i64 15, label %RRETURN_26
i64 16, label %RRETURN_27
i64 17, label %RRETURN_28
i64 18, label %RRETURN_29
i64 19, label %RRETURN_30
i64 20, label %RRETURN_31
i64 21, label %RRETURN_38
i64 22, label %RRETURN_40
i64 23, label %RRETURN_42
i64 24, label %RRETURN_44
i64 25, label %RRETURN_48
i64 26, label %RRETURN_52
i64 27, label %RRETURN_1
]
RETURN:
call void @f1()
br label %EXIT
RRETURN_2: ; preds = %bb49
call void @f2()
br label %EXIT
RRETURN_6: ; preds = %bb49
call void @f2()
br label %EXIT
RRETURN_7: ; preds = %bb49
call void @f3()
br label %EXIT
RRETURN_14: ; preds = %bb49
call void @f4()
br label %EXIT
RRETURN_15: ; preds = %bb49
call void @f5()
br label %EXIT
RRETURN_16: ; preds = %bb49
call void @f6()
br label %EXIT
RRETURN_17: ; preds = %bb49
call void @f7()
br label %EXIT
RRETURN_18: ; preds = %bb49
call void @f8()
br label %EXIT
RRETURN_19: ; preds = %bb49
call void @f9()
br label %EXIT
RRETURN_20: ; preds = %bb49
call void @f10()
br label %EXIT
RRETURN_21: ; preds = %bb49
call void @f11()
br label %EXIT
RRETURN_22: ; preds = %bb49
call void @f12()
br label %EXIT
RRETURN_24: ; preds = %bb49
call void @f13()
br label %EXIT
RRETURN_26: ; preds = %bb49
call void @f14()
br label %EXIT
RRETURN_27: ; preds = %bb49
call void @f15()
br label %EXIT
RRETURN_28: ; preds = %bb49
call void @f16()
br label %EXIT
RRETURN_29: ; preds = %bb49
call void @f17()
br label %EXIT
RRETURN_30: ; preds = %bb49
call void @f18()
br label %EXIT
RRETURN_31: ; preds = %bb49
call void @f19()
br label %EXIT
RRETURN_38: ; preds = %bb49
call void @f20()
br label %EXIT
RRETURN_40: ; preds = %bb49
call void @f21()
br label %EXIT
RRETURN_42: ; preds = %bb49
call void @f22()
br label %EXIT
RRETURN_44: ; preds = %bb49
call void @f23()
br label %EXIT
RRETURN_48: ; preds = %bb49
call void @f24()
br label %EXIT
RRETURN_52: ; preds = %bb49
call void @f25()
br label %EXIT
RRETURN_1: ; preds = %bb49
call void @f26()
br label %EXIT
EXIT:
ret i32 0
}