1; ARM EHABI integrated test
2
3; This test case checks whether the ARM unwind directives are properly
4; generated or not.
5
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.
14
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
20
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
24
25; RUN: llc -mtriple arm-unknown-linux-gnueabi \
26; RUN:     -filetype=asm -o - %s \
27; RUN:   | FileCheck %s --check-prefix=CHECK-FP-ELIM
28
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
32
33; RUN: llc -mtriple armv7-unknown-linux-gnueabi \
34; RUN:     -filetype=asm -o - %s \
35; RUN:   | FileCheck %s --check-prefix=CHECK-V7-FP-ELIM
36
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
40
41; RUN: llc -mtriple arm-unknown-linux-musleabi \
42; RUN:     -filetype=asm -o - %s \
43; RUN:   | FileCheck %s --check-prefix=CHECK-FP-ELIM
44
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
48
49; RUN: llc -mtriple armv7-unknown-linux-musleabi \
50; RUN:     -filetype=asm -o - %s \
51; RUN:   | FileCheck %s --check-prefix=CHECK-V7-FP-ELIM
52
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
56
57; RUN: llc -mtriple arm-unknown-linux-androideabi \
58; RUN:     -filetype=asm -o - %s \
59; RUN:   | FileCheck %s --check-prefix=CHECK-FP-ELIM
60
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
64
65; RUN: llc -mtriple armv7-unknown-linux-androideabi \
66; RUN:     -filetype=asm -o - %s \
67; RUN:   | FileCheck %s --check-prefix=CHECK-V7-FP-ELIM
68
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
72
73; RUN: llc -mtriple arm-unknown-netbsd-eabi \
74; RUN:     -filetype=asm -o - %s \
75; RUN:   | FileCheck %s --check-prefix=DWARF-FP-ELIM
76
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
80
81; RUN: llc -mtriple armv7-unknown-netbsd-eabi \
82; RUN:     -filetype=asm -o - %s \
83; RUN:   | FileCheck %s --check-prefix=DWARF-V7-FP-ELIM
84
85; RUN: llc -mtriple thumbv7-windows-gnu \
86; RUN:     -filetype=asm -o - %s \
87; RUN:   | FileCheck %s --check-prefix=DWARF-WIN-FP-ELIM
88
89;-------------------------------------------------------------------------------
90; Test 1
91;-------------------------------------------------------------------------------
92; This is the LLVM assembly generated from following C++ code:
93;
94;   extern void print(int, int, int, int, int);
95;   extern void print(double, double, double, double, double);
96;
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;   }
105
106declare void @_Z5printiiiii(i32, i32, i32, i32, i32)
107
108declare void @_Z5printddddd(double, double, double, double, double)
109
110define 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*) {
113entry:
114  invoke void @_Z5printiiiii(i32 %a, i32 %b, i32 %c, i32 %d, i32 %e)
115          to label %try.cont unwind label %lpad
116
117lpad:
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
125
126invoke.cont2:
127  tail call void @__cxa_end_catch()
128  br label %try.cont
129
130try.cont:
131  ret void
132
133lpad1:
134  %3 = landingpad { i8*, i32 }
135          cleanup
136  invoke void @__cxa_end_catch()
137          to label %eh.resume unwind label %terminate.lpad
138
139eh.resume:
140  resume { i8*, i32 } %3
141
142terminate.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
148}
149
150declare void @__clang_call_terminate(i8*)
151
152declare i32 @__gxx_personality_v0(...)
153
154declare i8* @__cxa_begin_catch(i8*)
155
156declare void @__cxa_end_catch()
157
158declare void @_ZSt9terminatev()
159
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
171
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
181
182; CHECK-V7-FP-LABEL: _Z4testiiiiiddddd:
183; CHECK-V7-FP:   .fnstart
184; CHECK-V7-FP:   .save  {r11, lr}
185; CHECK-V7-FP:   push   {r11, lr}
186; CHECK-V7-FP:   .setfp r11, sp
187; CHECK-V7-FP:   mov    r11, sp
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
195
196; CHECK-V7-FP-ELIM-LABEL: _Z4testiiiiiddddd:
197; CHECK-V7-FP-ELIM:   .fnstart
198; CHECK-V7-FP-ELIM:   .save  {r11, lr}
199; CHECK-V7-FP-ELIM:   push   {r11, 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
207
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
230
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
252
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 {r11, lr}
258; DWARF-V7-FP:    .cfi_def_cfa_offset 8
259; DWARF-V7-FP:    .cfi_offset lr, -4
260; DWARF-V7-FP:    .cfi_offset r11, -8
261; DWARF-V7-FP:    mov r11, sp
262; DWARF-V7-FP:    .cfi_def_cfa_register r11
263; DWARF-V7-FP:    vpush {d8, d9, d10, d11, d12}
264; DWARF-V7-FP:    .cfi_offset d12, -16
265; DWARF-V7-FP:    .cfi_offset d11, -24
266; DWARF-V7-FP:    .cfi_offset d10, -32
267; DWARF-V7-FP:    .cfi_offset d9, -40
268; DWARF-V7-FP:    sub sp, sp, #24
269; DWARF-V7-FP:    sub sp, r11, #40
270; DWARF-V7-FP:    vpop {d8, d9, d10, d11, d12}
271; DWARF-V7-FP:    pop {r11, pc}
272; DWARF-V7-FP:    .cfi_endproc
273
274; DWARF-V7-FP-ELIM-LABEL: _Z4testiiiiiddddd:
275; DWARF-V7-FP-ELIM:    .cfi_startproc
276; DWARF-V7-FP-ELIM:    .cfi_personality 0, __gxx_personality_v0
277; DWARF-V7-FP-ELIM:    .cfi_lsda 0, .Lexception0
278; DWARF-V7-FP-ELIM:    push {r11, lr}
279; DWARF-V7-FP-ELIM:    .cfi_def_cfa_offset 8
280; DWARF-V7-FP-ELIM:    .cfi_offset lr, -4
281; DWARF-V7-FP-ELIM:    .cfi_offset r11, -8
282; DWARF-V7-FP-ELIM:    vpush {d8, d9, d10, d11, d12}
283; DWARF-V7-FP-ELIM:    .cfi_offset d12, -16
284; DWARF-V7-FP-ELIM:    .cfi_offset d11, -24
285; DWARF-V7-FP-ELIM:    .cfi_offset d10, -32
286; DWARF-V7-FP-ELIM:    .cfi_offset d9, -40
287; DWARF-V7-FP-ELIM:    sub sp, sp, #24
288; DWARF-V7-FP-ELIM:    .cfi_def_cfa_offset 72
289; DWARF-V7-FP-ELIM:    add sp, sp, #24
290; DWARF-V7-FP-ELIM:    vpop {d8, d9, d10, d11, d12}
291; DWARF-V7-FP-ELIM:    pop {r11, pc}
292; DWARF-V7-FP-ELIM:    .cfi_endproc
293
294; DWARF-WIN-FP-ELIM-LABEL: _Z4testiiiiiddddd:
295; DWARF-WIN-FP-ELIM:    .cfi_startproc
296; DWARF-WIN-FP-ELIM:    .cfi_personality 0, __gxx_personality_v0
297; DWARF-WIN-FP-ELIM:    .cfi_lsda 0, .Lexception0
298; DWARF-WIN-FP-ELIM:    push {r4, lr}
299; DWARF-WIN-FP-ELIM:    .cfi_def_cfa_offset 8
300; DWARF-WIN-FP-ELIM:    .cfi_offset lr, -4
301; DWARF-WIN-FP-ELIM:    .cfi_offset r4, -8
302; DWARF-WIN-FP-ELIM:    vpush {d8, d9, d10, d11, d12}
303; DWARF-WIN-FP-ELIM:    .cfi_offset d12, -16
304; DWARF-WIN-FP-ELIM:    .cfi_offset d11, -24
305; DWARF-WIN-FP-ELIM:    .cfi_offset d10, -32
306; DWARF-WIN-FP-ELIM:    .cfi_offset d9, -40
307; DWARF-WIN-FP-ELIM:    sub sp, #8
308; DWARF-WIN-FP-ELIM:    .cfi_def_cfa_offset 56
309; DWARF-WIN-FP-ELIM:    add sp, #8
310; DWARF-WIN-FP-ELIM:    vpop {d8, d9, d10, d11, d12}
311; DWARF-WIN-FP-ELIM:    pop {r4, pc}
312; DWARF-WIN-FP-ELIM:    .cfi_endproc
313
314;-------------------------------------------------------------------------------
315; Test 2
316;-------------------------------------------------------------------------------
317
318declare void @throw_exception_2()
319
320define void @test2() {
321entry:
322  call void @throw_exception_2()
323  ret void
324}
325
326; CHECK-FP-LABEL: test2:
327; CHECK-FP:   .fnstart
328; CHECK-FP:   .save  {r11, lr}
329; CHECK-FP:   push   {r11, lr}
330; CHECK-FP:   .setfp r11, sp
331; CHECK-FP:   mov    r11, sp
332; CHECK-FP:   pop    {r11, lr}
333; CHECK-FP:   mov    pc, lr
334; CHECK-FP:   .fnend
335
336; CHECK-FP-ELIM-LABEL: test2:
337; CHECK-FP-ELIM:   .fnstart
338; CHECK-FP-ELIM:   .save {r11, lr}
339; CHECK-FP-ELIM:   push  {r11, lr}
340; CHECK-FP-ELIM:   pop   {r11, lr}
341; CHECK-FP-ELIM:   mov   pc, lr
342; CHECK-FP-ELIM:   .fnend
343
344; CHECK-V7-FP-LABEL: test2:
345; CHECK-V7-FP:   .fnstart
346; CHECK-V7-FP:   .save  {r11, lr}
347; CHECK-V7-FP:   push   {r11, lr}
348; CHECK-V7-FP:   .setfp r11, sp
349; CHECK-V7-FP:   mov    r11, sp
350; CHECK-V7-FP:   pop    {r11, pc}
351; CHECK-V7-FP:   .fnend
352
353; CHECK-V7-FP-ELIM-LABEL: test2:
354; CHECK-V7-FP-ELIM:   .fnstart
355; CHECK-V7-FP-ELIM:   .save {r11, lr}
356; CHECK-V7-FP-ELIM:   push  {r11, lr}
357; CHECK-V7-FP-ELIM:   pop   {r11, pc}
358; CHECK-V7-FP-ELIM:   .fnend
359
360; DWARF-FP-LABEL: test2:
361; DWARF-FP:    .cfi_startproc
362; DWARF-FP:    push {r11, lr}
363; DWARF-FP:    .cfi_def_cfa_offset 8
364; DWARF-FP:    .cfi_offset lr, -4
365; DWARF-FP:    .cfi_offset r11, -8
366; DWARF-FP:    mov  r11, sp
367; DWARF-FP:    .cfi_def_cfa_register r11
368; DWARF-FP:    pop  {r11, lr}
369; DWARF-FP:    mov  pc, lr
370; DWARF-FP:    .cfi_endproc
371
372; DWARF-FP-ELIM-LABEL: test2:
373; DWARF-FP-ELIM:    .cfi_startproc
374; DWARF-FP-ELIM:    push {r11, lr}
375; DWARF-FP-ELIM:    .cfi_def_cfa_offset 8
376; DWARF-FP-ELIM:    .cfi_offset lr, -4
377; DWARF-FP-ELIM:    .cfi_offset r11, -8
378; DWARF-FP-ELIM:    pop  {r11, lr}
379; DWARF-FP-ELIM:    mov  pc, lr
380; DWARF-FP-ELIM:    .cfi_endproc
381
382; DWARF-V7-FP-LABEL: test2:
383; DWARF-V7-FP:    .cfi_startproc
384; DWARF-V7-FP:    push {r11, lr}
385; DWARF-V7-FP:    .cfi_def_cfa_offset 8
386; DWARF-V7-FP:    .cfi_offset lr, -4
387; DWARF-V7-FP:    .cfi_offset r11, -8
388; DWARF-V7-FP:    mov  r11, sp
389; DWARF-V7-FP:    .cfi_def_cfa_register r11
390; DWARF-V7-FP:    pop  {r11, pc}
391; DWARF-V7-FP:    .cfi_endproc
392
393; DWARF-V7-FP-ELIM-LABEL: test2:
394; DWARF-V7-FP-ELIM:    .cfi_startproc
395; DWARF-V7-FP-ELIM:    push {r11, lr}
396; DWARF-V7-FP-ELIM:    .cfi_def_cfa_offset 8
397; DWARF-V7-FP-ELIM:    .cfi_offset lr, -4
398; DWARF-V7-FP-ELIM:    .cfi_offset r11, -8
399; DWARF-V7-FP-ELIM:    pop  {r11, pc}
400; DWARF-V7-FP-ELIM:    .cfi_endproc
401
402; DWARF-WIN-FP-ELIM-LABEL: test2:
403; DWARF-WIN-FP-ELIM:    .cfi_startproc
404; DWARF-WIN-FP-ELIM:    push.w {r11, lr}
405; DWARF-WIN-FP-ELIM:    .cfi_def_cfa_offset 8
406; DWARF-WIN-FP-ELIM:    .cfi_offset lr, -4
407; DWARF-WIN-FP-ELIM:    .cfi_offset r11, -8
408; DWARF-WIN-FP-ELIM:    pop.w  {r11, pc}
409; DWARF-WIN-FP-ELIM:    .cfi_endproc
410
411
412;-------------------------------------------------------------------------------
413; Test 3
414;-------------------------------------------------------------------------------
415
416declare void @throw_exception_3(i32)
417
418define i32 @test3(i32 %a, i32 %b, i32 %c, i32 %d,
419                  i32 %e, i32 %f, i32 %g, i32 %h) {
420entry:
421  %add = add nsw i32 %b, %a
422  %add1 = add nsw i32 %add, %c
423  %add2 = add nsw i32 %add1, %d
424  tail call void @throw_exception_3(i32 %add2)
425  %add3 = add nsw i32 %f, %e
426  %add4 = add nsw i32 %add3, %g
427  %add5 = add nsw i32 %add4, %h
428  tail call void @throw_exception_3(i32 %add5)
429  %add6 = add nsw i32 %add5, %add2
430  ret i32 %add6
431}
432
433; CHECK-FP-LABEL: test3:
434; CHECK-FP:   .fnstart
435; CHECK-FP:   .save  {r4, r5, r11, lr}
436; CHECK-FP:   push   {r4, r5, r11, lr}
437; CHECK-FP:   .setfp r11, sp, #8
438; CHECK-FP:   add    r11, sp, #8
439; CHECK-FP:   pop    {r4, r5, r11, lr}
440; CHECK-FP:   mov    pc, lr
441; CHECK-FP:   .fnend
442
443; CHECK-FP-ELIM-LABEL: test3:
444; CHECK-FP-ELIM:   .fnstart
445; CHECK-FP-ELIM:   .save {r4, r5, r11, lr}
446; CHECK-FP-ELIM:   push  {r4, r5, r11, lr}
447; CHECK-FP-ELIM:   pop   {r4, r5, r11, lr}
448; CHECK-FP-ELIM:   mov   pc, lr
449; CHECK-FP-ELIM:   .fnend
450
451; CHECK-V7-FP-LABEL: test3:
452; CHECK-V7-FP:   .fnstart
453; CHECK-V7-FP:   .save  {r4, r5, r11, lr}
454; CHECK-V7-FP:   push   {r4, r5, r11, lr}
455; CHECK-V7-FP:   .setfp r11, sp, #8
456; CHECK-V7-FP:   add    r11, sp, #8
457; CHECK-V7-FP:   pop    {r4, r5, r11, pc}
458; CHECK-V7-FP:   .fnend
459
460; CHECK-V7-FP-ELIM-LABEL: test3:
461; CHECK-V7-FP-ELIM:   .fnstart
462; CHECK-V7-FP-ELIM:   .save {r4, r5, r11, lr}
463; CHECK-V7-FP-ELIM:   push  {r4, r5, r11, lr}
464; CHECK-V7-FP-ELIM:   pop   {r4, r5, r11, pc}
465; CHECK-V7-FP-ELIM:   .fnend
466
467; DWARF-FP-LABEL: test3:
468; DWARF-FP:    .cfi_startproc
469; DWARF-FP:    push {r4, r5, r11, lr}
470; DWARF-FP:    .cfi_def_cfa_offset 16
471; DWARF-FP:    .cfi_offset lr, -4
472; DWARF-FP:    .cfi_offset r11, -8
473; DWARF-FP:    .cfi_offset r5, -12
474; DWARF-FP:    .cfi_offset r4, -16
475; DWARF-FP:    add  r11, sp, #8
476; DWARF-FP:    .cfi_def_cfa r11, 8
477; DWARF-FP:    pop  {r4, r5, r11, lr}
478; DWARF-FP:    mov  pc, lr
479; DWARF-FP:    .cfi_endproc
480
481; DWARF-FP-ELIM-LABEL: test3:
482; DWARF-FP-ELIM:    .cfi_startproc
483; DWARF-FP-ELIM:    push {r4, r5, r11, lr}
484; DWARF-FP-ELIM:    .cfi_def_cfa_offset 16
485; DWARF-FP-ELIM:    .cfi_offset lr, -4
486; DWARF-FP-ELIM:    .cfi_offset r11, -8
487; DWARF-FP-ELIM:    .cfi_offset r5, -12
488; DWARF-FP-ELIM:    .cfi_offset r4, -16
489; DWARF-FP-ELIM:    pop  {r4, r5, r11, lr}
490; DWARF-FP-ELIM:    mov  pc, lr
491; DWARF-FP-ELIM:    .cfi_endproc
492
493; DWARF-V7-FP-LABEL: test3:
494; DWARF-V7-FP:    .cfi_startproc
495; DWARF-V7-FP:    push {r4, r5, r11, lr}
496; DWARF-V7-FP:    .cfi_def_cfa_offset 16
497; DWARF-V7-FP:    .cfi_offset lr, -4
498; DWARF-V7-FP:    .cfi_offset r11, -8
499; DWARF-V7-FP:    .cfi_offset r5, -12
500; DWARF-V7-FP:    .cfi_offset r4, -16
501; DWARF-V7-FP:    add  r11, sp, #8
502; DWARF-V7-FP:    .cfi_def_cfa r11, 8
503; DWARF-V7-FP:    pop  {r4, r5, r11, pc}
504; DWARF-V7-FP:    .cfi_endproc
505
506; DWARF-V7-FP-ELIM-LABEL: test3:
507; DWARF-V7-FP-ELIM:    .cfi_startproc
508; DWARF-V7-FP-ELIM:    push {r4, r5, r11, lr}
509; DWARF-V7-FP-ELIM:    .cfi_def_cfa_offset 16
510; DWARF-V7-FP-ELIM:    .cfi_offset lr, -4
511; DWARF-V7-FP-ELIM:    .cfi_offset r11, -8
512; DWARF-V7-FP-ELIM:    .cfi_offset r5, -12
513; DWARF-V7-FP-ELIM:    .cfi_offset r4, -16
514; DWARF-V7-FP-ELIM:    pop  {r4, r5, r11, pc}
515; DWARF-V7-FP-ELIM:    .cfi_endproc
516
517; DWARF-WIN-FP-ELIM-LABEL: test3:
518; DWARF-WIN-FP-ELIM:    .cfi_startproc
519; DWARF-WIN-FP-ELIM:    push.w {r4, r5, r11, lr}
520; DWARF-WIN-FP-ELIM:    .cfi_def_cfa_offset 16
521; DWARF-WIN-FP-ELIM:    .cfi_offset lr, -4
522; DWARF-WIN-FP-ELIM:    .cfi_offset r11, -8
523; DWARF-WIN-FP-ELIM:    .cfi_offset r5, -12
524; DWARF-WIN-FP-ELIM:    .cfi_offset r4, -16
525; DWARF-WIN-FP-ELIM:    pop.w  {r4, r5, r11, pc}
526; DWARF-WIN-FP-ELIM:    .cfi_endproc
527
528
529;-------------------------------------------------------------------------------
530; Test 4
531;-------------------------------------------------------------------------------
532
533define void @test4() nounwind {
534entry:
535  ret void
536}
537
538; CHECK-FP-LABEL: test4:
539; CHECK-FP:   .fnstart
540; CHECK-FP:   mov pc, lr
541; CHECK-FP:   .cantunwind
542; CHECK-FP:   .fnend
543
544; CHECK-FP-ELIM-LABEL: test4:
545; CHECK-FP-ELIM:   .fnstart
546; CHECK-FP-ELIM:   mov pc, lr
547; CHECK-FP-ELIM:   .cantunwind
548; CHECK-FP-ELIM:   .fnend
549
550; CHECK-V7-FP-LABEL: test4:
551; CHECK-V7-FP:   .fnstart
552; CHECK-V7-FP:   bx lr
553; CHECK-V7-FP:   .cantunwind
554; CHECK-V7-FP:   .fnend
555
556; CHECK-V7-FP-ELIM-LABEL: test4:
557; CHECK-V7-FP-ELIM:   .fnstart
558; CHECK-V7-FP-ELIM:   bx lr
559; CHECK-V7-FP-ELIM:   .cantunwind
560; CHECK-V7-FP-ELIM:   .fnend
561
562; DWARF-FP-LABEL: test4:
563; DWARF-FP-NOT: .cfi_startproc
564; DWARF-FP:    mov pc, lr
565; DWARF-FP-NOT: .cfi_endproc
566; DWARF-FP:    .size test4,
567
568; DWARF-FP-ELIM-LABEL: test4:
569; DWARF-FP-ELIM-NOT: .cfi_startproc
570; DWARF-FP-ELIM:     mov pc, lr
571; DWARF-FP-ELIM-NOT: .cfi_endproc
572; DWARF-FP-ELIM:     .size test4,
573
574; DWARF-V7-FP-LABEL: test4:
575; DWARF-V7-FP-NOT: .cfi_startproc
576; DWARF-V7-FP:    bx lr
577; DWARF-V7-FP-NOT: .cfi_endproc
578; DWARF-V7-FP:    .size test4,
579
580; DWARF-V7-FP-ELIM-LABEL: test4:
581; DWARF-V7-FP-ELIM-NOT: .cfi_startproc
582; DWARF-V7-FP-ELIM:     bx lr
583; DWARF-V7-FP-ELIM-NOT: .cfi_endproc
584; DWARF-V7-FP-ELIM:     .size test4,
585
586; DWARF-WIN-FP-ELIM-LABEL: test4:
587; DWARF-WIN-FP-ELIM-NOT: .cfi_startproc
588; DWARF-WIN-FP-ELIM:     bx lr
589; DWARF-WIN-FP-ELIM-NOT: .cfi_endproc
590