[ARM] More MVE compare vector splat combines for ANDs
[llvm-complete.git] / test / CodeGen / ARM / ehabi.ll
blob5c4a2b620a1f019f817acf7a1e10e059dd828d70
1 ; ARM EHABI integrated test
3 ; This test case checks whether the ARM unwind directives are properly
4 ; generated or not.
6 ; The purpose of the test:
7 ; (1) .fnstart and .fnend directives should wrap the function.
8 ; (2) .setfp directive should be available if frame pointer is not eliminated.
9 ; (3) .save directive should come with push instruction.
10 ; (4) .vsave directive should come with vpush instruction.
11 ; (5) .pad directive should come with stack pointer adjustment.
12 ; (6) .cantunwind directive should be available if the function is marked with
13 ;     nounwind function attribute.
15 ; We have to check several cases:
16 ; (1) arm with -frame-pointer=all
17 ; (2) arm without -frame-pointer=all
18 ; (3) armv7 with -frame-pointer=all
19 ; (4) armv7 without -frame-pointer=all
21 ; RUN: llc -mtriple arm-unknown-linux-gnueabi \
22 ; RUN:     -frame-pointer=all -filetype=asm -o - %s \
23 ; RUN:   | FileCheck %s --check-prefix=CHECK-FP
25 ; RUN: llc -mtriple arm-unknown-linux-gnueabi \
26 ; RUN:     -filetype=asm -o - %s \
27 ; RUN:   | FileCheck %s --check-prefix=CHECK-FP-ELIM
29 ; RUN: llc -mtriple armv7-unknown-linux-gnueabi \
30 ; RUN:     -frame-pointer=all -filetype=asm -o - %s \
31 ; RUN:   | FileCheck %s --check-prefix=CHECK-V7-FP
33 ; RUN: llc -mtriple armv7-unknown-linux-gnueabi \
34 ; RUN:     -filetype=asm -o - %s \
35 ; RUN:   | FileCheck %s --check-prefix=CHECK-V7-FP-ELIM
37 ; RUN: llc -mtriple arm-unknown-linux-musleabi \
38 ; RUN:     -frame-pointer=all -filetype=asm -o - %s \
39 ; RUN:   | FileCheck %s --check-prefix=CHECK-FP
41 ; RUN: llc -mtriple arm-unknown-linux-musleabi \
42 ; RUN:     -filetype=asm -o - %s \
43 ; RUN:   | FileCheck %s --check-prefix=CHECK-FP-ELIM
45 ; RUN: llc -mtriple armv7-unknown-linux-musleabi \
46 ; RUN:     -frame-pointer=all -filetype=asm -o - %s \
47 ; RUN:   | FileCheck %s --check-prefix=CHECK-V7-FP
49 ; RUN: llc -mtriple armv7-unknown-linux-musleabi \
50 ; RUN:     -filetype=asm -o - %s \
51 ; RUN:   | FileCheck %s --check-prefix=CHECK-V7-FP-ELIM
53 ; RUN: llc -mtriple arm-unknown-linux-androideabi \
54 ; RUN:     -frame-pointer=all -filetype=asm -o - %s \
55 ; RUN:   | FileCheck %s --check-prefix=CHECK-FP
57 ; RUN: llc -mtriple arm-unknown-linux-androideabi \
58 ; RUN:     -filetype=asm -o - %s \
59 ; RUN:   | FileCheck %s --check-prefix=CHECK-FP-ELIM
61 ; RUN: llc -mtriple armv7-unknown-linux-androideabi \
62 ; RUN:     -frame-pointer=all -filetype=asm -o - %s \
63 ; RUN:   | FileCheck %s --check-prefix=CHECK-V7-FP
65 ; RUN: llc -mtriple armv7-unknown-linux-androideabi \
66 ; RUN:     -filetype=asm -o - %s \
67 ; RUN:   | FileCheck %s --check-prefix=CHECK-V7-FP-ELIM
69 ; RUN: llc -mtriple arm-unknown-netbsd-eabi \
70 ; RUN:     -frame-pointer=all -filetype=asm -o - %s \
71 ; RUN:   | FileCheck %s --check-prefix=DWARF-FP
73 ; RUN: llc -mtriple arm-unknown-netbsd-eabi \
74 ; RUN:     -filetype=asm -o - %s \
75 ; RUN:   | FileCheck %s --check-prefix=DWARF-FP-ELIM
77 ; RUN: llc -mtriple armv7-unknown-netbsd-eabi \
78 ; RUN:     -frame-pointer=all -filetype=asm -o - %s \
79 ; RUN:   | FileCheck %s --check-prefix=DWARF-V7-FP
81 ; RUN: llc -mtriple armv7-unknown-netbsd-eabi \
82 ; RUN:     -filetype=asm -o - %s \
83 ; RUN:   | FileCheck %s --check-prefix=DWARF-V7-FP-ELIM
85 ; RUN: llc -mtriple thumbv7-windows-gnu \
86 ; RUN:     -filetype=asm -o - %s \
87 ; RUN:   | FileCheck %s --check-prefix=DWARF-WIN-FP-ELIM
89 ;-------------------------------------------------------------------------------
90 ; Test 1
91 ;-------------------------------------------------------------------------------
92 ; This is the LLVM assembly generated from following C++ code:
94 ;   extern void print(int, int, int, int, int);
95 ;   extern void print(double, double, double, double, double);
97 ;   void test(int a, int b, int c, int d, int e,
98 ;             double m, double n, double p, double q, double r) {
99 ;     try {
100 ;       print(a, b, c, d, e);
101 ;     } catch (...) {
102 ;       print(m, n, p, q, r);
103 ;     }
104 ;   }
106 declare void @_Z5printiiiii(i32, i32, i32, i32, i32)
108 declare void @_Z5printddddd(double, double, double, double, double)
110 define void @_Z4testiiiiiddddd(i32 %a, i32 %b, i32 %c, i32 %d, i32 %e,
111                                double %m, double %n, double %p,
112                                double %q, double %r) personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*) {
113 entry:
114   invoke void @_Z5printiiiii(i32 %a, i32 %b, i32 %c, i32 %d, i32 %e)
115           to label %try.cont unwind label %lpad
117 lpad:
118   %0 = landingpad { i8*, i32 }
119           catch i8* null
120   %1 = extractvalue { i8*, i32 } %0, 0
121   %2 = tail call i8* @__cxa_begin_catch(i8* %1)
122   invoke void @_Z5printddddd(double %m, double %n, double %p,
123                              double %q, double %r)
124           to label %invoke.cont2 unwind label %lpad1
126 invoke.cont2:
127   tail call void @__cxa_end_catch()
128   br label %try.cont
130 try.cont:
131   ret void
133 lpad1:
134   %3 = landingpad { i8*, i32 }
135           cleanup
136   invoke void @__cxa_end_catch()
137           to label %eh.resume unwind label %terminate.lpad
139 eh.resume:
140   resume { i8*, i32 } %3
142 terminate.lpad:
143   %4 = landingpad { i8*, i32 }
144           catch i8* null
145   %5 = extractvalue { i8*, i32 } %4, 0
146   tail call void @__clang_call_terminate(i8* %5)
147   unreachable
150 declare void @__clang_call_terminate(i8*)
152 declare i32 @__gxx_personality_v0(...)
154 declare i8* @__cxa_begin_catch(i8*)
156 declare void @__cxa_end_catch()
158 declare void @_ZSt9terminatev()
160 ; CHECK-FP-LABEL: _Z4testiiiiiddddd:
161 ; CHECK-FP:   .fnstart
162 ; CHECK-FP:   .save  {r4, r5, r6, r7, r8, r9, r10, r11, lr}
163 ; CHECK-FP:   push   {r4, r5, r6, r7, r8, r9, r10, r11, lr}
164 ; CHECK-FP:   .setfp r11, sp, #28
165 ; CHECK-FP:   add    r11, sp, #28
166 ; CHECK-FP:   .pad   #44
167 ; CHECK-FP:   sub    sp, sp, #44
168 ; CHECK-FP:   .personality __gxx_personality_v0
169 ; CHECK-FP:   .handlerdata
170 ; CHECK-FP:   .fnend
172 ; CHECK-FP-ELIM-LABEL: _Z4testiiiiiddddd:
173 ; CHECK-FP-ELIM:   .fnstart
174 ; CHECK-FP-ELIM:   .save {r4, r5, r6, r7, r8, r9, r10, r11, lr}
175 ; CHECK-FP-ELIM:   push  {r4, r5, r6, r7, r8, r9, r10, r11, lr}
176 ; CHECK-FP-ELIM:   .pad  #36
177 ; CHECK-FP-ELIM:   sub   sp, sp, #36
178 ; CHECK-FP-ELIM:   .personality __gxx_personality_v0
179 ; CHECK-FP-ELIM:   .handlerdata
180 ; CHECK-FP-ELIM:   .fnend
182 ; CHECK-V7-FP-LABEL: _Z4testiiiiiddddd:
183 ; CHECK-V7-FP:   .fnstart
184 ; CHECK-V7-FP:   .save  {r4, r10, r11, lr}
185 ; CHECK-V7-FP:   push   {r4, r10, r11, lr}
186 ; CHECK-V7-FP:   .setfp r11, sp, #8
187 ; CHECK-V7-FP:   add    r11, sp, #8
188 ; CHECK-V7-FP:   .vsave {d8, d9, d10, d11, d12}
189 ; CHECK-V7-FP:   vpush  {d8, d9, d10, d11, d12}
190 ; CHECK-V7-FP:   .pad   #24
191 ; CHECK-V7-FP:   sub    sp, sp, #24
192 ; CHECK-V7-FP:   .personality __gxx_personality_v0
193 ; CHECK-V7-FP:   .handlerdata
194 ; CHECK-V7-FP:   .fnend
196 ; CHECK-V7-FP-ELIM-LABEL: _Z4testiiiiiddddd:
197 ; CHECK-V7-FP-ELIM:   .fnstart
198 ; CHECK-V7-FP-ELIM:   .save  {r4, lr}
199 ; CHECK-V7-FP-ELIM:   push   {r4, lr}
200 ; CHECK-V7-FP-ELIM:   .vsave {d8, d9, d10, d11, d12}
201 ; CHECK-V7-FP-ELIM:   vpush  {d8, d9, d10, d11, d12}
202 ; CHECK-V7-FP-ELIM:   .pad   #24
203 ; CHECK-V7-FP-ELIM:   sub    sp, sp, #24
204 ; CHECK-V7-FP-ELIM:   .personality __gxx_personality_v0
205 ; CHECK-V7-FP-ELIM:   .handlerdata
206 ; CHECK-V7-FP-ELIM:   .fnend
208 ; DWARF-FP-LABEL: _Z4testiiiiiddddd:
209 ; DWARF-FP:    .cfi_startproc
210 ; DWARF-FP:    .cfi_personality 0, __gxx_personality_v0
211 ; DWARF-FP:    .cfi_lsda 0, .Lexception0
212 ; DWARF-FP:    push {r4, r5, r6, r7, r8, r9, r10, r11, lr}
213 ; DWARF-FP:    .cfi_def_cfa_offset 36
214 ; DWARF-FP:    .cfi_offset lr, -4
215 ; DWARF-FP:    .cfi_offset r11, -8
216 ; DWARF-FP:    .cfi_offset r10, -12
217 ; DWARF-FP:    .cfi_offset r9, -16
218 ; DWARF-FP:    .cfi_offset r8, -20
219 ; DWARF-FP:    .cfi_offset r7, -24
220 ; DWARF-FP:    .cfi_offset r6, -28
221 ; DWARF-FP:    .cfi_offset r5, -32
222 ; DWARF-FP:    .cfi_offset r4, -36
223 ; DWARF-FP:    add r11, sp, #28
224 ; DWARF-FP:    .cfi_def_cfa r11, 8
225 ; DWARF-FP:    sub sp, sp, #44
226 ; DWARF-FP:    sub sp, r11, #28
227 ; DWARF-FP:    pop {r4, r5, r6, r7, r8, r9, r10, r11, lr}
228 ; DWARF-FP:    mov pc, lr
229 ; DWARF-FP:    .cfi_endproc
231 ; DWARF-FP-ELIM-LABEL: _Z4testiiiiiddddd:
232 ; DWARF-FP-ELIM:    .cfi_startproc
233 ; DWARF-FP-ELIM:    .cfi_personality 0, __gxx_personality_v0
234 ; DWARF-FP-ELIM:    .cfi_lsda 0, .Lexception0
235 ; DWARF-FP-ELIM:    push {r4, r5, r6, r7, r8, r9, r10, r11, lr}
236 ; DWARF-FP-ELIM:    .cfi_def_cfa_offset 36
237 ; DWARF-FP-ELIM:    .cfi_offset lr, -4
238 ; DWARF-FP-ELIM:    .cfi_offset r11, -8
239 ; DWARF-FP-ELIM:    .cfi_offset r10, -12
240 ; DWARF-FP-ELIM:    .cfi_offset r9, -16
241 ; DWARF-FP-ELIM:    .cfi_offset r8, -20
242 ; DWARF-FP-ELIM:    .cfi_offset r7, -24
243 ; DWARF-FP-ELIM:    .cfi_offset r6, -28
244 ; DWARF-FP-ELIM:    .cfi_offset r5, -32
245 ; DWARF-FP-ELIM:    .cfi_offset r4, -36
246 ; DWARF-FP-ELIM:    sub sp, sp, #36
247 ; DWARF-FP-ELIM:    .cfi_def_cfa_offset 72
248 ; DWARF-FP-ELIM:    add sp, sp, #36
249 ; DWARF-FP-ELIM:    pop {r4, r5, r6, r7, r8, r9, r10, r11, lr}
250 ; DWARF-FP-ELIM:    mov pc, lr
251 ; DWARF-FP-ELIM:    .cfi_endproc
253 ; DWARF-V7-FP-LABEL: _Z4testiiiiiddddd:
254 ; DWARF-V7-FP:    .cfi_startproc
255 ; DWARF-V7-FP:    .cfi_personality 0, __gxx_personality_v0
256 ; DWARF-V7-FP:    .cfi_lsda 0, .Lexception0
257 ; DWARF-V7-FP:    push {r4, r10, r11, lr}
258 ; DWARF-V7-FP:    .cfi_def_cfa_offset 16
259 ; DWARF-V7-FP:    .cfi_offset lr, -4
260 ; DWARF-V7-FP:    .cfi_offset r11, -8
261 ; DWARF-V7-FP:    .cfi_offset r10, -12
262 ; DWARF-V7-FP:    .cfi_offset r4, -16
263 ; DWARF-V7-FP:    add r11, sp, #8
264 ; DWARF-V7-FP:    .cfi_def_cfa r11, 8
265 ; DWARF-V7-FP:    vpush {d8, d9, d10, d11, d12}
266 ; DWARF-V7-FP:    .cfi_offset d12, -24
267 ; DWARF-V7-FP:    .cfi_offset d11, -32
268 ; DWARF-V7-FP:    .cfi_offset d10, -40
269 ; DWARF-V7-FP:    .cfi_offset d9, -48
270 ; DWARF-V7-FP:    sub sp, sp, #24
271 ; DWARF-V7-FP:    sub sp, r11, #48
272 ; DWARF-V7-FP:    vpop {d8, d9, d10, d11, d12}
273 ; DWARF-V7-FP:    pop {r4, r10, r11, pc}
274 ; DWARF-V7-FP:    .cfi_endproc
276 ; DWARF-V7-FP-ELIM-LABEL: _Z4testiiiiiddddd:
277 ; DWARF-V7-FP-ELIM:    .cfi_startproc
278 ; DWARF-V7-FP-ELIM:    .cfi_personality 0, __gxx_personality_v0
279 ; DWARF-V7-FP-ELIM:    .cfi_lsda 0, .Lexception0
280 ; DWARF-V7-FP-ELIM:    push {r4, lr}
281 ; DWARF-V7-FP-ELIM:    .cfi_def_cfa_offset 8
282 ; DWARF-V7-FP-ELIM:    .cfi_offset lr, -4
283 ; DWARF-V7-FP-ELIM:    .cfi_offset r4, -8
284 ; DWARF-V7-FP-ELIM:    vpush {d8, d9, d10, d11, d12}
285 ; DWARF-V7-FP-ELIM:    .cfi_offset d12, -16
286 ; DWARF-V7-FP-ELIM:    .cfi_offset d11, -24
287 ; DWARF-V7-FP-ELIM:    .cfi_offset d10, -32
288 ; DWARF-V7-FP-ELIM:    .cfi_offset d9, -40
289 ; DWARF-V7-FP-ELIM:    sub sp, sp, #24
290 ; DWARF-V7-FP-ELIM:    .cfi_def_cfa_offset 72
291 ; DWARF-V7-FP-ELIM:    add sp, sp, #24
292 ; DWARF-V7-FP-ELIM:    vpop {d8, d9, d10, d11, d12}
293 ; DWARF-V7-FP-ELIM:    pop {r4, pc}
294 ; DWARF-V7-FP-ELIM:    .cfi_endproc
296 ; DWARF-WIN-FP-ELIM-LABEL: _Z4testiiiiiddddd:
297 ; DWARF-WIN-FP-ELIM:    .cfi_startproc
298 ; DWARF-WIN-FP-ELIM:    .cfi_personality 0, __gxx_personality_v0
299 ; DWARF-WIN-FP-ELIM:    .cfi_lsda 0, .Lexception0
300 ; DWARF-WIN-FP-ELIM:    push {r4, lr}
301 ; DWARF-WIN-FP-ELIM:    .cfi_def_cfa_offset 8
302 ; DWARF-WIN-FP-ELIM:    .cfi_offset lr, -4
303 ; DWARF-WIN-FP-ELIM:    .cfi_offset r4, -8
304 ; DWARF-WIN-FP-ELIM:    vpush {d8, d9, d10, d11, d12}
305 ; DWARF-WIN-FP-ELIM:    .cfi_offset d12, -16
306 ; DWARF-WIN-FP-ELIM:    .cfi_offset d11, -24
307 ; DWARF-WIN-FP-ELIM:    .cfi_offset d10, -32
308 ; DWARF-WIN-FP-ELIM:    .cfi_offset d9, -40
309 ; DWARF-WIN-FP-ELIM:    sub sp, #8
310 ; DWARF-WIN-FP-ELIM:    .cfi_def_cfa_offset 56
311 ; DWARF-WIN-FP-ELIM:    add sp, #8
312 ; DWARF-WIN-FP-ELIM:    vpop {d8, d9, d10, d11, d12}
313 ; DWARF-WIN-FP-ELIM:    pop {r4, pc}
314 ; DWARF-WIN-FP-ELIM:    .cfi_endproc
316 ;-------------------------------------------------------------------------------
317 ; Test 2
318 ;-------------------------------------------------------------------------------
320 declare void @throw_exception_2()
322 define void @test2() {
323 entry:
324   call void @throw_exception_2()
325   ret void
328 ; CHECK-FP-LABEL: test2:
329 ; CHECK-FP:   .fnstart
330 ; CHECK-FP:   .save  {r11, lr}
331 ; CHECK-FP:   push   {r11, lr}
332 ; CHECK-FP:   .setfp r11, sp
333 ; CHECK-FP:   mov    r11, sp
334 ; CHECK-FP:   pop    {r11, lr}
335 ; CHECK-FP:   mov    pc, lr
336 ; CHECK-FP:   .fnend
338 ; CHECK-FP-ELIM-LABEL: test2:
339 ; CHECK-FP-ELIM:   .fnstart
340 ; CHECK-FP-ELIM:   .save {r11, lr}
341 ; CHECK-FP-ELIM:   push  {r11, lr}
342 ; CHECK-FP-ELIM:   pop   {r11, lr}
343 ; CHECK-FP-ELIM:   mov   pc, lr
344 ; CHECK-FP-ELIM:   .fnend
346 ; CHECK-V7-FP-LABEL: test2:
347 ; CHECK-V7-FP:   .fnstart
348 ; CHECK-V7-FP:   .save  {r11, lr}
349 ; CHECK-V7-FP:   push   {r11, lr}
350 ; CHECK-V7-FP:   .setfp r11, sp
351 ; CHECK-V7-FP:   mov    r11, sp
352 ; CHECK-V7-FP:   pop    {r11, pc}
353 ; CHECK-V7-FP:   .fnend
355 ; CHECK-V7-FP-ELIM-LABEL: test2:
356 ; CHECK-V7-FP-ELIM:   .fnstart
357 ; CHECK-V7-FP-ELIM:   .save {r11, lr}
358 ; CHECK-V7-FP-ELIM:   push  {r11, lr}
359 ; CHECK-V7-FP-ELIM:   pop   {r11, pc}
360 ; CHECK-V7-FP-ELIM:   .fnend
362 ; DWARF-FP-LABEL: test2:
363 ; DWARF-FP:    .cfi_startproc
364 ; DWARF-FP:    push {r11, lr}
365 ; DWARF-FP:    .cfi_def_cfa_offset 8
366 ; DWARF-FP:    .cfi_offset lr, -4
367 ; DWARF-FP:    .cfi_offset r11, -8
368 ; DWARF-FP:    mov  r11, sp
369 ; DWARF-FP:    .cfi_def_cfa_register r11
370 ; DWARF-FP:    pop  {r11, lr}
371 ; DWARF-FP:    mov  pc, lr
372 ; DWARF-FP:    .cfi_endproc
374 ; DWARF-FP-ELIM-LABEL: test2:
375 ; DWARF-FP-ELIM:    .cfi_startproc
376 ; DWARF-FP-ELIM:    push {r11, lr}
377 ; DWARF-FP-ELIM:    .cfi_def_cfa_offset 8
378 ; DWARF-FP-ELIM:    .cfi_offset lr, -4
379 ; DWARF-FP-ELIM:    .cfi_offset r11, -8
380 ; DWARF-FP-ELIM:    pop  {r11, lr}
381 ; DWARF-FP-ELIM:    mov  pc, lr
382 ; DWARF-FP-ELIM:    .cfi_endproc
384 ; DWARF-V7-FP-LABEL: test2:
385 ; DWARF-V7-FP:    .cfi_startproc
386 ; DWARF-V7-FP:    push {r11, lr}
387 ; DWARF-V7-FP:    .cfi_def_cfa_offset 8
388 ; DWARF-V7-FP:    .cfi_offset lr, -4
389 ; DWARF-V7-FP:    .cfi_offset r11, -8
390 ; DWARF-V7-FP:    mov  r11, sp
391 ; DWARF-V7-FP:    .cfi_def_cfa_register r11
392 ; DWARF-V7-FP:    pop  {r11, pc}
393 ; DWARF-V7-FP:    .cfi_endproc
395 ; DWARF-V7-FP-ELIM-LABEL: test2:
396 ; DWARF-V7-FP-ELIM:    .cfi_startproc
397 ; DWARF-V7-FP-ELIM:    push {r11, lr}
398 ; DWARF-V7-FP-ELIM:    .cfi_def_cfa_offset 8
399 ; DWARF-V7-FP-ELIM:    .cfi_offset lr, -4
400 ; DWARF-V7-FP-ELIM:    .cfi_offset r11, -8
401 ; DWARF-V7-FP-ELIM:    pop  {r11, pc}
402 ; DWARF-V7-FP-ELIM:    .cfi_endproc
404 ; DWARF-WIN-FP-ELIM-LABEL: test2:
405 ; DWARF-WIN-FP-ELIM:    .cfi_startproc
406 ; DWARF-WIN-FP-ELIM:    push.w {r11, lr}
407 ; DWARF-WIN-FP-ELIM:    .cfi_def_cfa_offset 8
408 ; DWARF-WIN-FP-ELIM:    .cfi_offset lr, -4
409 ; DWARF-WIN-FP-ELIM:    .cfi_offset r11, -8
410 ; DWARF-WIN-FP-ELIM:    pop.w  {r11, pc}
411 ; DWARF-WIN-FP-ELIM:    .cfi_endproc
414 ;-------------------------------------------------------------------------------
415 ; Test 3
416 ;-------------------------------------------------------------------------------
418 declare void @throw_exception_3(i32)
420 define i32 @test3(i32 %a, i32 %b, i32 %c, i32 %d,
421                   i32 %e, i32 %f, i32 %g, i32 %h) {
422 entry:
423   %add = add nsw i32 %b, %a
424   %add1 = add nsw i32 %add, %c
425   %add2 = add nsw i32 %add1, %d
426   tail call void @throw_exception_3(i32 %add2)
427   %add3 = add nsw i32 %f, %e
428   %add4 = add nsw i32 %add3, %g
429   %add5 = add nsw i32 %add4, %h
430   tail call void @throw_exception_3(i32 %add5)
431   %add6 = add nsw i32 %add5, %add2
432   ret i32 %add6
435 ; CHECK-FP-LABEL: test3:
436 ; CHECK-FP:   .fnstart
437 ; CHECK-FP:   .save  {r4, r5, r11, lr}
438 ; CHECK-FP:   push   {r4, r5, r11, lr}
439 ; CHECK-FP:   .setfp r11, sp, #8
440 ; CHECK-FP:   add    r11, sp, #8
441 ; CHECK-FP:   pop    {r4, r5, r11, lr}
442 ; CHECK-FP:   mov    pc, lr
443 ; CHECK-FP:   .fnend
445 ; CHECK-FP-ELIM-LABEL: test3:
446 ; CHECK-FP-ELIM:   .fnstart
447 ; CHECK-FP-ELIM:   .save {r4, r5, r11, lr}
448 ; CHECK-FP-ELIM:   push  {r4, r5, r11, lr}
449 ; CHECK-FP-ELIM:   pop   {r4, r5, r11, lr}
450 ; CHECK-FP-ELIM:   mov   pc, lr
451 ; CHECK-FP-ELIM:   .fnend
453 ; CHECK-V7-FP-LABEL: test3:
454 ; CHECK-V7-FP:   .fnstart
455 ; CHECK-V7-FP:   .save  {r4, r5, r11, lr}
456 ; CHECK-V7-FP:   push   {r4, r5, r11, lr}
457 ; CHECK-V7-FP:   .setfp r11, sp, #8
458 ; CHECK-V7-FP:   add    r11, sp, #8
459 ; CHECK-V7-FP:   pop    {r4, r5, r11, pc}
460 ; CHECK-V7-FP:   .fnend
462 ; CHECK-V7-FP-ELIM-LABEL: test3:
463 ; CHECK-V7-FP-ELIM:   .fnstart
464 ; CHECK-V7-FP-ELIM:   .save {r4, r5, r11, lr}
465 ; CHECK-V7-FP-ELIM:   push  {r4, r5, r11, lr}
466 ; CHECK-V7-FP-ELIM:   pop   {r4, r5, r11, pc}
467 ; CHECK-V7-FP-ELIM:   .fnend
469 ; DWARF-FP-LABEL: test3:
470 ; DWARF-FP:    .cfi_startproc
471 ; DWARF-FP:    push {r4, r5, r11, lr}
472 ; DWARF-FP:    .cfi_def_cfa_offset 16
473 ; DWARF-FP:    .cfi_offset lr, -4
474 ; DWARF-FP:    .cfi_offset r11, -8
475 ; DWARF-FP:    .cfi_offset r5, -12
476 ; DWARF-FP:    .cfi_offset r4, -16
477 ; DWARF-FP:    add  r11, sp, #8
478 ; DWARF-FP:    .cfi_def_cfa r11, 8
479 ; DWARF-FP:    pop  {r4, r5, r11, lr}
480 ; DWARF-FP:    mov  pc, lr
481 ; DWARF-FP:    .cfi_endproc
483 ; DWARF-FP-ELIM-LABEL: test3:
484 ; DWARF-FP-ELIM:    .cfi_startproc
485 ; DWARF-FP-ELIM:    push {r4, r5, r11, lr}
486 ; DWARF-FP-ELIM:    .cfi_def_cfa_offset 16
487 ; DWARF-FP-ELIM:    .cfi_offset lr, -4
488 ; DWARF-FP-ELIM:    .cfi_offset r11, -8
489 ; DWARF-FP-ELIM:    .cfi_offset r5, -12
490 ; DWARF-FP-ELIM:    .cfi_offset r4, -16
491 ; DWARF-FP-ELIM:    pop  {r4, r5, r11, lr}
492 ; DWARF-FP-ELIM:    mov  pc, lr
493 ; DWARF-FP-ELIM:    .cfi_endproc
495 ; DWARF-V7-FP-LABEL: test3:
496 ; DWARF-V7-FP:    .cfi_startproc
497 ; DWARF-V7-FP:    push {r4, r5, r11, lr}
498 ; DWARF-V7-FP:    .cfi_def_cfa_offset 16
499 ; DWARF-V7-FP:    .cfi_offset lr, -4
500 ; DWARF-V7-FP:    .cfi_offset r11, -8
501 ; DWARF-V7-FP:    .cfi_offset r5, -12
502 ; DWARF-V7-FP:    .cfi_offset r4, -16
503 ; DWARF-V7-FP:    add  r11, sp, #8
504 ; DWARF-V7-FP:    .cfi_def_cfa r11, 8
505 ; DWARF-V7-FP:    pop  {r4, r5, r11, pc}
506 ; DWARF-V7-FP:    .cfi_endproc
508 ; DWARF-V7-FP-ELIM-LABEL: test3:
509 ; DWARF-V7-FP-ELIM:    .cfi_startproc
510 ; DWARF-V7-FP-ELIM:    push {r4, r5, r11, lr}
511 ; DWARF-V7-FP-ELIM:    .cfi_def_cfa_offset 16
512 ; DWARF-V7-FP-ELIM:    .cfi_offset lr, -4
513 ; DWARF-V7-FP-ELIM:    .cfi_offset r11, -8
514 ; DWARF-V7-FP-ELIM:    .cfi_offset r5, -12
515 ; DWARF-V7-FP-ELIM:    .cfi_offset r4, -16
516 ; DWARF-V7-FP-ELIM:    pop  {r4, r5, r11, pc}
517 ; DWARF-V7-FP-ELIM:    .cfi_endproc
519 ; DWARF-WIN-FP-ELIM-LABEL: test3:
520 ; DWARF-WIN-FP-ELIM:    .cfi_startproc
521 ; DWARF-WIN-FP-ELIM:    push.w {r4, r5, r11, lr}
522 ; DWARF-WIN-FP-ELIM:    .cfi_def_cfa_offset 16
523 ; DWARF-WIN-FP-ELIM:    .cfi_offset lr, -4
524 ; DWARF-WIN-FP-ELIM:    .cfi_offset r11, -8
525 ; DWARF-WIN-FP-ELIM:    .cfi_offset r5, -12
526 ; DWARF-WIN-FP-ELIM:    .cfi_offset r4, -16
527 ; DWARF-WIN-FP-ELIM:    pop.w  {r4, r5, r11, pc}
528 ; DWARF-WIN-FP-ELIM:    .cfi_endproc
531 ;-------------------------------------------------------------------------------
532 ; Test 4
533 ;-------------------------------------------------------------------------------
535 define void @test4() nounwind {
536 entry:
537   ret void
540 ; CHECK-FP-LABEL: test4:
541 ; CHECK-FP:   .fnstart
542 ; CHECK-FP:   mov pc, lr
543 ; CHECK-FP:   .cantunwind
544 ; CHECK-FP:   .fnend
546 ; CHECK-FP-ELIM-LABEL: test4:
547 ; CHECK-FP-ELIM:   .fnstart
548 ; CHECK-FP-ELIM:   mov pc, lr
549 ; CHECK-FP-ELIM:   .cantunwind
550 ; CHECK-FP-ELIM:   .fnend
552 ; CHECK-V7-FP-LABEL: test4:
553 ; CHECK-V7-FP:   .fnstart
554 ; CHECK-V7-FP:   bx lr
555 ; CHECK-V7-FP:   .cantunwind
556 ; CHECK-V7-FP:   .fnend
558 ; CHECK-V7-FP-ELIM-LABEL: test4:
559 ; CHECK-V7-FP-ELIM:   .fnstart
560 ; CHECK-V7-FP-ELIM:   bx lr
561 ; CHECK-V7-FP-ELIM:   .cantunwind
562 ; CHECK-V7-FP-ELIM:   .fnend
564 ; DWARF-FP-LABEL: test4:
565 ; DWARF-FP-NOT: .cfi_startproc
566 ; DWARF-FP:    mov pc, lr
567 ; DWARF-FP-NOT: .cfi_endproc
568 ; DWARF-FP:    .size test4,
570 ; DWARF-FP-ELIM-LABEL: test4:
571 ; DWARF-FP-ELIM-NOT: .cfi_startproc
572 ; DWARF-FP-ELIM:     mov pc, lr
573 ; DWARF-FP-ELIM-NOT: .cfi_endproc
574 ; DWARF-FP-ELIM:     .size test4,
576 ; DWARF-V7-FP-LABEL: test4:
577 ; DWARF-V7-FP-NOT: .cfi_startproc
578 ; DWARF-V7-FP:    bx lr
579 ; DWARF-V7-FP-NOT: .cfi_endproc
580 ; DWARF-V7-FP:    .size test4,
582 ; DWARF-V7-FP-ELIM-LABEL: test4:
583 ; DWARF-V7-FP-ELIM-NOT: .cfi_startproc
584 ; DWARF-V7-FP-ELIM:     bx lr
585 ; DWARF-V7-FP-ELIM-NOT: .cfi_endproc
586 ; DWARF-V7-FP-ELIM:     .size test4,
588 ; DWARF-WIN-FP-ELIM-LABEL: test4:
589 ; DWARF-WIN-FP-ELIM-NOT: .cfi_startproc
590 ; DWARF-WIN-FP-ELIM:     bx lr
591 ; DWARF-WIN-FP-ELIM-NOT: .cfi_endproc