1 ; ARM EHABI integrated test
3 ; This test case checks whether the ARM DWARF stack frame directives
4 ; are properly generated or not.
6 ; We have to check several cases:
7 ; (1) arm with -frame-pointer=all
8 ; (2) arm without -frame-pointer=all
9 ; (3) armv7 with -frame-pointer=all
10 ; (4) armv7 without -frame-pointer=all
11 ; (5) thumb with -frame-pointer=all
12 ; (6) thumb without -frame-pointer=all
13 ; (7) thumbv7 with -frame-pointer=all
14 ; (8) thumbv7 without -frame-pointer=all
15 ; (9) thumbv7 with -no-integrated-as
17 ; RUN: llc -mtriple arm-unknown-linux-gnueabi \
18 ; RUN: -frame-pointer=all -filetype=asm -o - %s \
19 ; RUN: | FileCheck %s --check-prefix=CHECK-FP
21 ; RUN: llc -mtriple arm-unknown-linux-gnueabi \
22 ; RUN: -filetype=asm -o - %s \
23 ; RUN: | FileCheck %s --check-prefix=CHECK-FP-ELIM
25 ; RUN: llc -mtriple armv7-unknown-linux-gnueabi \
26 ; RUN: -frame-pointer=all -filetype=asm -o - %s \
27 ; RUN: | FileCheck %s --check-prefix=CHECK-V7-FP
29 ; RUN: llc -mtriple armv7-unknown-linux-gnueabi \
30 ; RUN: -filetype=asm -o - %s \
31 ; RUN: | FileCheck %s --check-prefix=CHECK-V7-FP-ELIM
33 ; RUN: llc -mtriple thumbv5-unknown-linux-gnueabi \
34 ; RUN: -frame-pointer=all -filetype=asm -o - %s \
35 ; RUN: | FileCheck %s --check-prefix=CHECK-THUMB-FP
37 ; RUN: llc -mtriple thumbv5-unknown-linux-gnueabi \
38 ; RUN: -filetype=asm -o - %s \
39 ; RUN: | FileCheck %s --check-prefix=CHECK-THUMB-FP-ELIM
41 ; RUN: llc -mtriple thumbv7-unknown-linux-gnueabi \
42 ; RUN: -frame-pointer=all -filetype=asm -o - %s \
43 ; RUN: | FileCheck %s --check-prefix=CHECK-THUMB-V7-FP
45 ; RUN: llc -mtriple thumbv7-unknown-linux-gnueabi \
46 ; RUN: -filetype=asm -o - %s \
47 ; RUN: | FileCheck %s --check-prefix=CHECK-THUMB-V7-FP-ELIM
49 ; RUN: llc -mtriple thumbv7-unknown-linux-gnueabi \
50 ; RUN: -frame-pointer=all -no-integrated-as -filetype=asm -o - %s \
51 ; RUN: | FileCheck %s --check-prefix=CHECK-THUMB-V7-FP-NOIAS
53 ;-------------------------------------------------------------------------------
55 ;-------------------------------------------------------------------------------
56 ; This is the LLVM assembly generated from following C++ code:
58 ; extern void print(int, int, int, int, int);
59 ; extern void print(double, double, double, double, double);
61 ; void test(int a, int b, int c, int d, int e,
62 ; double m, double n, double p, double q, double r) {
64 ; print(a, b, c, d, e);
66 ; print(m, n, p, q, r);
70 declare void @_Z5printiiiii(i32, i32, i32, i32, i32)
72 declare void @_Z5printddddd(double, double, double, double, double)
74 define void @_Z4testiiiiiddddd(i32 %a, i32 %b, i32 %c, i32 %d, i32 %e,
75 double %m, double %n, double %p,
76 double %q, double %r) personality ptr @__gxx_personality_v0 {
78 invoke void @_Z5printiiiii(i32 %a, i32 %b, i32 %c, i32 %d, i32 %e)
79 to label %try.cont unwind label %lpad
82 %0 = landingpad { ptr, i32 }
84 %1 = extractvalue { ptr, i32 } %0, 0
85 %2 = tail call ptr @__cxa_begin_catch(ptr %1)
86 invoke void @_Z5printddddd(double %m, double %n, double %p,
88 to label %invoke.cont2 unwind label %lpad1
91 tail call void @__cxa_end_catch()
98 %3 = landingpad { ptr, i32 }
100 invoke void @__cxa_end_catch()
101 to label %eh.resume unwind label %terminate.lpad
104 resume { ptr, i32 } %3
107 %4 = landingpad { ptr, i32 }
109 %5 = extractvalue { ptr, i32 } %4, 0
110 tail call void @__clang_call_terminate(ptr %5)
114 declare void @__clang_call_terminate(ptr)
116 declare i32 @__gxx_personality_v0(...)
118 declare ptr @__cxa_begin_catch(ptr)
120 declare void @__cxa_end_catch()
122 declare void @_ZSt9terminatev()
125 !llvm.module.flags = !{!10, !11}
128 !0 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, producer: "clang version 3.5 ", isOptimized: false, emissionKind: FullDebug, file: !1, enums: !2, retainedTypes: !2, globals: !2, imports: !2)
129 !1 = !DIFile(filename: "exp.cpp", directory: "/tmp")
131 !4 = distinct !DISubprogram(name: "test", linkageName: "_Z4testiiiiiddddd", line: 4, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, unit: !0, scopeLine: 5, file: !1, scope: !5, type: !6, retainedNodes: !2)
132 !5 = !DIFile(filename: "exp.cpp", directory: "/tmp")
133 !6 = !DISubroutineType(types: !7)
134 !7 = !{null, !8, !8, !8, !8, !8, !9, !9, !9, !9, !9}
135 !8 = !DIBasicType(tag: DW_TAG_base_type, name: "int", size: 32, align: 32, encoding: DW_ATE_signed)
136 !9 = !DIBasicType(tag: DW_TAG_base_type, name: "double", size: 64, align: 64, encoding: DW_ATE_float)
137 !10 = !{i32 2, !"Dwarf Version", i32 4}
138 !11 = !{i32 1, !"Debug Info Version", i32 3}
139 !12 = !{!"clang version 3.5 "}
140 !13 = !DILocalVariable(name: "a", line: 4, arg: 1, scope: !4, file: !5, type: !8)
141 !14 = !DILocation(line: 4, scope: !4)
142 !15 = !DILocalVariable(name: "b", line: 4, arg: 2, scope: !4, file: !5, type: !8)
143 !16 = !DILocalVariable(name: "c", line: 4, arg: 3, scope: !4, file: !5, type: !8)
144 !17 = !DILocalVariable(name: "d", line: 4, arg: 4, scope: !4, file: !5, type: !8)
145 !18 = !DILocalVariable(name: "e", line: 4, arg: 5, scope: !4, file: !5, type: !8)
146 !19 = !DILocalVariable(name: "m", line: 5, arg: 6, scope: !4, file: !5, type: !9)
147 !20 = !DILocation(line: 5, scope: !4)
148 !21 = !DILocalVariable(name: "n", line: 5, arg: 7, scope: !4, file: !5, type: !9)
149 !22 = !DILocalVariable(name: "p", line: 5, arg: 8, scope: !4, file: !5, type: !9)
150 !23 = !DILocalVariable(name: "q", line: 5, arg: 9, scope: !4, file: !5, type: !9)
151 !24 = !DILocalVariable(name: "r", line: 5, arg: 10, scope: !4, file: !5, type: !9)
152 !25 = !DILocation(line: 7, scope: !26)
153 !26 = distinct !DILexicalBlock(line: 6, column: 0, file: !1, scope: !4)
154 !27 = !DILocation(line: 8, scope: !26)
155 !28 = !DILocation(line: 11, scope: !26)
156 !29 = !DILocation(line: 9, scope: !30)
157 !30 = distinct !DILexicalBlock(line: 8, column: 0, file: !1, scope: !4)
158 !31 = !DILocation(line: 10, scope: !30)
159 !32 = !DILocation(line: 10, scope: !4)
160 !33 = !DILocation(line: 11, scope: !4)
161 !34 = !DILocation(line: 11, scope: !30)
163 ; CHECK-FP-LABEL: _Z4testiiiiiddddd:
164 ; CHECK-FP: .cfi_startproc
165 ; CHECK-FP: push {r4, r5, r6, r7, r8, r9, r10, r11, lr}
166 ; CHECK-FP: .cfi_def_cfa_offset 36
167 ; CHECK-FP: .cfi_offset lr, -4
168 ; CHECK-FP: .cfi_offset r11, -8
169 ; CHECK-FP: .cfi_offset r10, -12
170 ; CHECK-FP: .cfi_offset r9, -16
171 ; CHECK-FP: .cfi_offset r8, -20
172 ; CHECK-FP: .cfi_offset r7, -24
173 ; CHECK-FP: .cfi_offset r6, -28
174 ; CHECK-FP: .cfi_offset r5, -32
175 ; CHECK-FP: .cfi_offset r4, -36
176 ; CHECK-FP: add r11, sp, #28
177 ; CHECK-FP: .cfi_def_cfa r11, 8
178 ; CHECK-FP: sub sp, sp, #44
179 ; CHECK-FP: .cfi_endproc
181 ; CHECK-FP-ELIM-LABEL: _Z4testiiiiiddddd:
182 ; CHECK-FP-ELIM: .cfi_startproc
183 ; CHECK-FP-ELIM: push {r4, r5, r6, r7, r8, r9, r10, r11, lr}
184 ; CHECK-FP-ELIM: .cfi_def_cfa_offset 36
185 ; CHECK-FP-ELIM: .cfi_offset lr, -4
186 ; CHECK-FP-ELIM: .cfi_offset r11, -8
187 ; CHECK-FP-ELIM: .cfi_offset r10, -12
188 ; CHECK-FP-ELIM: .cfi_offset r9, -16
189 ; CHECK-FP-ELIM: .cfi_offset r8, -20
190 ; CHECK-FP-ELIM: .cfi_offset r7, -24
191 ; CHECK-FP-ELIM: .cfi_offset r6, -28
192 ; CHECK-FP-ELIM: .cfi_offset r5, -32
193 ; CHECK-FP-ELIM: .cfi_offset r4, -36
194 ; CHECK-FP-ELIM: sub sp, sp, #36
195 ; CHECK-FP-ELIM: .cfi_def_cfa_offset 72
196 ; CHECK-FP-ELIM: .cfi_endproc
198 ; CHECK-V7-FP-LABEL: _Z4testiiiiiddddd:
199 ; CHECK-V7-FP: .cfi_startproc
200 ; CHECK-V7-FP: push {r11, lr}
201 ; CHECK-V7-FP: .cfi_def_cfa_offset 8
202 ; CHECK-V7-FP: .cfi_offset lr, -4
203 ; CHECK-V7-FP: .cfi_offset r11, -8
204 ; CHECK-V7-FP: mov r11, sp
205 ; CHECK-V7-FP: .cfi_def_cfa_register r11
206 ; CHECK-V7-FP: vpush {d8, d9, d10, d11, d12}
207 ; CHECK-V7-FP: .cfi_offset d12, -16
208 ; CHECK-V7-FP: .cfi_offset d11, -24
209 ; CHECK-V7-FP: .cfi_offset d10, -32
210 ; CHECK-V7-FP: .cfi_offset d9, -40
211 ; CHECK-V7-FP: .cfi_offset d8, -48
212 ; CHECK-V7-FP: sub sp, sp, #24
213 ; CHECK-V7-FP: .cfi_endproc
215 ; CHECK-V7-FP-ELIM-LABEL: _Z4testiiiiiddddd:
216 ; CHECK-V7-FP-ELIM: .cfi_startproc
217 ; CHECK-V7-FP-ELIM: push {r11, lr}
218 ; CHECK-V7-FP-ELIM: .cfi_def_cfa_offset 8
219 ; CHECK-V7-FP-ELIM: .cfi_offset lr, -4
220 ; CHECK-V7-FP-ELIM: .cfi_offset r11, -8
221 ; CHECK-V7-FP-ELIM: vpush {d8, d9, d10, d11, d12}
222 ; CHECK-V7-FP-ELIM: .cfi_def_cfa_offset 48
223 ; CHECK-V7-FP-ELIM: .cfi_offset d12, -16
224 ; CHECK-V7-FP-ELIM: .cfi_offset d11, -24
225 ; CHECK-V7-FP-ELIM: .cfi_offset d10, -32
226 ; CHECK-V7-FP-ELIM: .cfi_offset d9, -40
227 ; CHECK-V7-FP-ELIM: .cfi_offset d8, -48
228 ; CHECK-V7-FP-ELIM: sub sp, sp, #24
229 ; CHECK-V7-FP-ELIM: .cfi_def_cfa_offset 72
230 ; CHECK-V7-FP-ELIM: .cfi_endproc
232 ; CHECK-THUMB-FP-LABEL: _Z4testiiiiiddddd:
233 ; CHECK-THUMB-FP: .cfi_startproc
234 ; CHECK-THUMB-FP: push {r4, r5, r6, r7, lr}
235 ; CHECK-THUMB-FP: .cfi_def_cfa_offset 20
236 ; CHECK-THUMB-FP: .cfi_offset lr, -4
237 ; CHECK-THUMB-FP: .cfi_offset r7, -8
238 ; CHECK-THUMB-FP: .cfi_offset r6, -12
239 ; CHECK-THUMB-FP: .cfi_offset r5, -16
240 ; CHECK-THUMB-FP: .cfi_offset r4, -20
241 ; CHECK-THUMB-FP: add r7, sp, #12
242 ; CHECK-THUMB-FP: .cfi_def_cfa r7, 8
243 ; CHECK-THUMB-FP: sub sp, #60
244 ; CHECK-THUMB-FP: .cfi_endproc
246 ; CHECK-THUMB-FP-ELIM-LABEL: _Z4testiiiiiddddd:
247 ; CHECK-THUMB-FP-ELIM: .cfi_startproc
248 ; CHECK-THUMB-FP-ELIM: push {r4, r5, r6, r7, lr}
249 ; CHECK-THUMB-FP-ELIM: .cfi_def_cfa_offset 20
250 ; CHECK-THUMB-FP-ELIM: .cfi_offset lr, -4
251 ; CHECK-THUMB-FP-ELIM: .cfi_offset r7, -8
252 ; CHECK-THUMB-FP-ELIM: .cfi_offset r6, -12
253 ; CHECK-THUMB-FP-ELIM: .cfi_offset r5, -16
254 ; CHECK-THUMB-FP-ELIM: .cfi_offset r4, -20
255 ; CHECK-THUMB-FP-ELIM: sub sp, #52
256 ; CHECK-THUMB-FP-ELIM: .cfi_def_cfa_offset 72
257 ; CHECK-THUMB-FP-ELIM: .cfi_endproc
259 ; CHECK-THUMB-V7-FP-LABEL: _Z4testiiiiiddddd:
260 ; CHECK-THUMB-V7-FP: .cfi_startproc
261 ; CHECK-THUMB-V7-FP: push {r7, lr}
262 ; CHECK-THUMB-V7-FP: .cfi_def_cfa_offset 8
263 ; CHECK-THUMB-V7-FP: .cfi_offset lr, -4
264 ; CHECK-THUMB-V7-FP: .cfi_offset r7, -8
265 ; CHECK-THUMB-V7-FP: mov r7, sp
266 ; CHECK-THUMB-V7-FP: .cfi_def_cfa_register r7
267 ; CHECK-THUMB-V7-FP: vpush {d8, d9, d10, d11, d12}
268 ; CHECK-THUMB-V7-FP: .cfi_offset d12, -16
269 ; CHECK-THUMB-V7-FP: .cfi_offset d11, -24
270 ; CHECK-THUMB-V7-FP: .cfi_offset d10, -32
271 ; CHECK-THUMB-V7-FP: .cfi_offset d9, -40
272 ; CHECK-THUMB-V7-FP: .cfi_offset d8, -48
273 ; CHECK-THUMB-V7-FP: sub sp, #24
274 ; CHECK-THUMB-V7-FP: .cfi_endproc
276 ; CHECK-THUMB-V7-FP-ELIM-LABEL: _Z4testiiiiiddddd:
277 ; CHECK-THUMB-V7-FP-ELIM: .cfi_startproc
278 ; CHECK-THUMB-V7-FP-ELIM: push {r7, lr}
279 ; CHECK-THUMB-V7-FP-ELIM: .cfi_def_cfa_offset 8
280 ; CHECK-THUMB-V7-FP-ELIM: .cfi_offset lr, -4
281 ; CHECK-THUMB-V7-FP-ELIM: .cfi_offset r7, -8
282 ; CHECK-THUMB-V7-FP-ELIM: vpush {d8, d9, d10, d11, d12}
283 ; CHECK-THUMB-V7-FP-ELIM: .cfi_def_cfa_offset 48
284 ; CHECK-THUMB-V7-FP-ELIM: .cfi_offset d12, -16
285 ; CHECK-THUMB-V7-FP-ELIM: .cfi_offset d11, -24
286 ; CHECK-THUMB-V7-FP-ELIM: .cfi_offset d10, -32
287 ; CHECK-THUMB-V7-FP-ELIM: .cfi_offset d9, -40
288 ; CHECK-THUMB-V7-FP-ELIM: .cfi_offset d8, -48
289 ; CHECK-THUMB-V7-FP-ELIM: sub sp, #24
290 ; CHECK-THUMB-V7-FP-ELIM: .cfi_def_cfa_offset 72
291 ; CHECK-THUMB-V7-FP-ELIM: .cfi_endproc
293 ; CHECK-THUMB-V7-FP-NOIAS-LABEL: _Z4testiiiiiddddd:
294 ; CHECK-THUMB-V7-FP-NOIAS: .cfi_startproc
295 ; CHECK-THUMB-V7-FP-NOIAS: push {r7, lr}
296 ; CHECK-THUMB-V7-FP-NOIAS: .cfi_def_cfa_offset 8
297 ; CHECK-THUMB-V7-FP-NOIAS: .cfi_offset 14, -4
298 ; CHECK-THUMB-V7-FP-NOIAS: .cfi_offset 7, -8
299 ; CHECK-THUMB-V7-FP-NOIAS: mov r7, sp
300 ; CHECK-THUMB-V7-FP-NOIAS: .cfi_def_cfa_register 7
301 ; CHECK-THUMB-V7-FP-NOIAS: vpush {d8, d9, d10, d11, d12}
302 ; CHECK-THUMB-V7-FP-NOIAS: .cfi_offset 268, -16
303 ; CHECK-THUMB-V7-FP-NOIAS: .cfi_offset 267, -24
304 ; CHECK-THUMB-V7-FP-NOIAS: .cfi_offset 266, -32
305 ; CHECK-THUMB-V7-FP-NOIAS: .cfi_offset 265, -40
306 ; CHECK-THUMB-V7-FP-NOIAS: .cfi_offset 264, -48
307 ; CHECK-THUMB-V7-FP-NOIAS: sub sp, #24
308 ; CHECK-THUMB-V7-FP-NOIAS: .cfi_endproc
310 ;-------------------------------------------------------------------------------
312 ;-------------------------------------------------------------------------------
314 declare void @throw_exception_2()
316 define void @test2() {
318 call void @throw_exception_2()
322 ; CHECK-FP-LABEL: test2:
323 ; CHECK-FP: .cfi_startproc
324 ; CHECK-FP: push {r11, lr}
325 ; CHECK-FP: .cfi_def_cfa_offset 8
326 ; CHECK-FP: .cfi_offset lr, -4
327 ; CHECK-FP: .cfi_offset r11, -8
328 ; CHECK-FP: mov r11, sp
329 ; CHECK-FP: .cfi_def_cfa_register r11
330 ; CHECK-FP: pop {r11, lr}
331 ; CHECK-FP: mov pc, lr
332 ; CHECK-FP: .cfi_endproc
334 ; CHECK-FP-ELIM-LABEL: test2:
335 ; CHECK-FP-ELIM: .cfi_startproc
336 ; CHECK-FP-ELIM: push {r11, lr}
337 ; CHECK-FP-ELIM: .cfi_def_cfa_offset 8
338 ; CHECK-FP-ELIM: .cfi_offset lr, -4
339 ; CHECK-FP-ELIM: .cfi_offset r11, -8
340 ; CHECK-FP-ELIM: pop {r11, lr}
341 ; CHECK-FP-ELIM: mov pc, lr
342 ; CHECK-FP-ELIM: .cfi_endproc
344 ; CHECK-V7-FP-LABEL: test2:
345 ; CHECK-V7-FP: .cfi_startproc
346 ; CHECK-V7-FP: push {r11, lr}
347 ; CHECK-V7-FP: .cfi_def_cfa_offset 8
348 ; CHECK-V7-FP: .cfi_offset lr, -4
349 ; CHECK-V7-FP: .cfi_offset r11, -8
350 ; CHECK-V7-FP: mov r11, sp
351 ; CHECK-V7-FP: .cfi_def_cfa_register r11
352 ; CHECK-V7-FP: pop {r11, pc}
353 ; CHECK-V7-FP: .cfi_endproc
355 ; CHECK-V7-FP-ELIM-LABEL: test2:
356 ; CHECK-V7-FP-ELIM: .cfi_startproc
357 ; CHECK-V7-FP-ELIM: push {r11, lr}
358 ; CHECK-V7-FP-ELIM: .cfi_def_cfa_offset 8
359 ; CHECK-V7-FP-ELIM: .cfi_offset lr, -4
360 ; CHECK-V7-FP-ELIM: .cfi_offset r11, -8
361 ; CHECK-V7-FP-ELIM: pop {r11, pc}
362 ; CHECK-V7-FP-ELIM: .cfi_endproc
364 ; CHECK-THUMB-FP-LABEL: test2:
365 ; CHECK-THUMB-FP: .cfi_startproc
366 ; CHECK-THUMB-FP: push {r7, lr}
367 ; CHECK-THUMB-FP: .cfi_def_cfa_offset 8
368 ; CHECK-THUMB-FP: .cfi_offset lr, -4
369 ; CHECK-THUMB-FP: .cfi_offset r7, -8
370 ; CHECK-THUMB-FP: add r7, sp, #0
371 ; CHECK-THUMB-FP: .cfi_def_cfa_register r7
372 ; CHECK-THUMB-FP: pop {r7, pc}
373 ; CHECK-THUMB-FP: .cfi_endproc
375 ; CHECK-THUMB-FP-ELIM-LABEL: test2:
376 ; CHECK-THUMB-FP-ELIM: .cfi_startproc
377 ; CHECK-THUMB-FP-ELIM: push {r7, lr}
378 ; CHECK-THUMB-FP-ELIM: .cfi_def_cfa_offset 8
379 ; CHECK-THUMB-FP-ELIM: .cfi_offset lr, -4
380 ; CHECK-THUMB-FP-ELIM: .cfi_offset r7, -8
381 ; CHECK-THUMB-FP-ELIM: pop {r7, pc}
382 ; CHECK-THUMB-FP-ELIM: .cfi_endproc
384 ; CHECK-THUMB-V7-FP-LABEL: test2:
385 ; CHECK-THUMB-V7-FP: .cfi_startproc
386 ; CHECK-THUMB-V7-FP: push {r7, lr}
387 ; CHECK-THUMB-V7-FP: .cfi_def_cfa_offset 8
388 ; CHECK-THUMB-V7-FP: .cfi_offset lr, -4
389 ; CHECK-THUMB-V7-FP: .cfi_offset r7, -8
390 ; CHECK-THUMB-V7-FP: mov r7, sp
391 ; CHECK-THUMB-V7-FP: .cfi_def_cfa_register r7
392 ; CHECK-THUMB-V7-FP: pop {r7, pc}
393 ; CHECK-THUMB-V7-FP: .cfi_endproc
395 ; CHECK-THUMB-V7-FP-ELIM-LABEL: test2:
396 ; CHECK-THUMB-V7-FP-ELIM: .cfi_startproc
397 ; CHECK-THUMB-V7-FP-ELIM: push {r7, lr}
398 ; CHECK-THUMB-V7-FP-ELIM: .cfi_def_cfa_offset 8
399 ; CHECK-THUMB-V7-FP-ELIM: .cfi_offset lr, -4
400 ; CHECK-THUMB-V7-FP-ELIM: .cfi_offset r7, -8
401 ; CHECK-THUMB-V7-FP-ELIM: pop {r7, pc}
402 ; CHECK-THUMB-V7-FP-ELIM: .cfi_endproc
405 ;-------------------------------------------------------------------------------
407 ;-------------------------------------------------------------------------------
409 declare void @throw_exception_3(i32)
411 define i32 @test3(i32 %a, i32 %b, i32 %c, i32 %d,
412 i32 %e, i32 %f, i32 %g, i32 %h) {
414 %add = add nsw i32 %b, %a
415 %add1 = add nsw i32 %add, %c
416 %add2 = add nsw i32 %add1, %d
417 tail call void @throw_exception_3(i32 %add2)
418 %add3 = add nsw i32 %f, %e
419 %add4 = add nsw i32 %add3, %g
420 %add5 = add nsw i32 %add4, %h
421 tail call void @throw_exception_3(i32 %add5)
422 %add6 = add nsw i32 %add5, %add2
426 ; CHECK-FP-LABEL: test3:
427 ; CHECK-FP: .cfi_startproc
428 ; CHECK-FP: push {r4, r5, r11, lr}
429 ; CHECK-FP: .cfi_def_cfa_offset 16
430 ; CHECK-FP: .cfi_offset lr, -4
431 ; CHECK-FP: .cfi_offset r11, -8
432 ; CHECK-FP: .cfi_offset r5, -12
433 ; CHECK-FP: .cfi_offset r4, -16
434 ; CHECK-FP: add r11, sp, #8
435 ; CHECK-FP: .cfi_def_cfa r11, 8
436 ; CHECK-FP: pop {r4, r5, r11, lr}
437 ; CHECK-FP: mov pc, lr
438 ; CHECK-FP: .cfi_endproc
440 ; CHECK-FP-ELIM-LABEL: test3:
441 ; CHECK-FP-ELIM: .cfi_startproc
442 ; CHECK-FP-ELIM: push {r4, r5, r11, lr}
443 ; CHECK-FP-ELIM: .cfi_def_cfa_offset 16
444 ; CHECK-FP-ELIM: .cfi_offset lr, -4
445 ; CHECK-FP-ELIM: .cfi_offset r11, -8
446 ; CHECK-FP-ELIM: .cfi_offset r5, -12
447 ; CHECK-FP-ELIM: .cfi_offset r4, -16
448 ; CHECK-FP-ELIM: pop {r4, r5, r11, lr}
449 ; CHECK-FP-ELIM: mov pc, lr
450 ; CHECK-FP-ELIM: .cfi_endproc
452 ; CHECK-V7-FP-LABEL: test3:
453 ; CHECK-V7-FP: .cfi_startproc
454 ; CHECK-V7-FP: push {r4, r5, r11, lr}
455 ; CHECK-V7-FP: .cfi_def_cfa_offset 16
456 ; CHECK-V7-FP: .cfi_offset lr, -4
457 ; CHECK-V7-FP: .cfi_offset r11, -8
458 ; CHECK-V7-FP: .cfi_offset r5, -12
459 ; CHECK-V7-FP: .cfi_offset r4, -16
460 ; CHECK-V7-FP: add r11, sp, #8
461 ; CHECK-V7-FP: .cfi_def_cfa r11, 8
462 ; CHECK-V7-FP: pop {r4, r5, r11, pc}
463 ; CHECK-V7-FP: .cfi_endproc
465 ; CHECK-V7-FP-ELIM-LABEL: test3:
466 ; CHECK-V7-FP-ELIM: .cfi_startproc
467 ; CHECK-V7-FP-ELIM: push {r4, r5, r11, lr}
468 ; CHECK-V7-FP-ELIM: .cfi_def_cfa_offset 16
469 ; CHECK-V7-FP-ELIM: .cfi_offset lr, -4
470 ; CHECK-V7-FP-ELIM: .cfi_offset r11, -8
471 ; CHECK-V7-FP-ELIM: .cfi_offset r5, -12
472 ; CHECK-V7-FP-ELIM: .cfi_offset r4, -16
473 ; CHECK-V7-FP-ELIM: pop {r4, r5, r11, pc}
474 ; CHECK-V7-FP-ELIM: .cfi_endproc
476 ; CHECK-THUMB-FP-LABEL: test3:
477 ; CHECK-THUMB-FP: .cfi_startproc
478 ; CHECK-THUMB-FP: push {r4, r5, r7, lr}
479 ; CHECK-THUMB-FP: .cfi_def_cfa_offset 16
480 ; CHECK-THUMB-FP: .cfi_offset lr, -4
481 ; CHECK-THUMB-FP: .cfi_offset r7, -8
482 ; CHECK-THUMB-FP: .cfi_offset r5, -12
483 ; CHECK-THUMB-FP: .cfi_offset r4, -16
484 ; CHECK-THUMB-FP: add r7, sp, #8
485 ; CHECK-THUMB-FP: .cfi_def_cfa r7, 8
486 ; CHECK-THUMB-FP: pop {r4, r5, r7, pc}
487 ; CHECK-THUMB-FP: .cfi_endproc
489 ; CHECK-THUMB-FP-ELIM-LABEL: test3:
490 ; CHECK-THUMB-FP-ELIM: .cfi_startproc
491 ; CHECK-THUMB-FP-ELIM: push {r4, r5, r7, lr}
492 ; CHECK-THUMB-FP-ELIM: .cfi_def_cfa_offset 16
493 ; CHECK-THUMB-FP-ELIM: .cfi_offset lr, -4
494 ; CHECK-THUMB-FP-ELIM: .cfi_offset r7, -8
495 ; CHECK-THUMB-FP-ELIM: .cfi_offset r5, -12
496 ; CHECK-THUMB-FP-ELIM: .cfi_offset r4, -16
497 ; CHECK-THUMB-FP-ELIM: pop {r4, r5, r7, pc}
498 ; CHECK-THUMB-FP-ELIM: .cfi_endproc
500 ; CHECK-THUMB-V7-FP-LABEL: test3:
501 ; CHECK-THUMB-V7-FP: .cfi_startproc
502 ; CHECK-THUMB-V7-FP: push {r4, r5, r7, lr}
503 ; CHECK-THUMB-V7-FP: .cfi_def_cfa_offset 16
504 ; CHECK-THUMB-V7-FP: .cfi_offset lr, -4
505 ; CHECK-THUMB-V7-FP: .cfi_offset r7, -8
506 ; CHECK-THUMB-V7-FP: .cfi_offset r5, -12
507 ; CHECK-THUMB-V7-FP: .cfi_offset r4, -16
508 ; CHECK-THUMB-V7-FP: add r7, sp, #8
509 ; CHECK-THUMB-V7-FP: .cfi_def_cfa r7, 8
510 ; CHECK-THUMB-V7-FP: pop {r4, r5, r7, pc}
511 ; CHECK-THUMB-V7-FP: .cfi_endproc
513 ; CHECK-THUMB-V7-FP-ELIM-LABEL: test3:
514 ; CHECK-THUMB-V7-FP-ELIM: .cfi_startproc
515 ; CHECK-THUMB-V7-FP-ELIM: push {r4, r5, r7, lr}
516 ; CHECK-THUMB-V7-FP-ELIM: .cfi_def_cfa_offset 16
517 ; CHECK-THUMB-V7-FP-ELIM: .cfi_offset lr, -4
518 ; CHECK-THUMB-V7-FP-ELIM: .cfi_offset r7, -8
519 ; CHECK-THUMB-V7-FP-ELIM: .cfi_offset r5, -12
520 ; CHECK-THUMB-V7-FP-ELIM: .cfi_offset r4, -16
521 ; CHECK-THUMB-V7-FP-ELIM: pop {r4, r5, r7, pc}
522 ; CHECK-THUMB-V7-FP-ELIM: .cfi_endproc
525 ;-------------------------------------------------------------------------------
527 ;-------------------------------------------------------------------------------
529 define void @test4() nounwind {
534 ; CHECK-FP-LABEL: test4:
535 ; CHECK-FP: mov pc, lr
536 ; CHECK-FP-NOT: .cfi_def_cfa_offset
538 ; CHECK-FP-ELIM-LABEL: test4:
539 ; CHECK-FP-ELIM: mov pc, lr
540 ; CHECK-FP-ELIM-NOT: .cfi_def_cfa_offset
542 ; CHECK-V7-FP-LABEL: test4:
544 ; CHECK-V7-FP-NOT: .cfi_def_cfa_offset
546 ; CHECK-V7-FP-ELIM-LABEL: test4:
547 ; CHECK-V7-FP-ELIM: bx lr
548 ; CHECK-V7-FP-ELIM-NOT: .cfi_def_cfa_offset
550 ; CHECK-THUMB-FP-LABEL: test4:
551 ; CHECK-THUMB-FP: bx lr
552 ; CHECK-THUMB-FP-NOT: .cfi_def_cfa_offset
554 ; CHECK-THUMB-FP-ELIM-LABEL: test4:
555 ; CHECK-THUMB-FP-ELIM: bx lr
556 ; CHECK-THUMB-FP-ELIM-NOT: .cfi_def_cfa_offset
558 ; CHECK-THUMB-V7-FP-LABEL: test4:
559 ; CHECK-THUMB-V7-FP: bx lr
560 ; CHECK-THUMB-V7-FP-NOT: .cfi_def_cfa_offset
562 ; CHECK-THUMB-V7-FP-ELIM-LABEL: test4:
563 ; CHECK-THUMB-V7-FP-ELIM: bx lr
564 ; CHECK-THUMB-V7-FP-ELIM-NOT: .cfi_def_cfa_offset