Home | History | Annotate | Download | only in ARM
      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 -disable-fp-elim
     17 ; (2) arm without -disable-fp-elim
     18 ; (3) armv7 with -disable-fp-elim
     19 ; (4) armv7 without -disable-fp-elim
     20 
     21 ; RUN: llc -mtriple arm-unknown-linux-gnueabi \
     22 ; RUN:     -disable-fp-elim -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:     -disable-fp-elim -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:     -disable-fp-elim -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:     -disable-fp-elim -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:     -disable-fp-elim -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:     -disable-fp-elim -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:     -disable-fp-elim -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:     -disable-fp-elim -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 ;-------------------------------------------------------------------------------
     86 ; Test 1
     87 ;-------------------------------------------------------------------------------
     88 ; This is the LLVM assembly generated from following C++ code:
     89 ;
     90 ;   extern void print(int, int, int, int, int);
     91 ;   extern void print(double, double, double, double, double);
     92 ;
     93 ;   void test(int a, int b, int c, int d, int e,
     94 ;             double m, double n, double p, double q, double r) {
     95 ;     try {
     96 ;       print(a, b, c, d, e);
     97 ;     } catch (...) {
     98 ;       print(m, n, p, q, r);
     99 ;     }
    100 ;   }
    101 
    102 declare void @_Z5printiiiii(i32, i32, i32, i32, i32)
    103 
    104 declare void @_Z5printddddd(double, double, double, double, double)
    105 
    106 define void @_Z4testiiiiiddddd(i32 %a, i32 %b, i32 %c, i32 %d, i32 %e,
    107                                double %m, double %n, double %p,
    108                                double %q, double %r) personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*) {
    109 entry:
    110   invoke void @_Z5printiiiii(i32 %a, i32 %b, i32 %c, i32 %d, i32 %e)
    111           to label %try.cont unwind label %lpad
    112 
    113 lpad:
    114   %0 = landingpad { i8*, i32 }
    115           catch i8* null
    116   %1 = extractvalue { i8*, i32 } %0, 0
    117   %2 = tail call i8* @__cxa_begin_catch(i8* %1)
    118   invoke void @_Z5printddddd(double %m, double %n, double %p,
    119                              double %q, double %r)
    120           to label %invoke.cont2 unwind label %lpad1
    121 
    122 invoke.cont2:
    123   tail call void @__cxa_end_catch()
    124   br label %try.cont
    125 
    126 try.cont:
    127   ret void
    128 
    129 lpad1:
    130   %3 = landingpad { i8*, i32 }
    131           cleanup
    132   invoke void @__cxa_end_catch()
    133           to label %eh.resume unwind label %terminate.lpad
    134 
    135 eh.resume:
    136   resume { i8*, i32 } %3
    137 
    138 terminate.lpad:
    139   %4 = landingpad { i8*, i32 }
    140           catch i8* null
    141   %5 = extractvalue { i8*, i32 } %4, 0
    142   tail call void @__clang_call_terminate(i8* %5)
    143   unreachable
    144 }
    145 
    146 declare void @__clang_call_terminate(i8*)
    147 
    148 declare i32 @__gxx_personality_v0(...)
    149 
    150 declare i8* @__cxa_begin_catch(i8*)
    151 
    152 declare void @__cxa_end_catch()
    153 
    154 declare void @_ZSt9terminatev()
    155 
    156 ; CHECK-FP-LABEL: _Z4testiiiiiddddd:
    157 ; CHECK-FP:   .fnstart
    158 ; CHECK-FP:   .save  {r4, r5, r6, r7, r8, r9, r10, r11, lr}
    159 ; CHECK-FP:   push   {r4, r5, r6, r7, r8, r9, r10, r11, lr}
    160 ; CHECK-FP:   .setfp r11, sp, #28
    161 ; CHECK-FP:   add    r11, sp, #28
    162 ; CHECK-FP:   .pad   #44
    163 ; CHECK-FP:   sub    sp, sp, #44
    164 ; CHECK-FP:   .personality __gxx_personality_v0
    165 ; CHECK-FP:   .handlerdata
    166 ; CHECK-FP:   .fnend
    167 
    168 ; CHECK-FP-ELIM-LABEL: _Z4testiiiiiddddd:
    169 ; CHECK-FP-ELIM:   .fnstart
    170 ; CHECK-FP-ELIM:   .save {r4, r5, r6, r7, r8, r9, r10, r11, lr}
    171 ; CHECK-FP-ELIM:   push  {r4, r5, r6, r7, r8, r9, r10, r11, lr}
    172 ; CHECK-FP-ELIM:   .pad  #36
    173 ; CHECK-FP-ELIM:   sub   sp, sp, #36
    174 ; CHECK-FP-ELIM:   .personality __gxx_personality_v0
    175 ; CHECK-FP-ELIM:   .handlerdata
    176 ; CHECK-FP-ELIM:   .fnend
    177 
    178 ; CHECK-V7-FP-LABEL: _Z4testiiiiiddddd:
    179 ; CHECK-V7-FP:   .fnstart
    180 ; CHECK-V7-FP:   .save  {r4, r10, r11, lr}
    181 ; CHECK-V7-FP:   push   {r4, r10, r11, lr}
    182 ; CHECK-V7-FP:   .setfp r11, sp, #8
    183 ; CHECK-V7-FP:   add    r11, sp, #8
    184 ; CHECK-V7-FP:   .vsave {d8, d9, d10, d11, d12}
    185 ; CHECK-V7-FP:   vpush  {d8, d9, d10, d11, d12}
    186 ; CHECK-V7-FP:   .pad   #24
    187 ; CHECK-V7-FP:   sub    sp, sp, #24
    188 ; CHECK-V7-FP:   .personality __gxx_personality_v0
    189 ; CHECK-V7-FP:   .handlerdata
    190 ; CHECK-V7-FP:   .fnend
    191 
    192 ; CHECK-V7-FP-ELIM-LABEL: _Z4testiiiiiddddd:
    193 ; CHECK-V7-FP-ELIM:   .fnstart
    194 ; CHECK-V7-FP-ELIM:   .save  {r4, lr}
    195 ; CHECK-V7-FP-ELIM:   push   {r4, lr}
    196 ; CHECK-V7-FP-ELIM:   .vsave {d8, d9, d10, d11, d12}
    197 ; CHECK-V7-FP-ELIM:   vpush  {d8, d9, d10, d11, d12}
    198 ; CHECK-V7-FP-ELIM:   .pad   #24
    199 ; CHECK-V7-FP-ELIM:   sub    sp, sp, #24
    200 ; CHECK-V7-FP-ELIM:   .personality __gxx_personality_v0
    201 ; CHECK-V7-FP-ELIM:   .handlerdata
    202 ; CHECK-V7-FP-ELIM:   .fnend
    203 
    204 ; DWARF-FP-LABEL: _Z4testiiiiiddddd:
    205 ; DWARF-FP:    .cfi_startproc
    206 ; DWARF-FP:    .cfi_personality 0, __gxx_personality_v0
    207 ; DWARF-FP:    .cfi_lsda 0, .Lexception0
    208 ; DWARF-FP:    push {r4, r5, r6, r7, r8, r9, r10, r11, lr}
    209 ; DWARF-FP:    .cfi_def_cfa_offset 36
    210 ; DWARF-FP:    .cfi_offset lr, -4
    211 ; DWARF-FP:    .cfi_offset r11, -8
    212 ; DWARF-FP:    .cfi_offset r10, -12
    213 ; DWARF-FP:    .cfi_offset r9, -16
    214 ; DWARF-FP:    .cfi_offset r8, -20
    215 ; DWARF-FP:    .cfi_offset r7, -24
    216 ; DWARF-FP:    .cfi_offset r6, -28
    217 ; DWARF-FP:    .cfi_offset r5, -32
    218 ; DWARF-FP:    .cfi_offset r4, -36
    219 ; DWARF-FP:    add r11, sp, #28
    220 ; DWARF-FP:    .cfi_def_cfa r11, 8
    221 ; DWARF-FP:    sub sp, sp, #44
    222 ; DWARF-FP:    sub sp, r11, #28
    223 ; DWARF-FP:    pop {r4, r5, r6, r7, r8, r9, r10, r11, lr}
    224 ; DWARF-FP:    mov pc, lr
    225 ; DWARF-FP:    .cfi_endproc
    226 
    227 ; DWARF-FP-ELIM-LABEL: _Z4testiiiiiddddd:
    228 ; DWARF-FP-ELIM:    .cfi_startproc
    229 ; DWARF-FP-ELIM:    .cfi_personality 0, __gxx_personality_v0
    230 ; DWARF-FP-ELIM:    .cfi_lsda 0, .Lexception0
    231 ; DWARF-FP-ELIM:    push {r4, r5, r6, r7, r8, r9, r10, r11, lr}
    232 ; DWARF-FP-ELIM:    .cfi_def_cfa_offset 36
    233 ; DWARF-FP-ELIM:    .cfi_offset lr, -4
    234 ; DWARF-FP-ELIM:    .cfi_offset r11, -8
    235 ; DWARF-FP-ELIM:    .cfi_offset r10, -12
    236 ; DWARF-FP-ELIM:    .cfi_offset r9, -16
    237 ; DWARF-FP-ELIM:    .cfi_offset r8, -20
    238 ; DWARF-FP-ELIM:    .cfi_offset r7, -24
    239 ; DWARF-FP-ELIM:    .cfi_offset r6, -28
    240 ; DWARF-FP-ELIM:    .cfi_offset r5, -32
    241 ; DWARF-FP-ELIM:    .cfi_offset r4, -36
    242 ; DWARF-FP-ELIM:    sub sp, sp, #36
    243 ; DWARF-FP-ELIM:    .cfi_def_cfa_offset 72
    244 ; DWARF-FP-ELIM:    add sp, sp, #36
    245 ; DWARF-FP-ELIM:    pop {r4, r5, r6, r7, r8, r9, r10, r11, lr}
    246 ; DWARF-FP-ELIM:    mov pc, lr
    247 ; DWARF-FP-ELIM:    .cfi_endproc
    248 
    249 ; DWARF-V7-FP-LABEL: _Z4testiiiiiddddd:
    250 ; DWARF-V7-FP:    .cfi_startproc
    251 ; DWARF-V7-FP:    .cfi_personality 0, __gxx_personality_v0
    252 ; DWARF-V7-FP:    .cfi_lsda 0, .Lexception0
    253 ; DWARF-V7-FP:    push {r4, r10, r11, lr}
    254 ; DWARF-V7-FP:    .cfi_def_cfa_offset 16
    255 ; DWARF-V7-FP:    .cfi_offset lr, -4
    256 ; DWARF-V7-FP:    .cfi_offset r11, -8
    257 ; DWARF-V7-FP:    .cfi_offset r10, -12
    258 ; DWARF-V7-FP:    .cfi_offset r4, -16
    259 ; DWARF-V7-FP:    add r11, sp, #8
    260 ; DWARF-V7-FP:    .cfi_def_cfa r11, 8
    261 ; DWARF-V7-FP:    vpush {d8, d9, d10, d11, d12}
    262 ; DWARF-V7-FP:    .cfi_offset d12, -24
    263 ; DWARF-V7-FP:    .cfi_offset d11, -32
    264 ; DWARF-V7-FP:    .cfi_offset d10, -40
    265 ; DWARF-V7-FP:    .cfi_offset d9, -48
    266 ; DWARF-V7-FP:    sub sp, sp, #24
    267 ; DWARF-V7-FP:    sub sp, r11, #48
    268 ; DWARF-V7-FP:    vpop {d8, d9, d10, d11, d12}
    269 ; DWARF-V7-FP:    pop {r4, r10, r11, pc}
    270 ; DWARF-V7-FP:    .cfi_endproc
    271 
    272 ; DWARF-V7-FP-ELIM-LABEL: _Z4testiiiiiddddd:
    273 ; DWARF-V7-FP-ELIM:    .cfi_startproc
    274 ; DWARF-V7-FP-ELIM:    .cfi_personality 0, __gxx_personality_v0
    275 ; DWARF-V7-FP-ELIM:    .cfi_lsda 0, .Lexception0
    276 ; DWARF-V7-FP-ELIM:    push {r4, lr}
    277 ; DWARF-V7-FP-ELIM:    .cfi_def_cfa_offset 8
    278 ; DWARF-V7-FP-ELIM:    .cfi_offset lr, -4
    279 ; DWARF-V7-FP-ELIM:    .cfi_offset r4, -8
    280 ; DWARF-V7-FP-ELIM:    vpush {d8, d9, d10, d11, d12}
    281 ; DWARF-V7-FP-ELIM:    .cfi_offset d12, -16
    282 ; DWARF-V7-FP-ELIM:    .cfi_offset d11, -24
    283 ; DWARF-V7-FP-ELIM:    .cfi_offset d10, -32
    284 ; DWARF-V7-FP-ELIM:    .cfi_offset d9, -40
    285 ; DWARF-V7-FP-ELIM:    sub sp, sp, #24
    286 ; DWARF-V7-FP-ELIM:    .cfi_def_cfa_offset 72
    287 ; DWARF-V7-FP-ELIM:    add sp, sp, #24
    288 ; DWARF-V7-FP-ELIM:    vpop {d8, d9, d10, d11, d12}
    289 ; DWARF-V7-FP-ELIM:    pop {r4, pc}
    290 ; DWARF-V7-FP-ELIM:    .cfi_endproc
    291 
    292 ;-------------------------------------------------------------------------------
    293 ; Test 2
    294 ;-------------------------------------------------------------------------------
    295 
    296 declare void @throw_exception_2()
    297 
    298 define void @test2() {
    299 entry:
    300   call void @throw_exception_2()
    301   ret void
    302 }
    303 
    304 ; CHECK-FP-LABEL: test2:
    305 ; CHECK-FP:   .fnstart
    306 ; CHECK-FP:   .save  {r11, lr}
    307 ; CHECK-FP:   push   {r11, lr}
    308 ; CHECK-FP:   .setfp r11, sp
    309 ; CHECK-FP:   mov    r11, sp
    310 ; CHECK-FP:   pop    {r11, lr}
    311 ; CHECK-FP:   mov    pc, lr
    312 ; CHECK-FP:   .fnend
    313 
    314 ; CHECK-FP-ELIM-LABEL: test2:
    315 ; CHECK-FP-ELIM:   .fnstart
    316 ; CHECK-FP-ELIM:   .save {r11, lr}
    317 ; CHECK-FP-ELIM:   push  {r11, lr}
    318 ; CHECK-FP-ELIM:   pop   {r11, lr}
    319 ; CHECK-FP-ELIM:   mov   pc, lr
    320 ; CHECK-FP-ELIM:   .fnend
    321 
    322 ; CHECK-V7-FP-LABEL: test2:
    323 ; CHECK-V7-FP:   .fnstart
    324 ; CHECK-V7-FP:   .save  {r11, lr}
    325 ; CHECK-V7-FP:   push   {r11, lr}
    326 ; CHECK-V7-FP:   .setfp r11, sp
    327 ; CHECK-V7-FP:   mov    r11, sp
    328 ; CHECK-V7-FP:   pop    {r11, pc}
    329 ; CHECK-V7-FP:   .fnend
    330 
    331 ; CHECK-V7-FP-ELIM-LABEL: test2:
    332 ; CHECK-V7-FP-ELIM:   .fnstart
    333 ; CHECK-V7-FP-ELIM:   .save {r11, lr}
    334 ; CHECK-V7-FP-ELIM:   push  {r11, lr}
    335 ; CHECK-V7-FP-ELIM:   pop   {r11, pc}
    336 ; CHECK-V7-FP-ELIM:   .fnend
    337 
    338 ; DWARF-FP-LABEL: test2:
    339 ; DWARF-FP:    .cfi_startproc
    340 ; DWARF-FP:    push {r11, lr}
    341 ; DWARF-FP:    .cfi_def_cfa_offset 8
    342 ; DWARF-FP:    .cfi_offset lr, -4
    343 ; DWARF-FP:    .cfi_offset r11, -8
    344 ; DWARF-FP:    mov  r11, sp
    345 ; DWARF-FP:    .cfi_def_cfa_register r11
    346 ; DWARF-FP:    pop  {r11, lr}
    347 ; DWARF-FP:    mov  pc, lr
    348 ; DWARF-FP:    .cfi_endproc
    349 
    350 ; DWARF-FP-ELIM-LABEL: test2:
    351 ; DWARF-FP-ELIM:    .cfi_startproc
    352 ; DWARF-FP-ELIM:    push {r11, lr}
    353 ; DWARF-FP-ELIM:    .cfi_def_cfa_offset 8
    354 ; DWARF-FP-ELIM:    .cfi_offset lr, -4
    355 ; DWARF-FP-ELIM:    .cfi_offset r11, -8
    356 ; DWARF-FP-ELIM:    pop  {r11, lr}
    357 ; DWARF-FP-ELIM:    mov  pc, lr
    358 ; DWARF-FP-ELIM:    .cfi_endproc
    359 
    360 ; DWARF-V7-FP-LABEL: test2:
    361 ; DWARF-V7-FP:    .cfi_startproc
    362 ; DWARF-V7-FP:    push {r11, lr}
    363 ; DWARF-V7-FP:    .cfi_def_cfa_offset 8
    364 ; DWARF-V7-FP:    .cfi_offset lr, -4
    365 ; DWARF-V7-FP:    .cfi_offset r11, -8
    366 ; DWARF-V7-FP:    mov  r11, sp
    367 ; DWARF-V7-FP:    .cfi_def_cfa_register r11
    368 ; DWARF-V7-FP:    pop  {r11, pc}
    369 ; DWARF-V7-FP:    .cfi_endproc
    370 
    371 ; DWARF-V7-FP-ELIM-LABEL: test2:
    372 ; DWARF-V7-FP-ELIM:    .cfi_startproc
    373 ; DWARF-V7-FP-ELIM:    push {r11, lr}
    374 ; DWARF-V7-FP-ELIM:    .cfi_def_cfa_offset 8
    375 ; DWARF-V7-FP-ELIM:    .cfi_offset lr, -4
    376 ; DWARF-V7-FP-ELIM:    .cfi_offset r11, -8
    377 ; DWARF-V7-FP-ELIM:    pop  {r11, pc}
    378 ; DWARF-V7-FP-ELIM:    .cfi_endproc
    379 
    380 
    381 ;-------------------------------------------------------------------------------
    382 ; Test 3
    383 ;-------------------------------------------------------------------------------
    384 
    385 declare void @throw_exception_3(i32)
    386 
    387 define i32 @test3(i32 %a, i32 %b, i32 %c, i32 %d,
    388                   i32 %e, i32 %f, i32 %g, i32 %h) {
    389 entry:
    390   %add = add nsw i32 %b, %a
    391   %add1 = add nsw i32 %add, %c
    392   %add2 = add nsw i32 %add1, %d
    393   tail call void @throw_exception_3(i32 %add2)
    394   %add3 = add nsw i32 %f, %e
    395   %add4 = add nsw i32 %add3, %g
    396   %add5 = add nsw i32 %add4, %h
    397   tail call void @throw_exception_3(i32 %add5)
    398   %add6 = add nsw i32 %add5, %add2
    399   ret i32 %add6
    400 }
    401 
    402 ; CHECK-FP-LABEL: test3:
    403 ; CHECK-FP:   .fnstart
    404 ; CHECK-FP:   .save  {r4, r5, r11, lr}
    405 ; CHECK-FP:   push   {r4, r5, r11, lr}
    406 ; CHECK-FP:   .setfp r11, sp, #8
    407 ; CHECK-FP:   add    r11, sp, #8
    408 ; CHECK-FP:   pop    {r4, r5, r11, lr}
    409 ; CHECK-FP:   mov    pc, lr
    410 ; CHECK-FP:   .fnend
    411 
    412 ; CHECK-FP-ELIM-LABEL: test3:
    413 ; CHECK-FP-ELIM:   .fnstart
    414 ; CHECK-FP-ELIM:   .save {r4, r5, r11, lr}
    415 ; CHECK-FP-ELIM:   push  {r4, r5, r11, lr}
    416 ; CHECK-FP-ELIM:   pop   {r4, r5, r11, lr}
    417 ; CHECK-FP-ELIM:   mov   pc, lr
    418 ; CHECK-FP-ELIM:   .fnend
    419 
    420 ; CHECK-V7-FP-LABEL: test3:
    421 ; CHECK-V7-FP:   .fnstart
    422 ; CHECK-V7-FP:   .save  {r4, r5, r11, lr}
    423 ; CHECK-V7-FP:   push   {r4, r5, r11, lr}
    424 ; CHECK-V7-FP:   .setfp r11, sp, #8
    425 ; CHECK-V7-FP:   add    r11, sp, #8
    426 ; CHECK-V7-FP:   pop    {r4, r5, r11, pc}
    427 ; CHECK-V7-FP:   .fnend
    428 
    429 ; CHECK-V7-FP-ELIM-LABEL: test3:
    430 ; CHECK-V7-FP-ELIM:   .fnstart
    431 ; CHECK-V7-FP-ELIM:   .save {r4, r5, r11, lr}
    432 ; CHECK-V7-FP-ELIM:   push  {r4, r5, r11, lr}
    433 ; CHECK-V7-FP-ELIM:   pop   {r4, r5, r11, pc}
    434 ; CHECK-V7-FP-ELIM:   .fnend
    435 
    436 ; DWARF-FP-LABEL: test3:
    437 ; DWARF-FP:    .cfi_startproc
    438 ; DWARF-FP:    push {r4, r5, r11, lr}
    439 ; DWARF-FP:    .cfi_def_cfa_offset 16
    440 ; DWARF-FP:    .cfi_offset lr, -4
    441 ; DWARF-FP:    .cfi_offset r11, -8
    442 ; DWARF-FP:    .cfi_offset r5, -12
    443 ; DWARF-FP:    .cfi_offset r4, -16
    444 ; DWARF-FP:    add  r11, sp, #8
    445 ; DWARF-FP:    .cfi_def_cfa r11, 8
    446 ; DWARF-FP:    pop  {r4, r5, r11, lr}
    447 ; DWARF-FP:    mov  pc, lr
    448 ; DWARF-FP:    .cfi_endproc
    449 
    450 ; DWARF-FP-ELIM-LABEL: test3:
    451 ; DWARF-FP-ELIM:    .cfi_startproc
    452 ; DWARF-FP-ELIM:    push {r4, r5, r11, lr}
    453 ; DWARF-FP-ELIM:    .cfi_def_cfa_offset 16
    454 ; DWARF-FP-ELIM:    .cfi_offset lr, -4
    455 ; DWARF-FP-ELIM:    .cfi_offset r11, -8
    456 ; DWARF-FP-ELIM:    .cfi_offset r5, -12
    457 ; DWARF-FP-ELIM:    .cfi_offset r4, -16
    458 ; DWARF-FP-ELIM:    pop  {r4, r5, r11, lr}
    459 ; DWARF-FP-ELIM:    mov  pc, lr
    460 ; DWARF-FP-ELIM:    .cfi_endproc
    461 
    462 ; DWARF-V7-FP-LABEL: test3:
    463 ; DWARF-V7-FP:    .cfi_startproc
    464 ; DWARF-V7-FP:    push {r4, r5, r11, lr}
    465 ; DWARF-V7-FP:    .cfi_def_cfa_offset 16
    466 ; DWARF-V7-FP:    .cfi_offset lr, -4
    467 ; DWARF-V7-FP:    .cfi_offset r11, -8
    468 ; DWARF-V7-FP:    .cfi_offset r5, -12
    469 ; DWARF-V7-FP:    .cfi_offset r4, -16
    470 ; DWARF-V7-FP:    add  r11, sp, #8
    471 ; DWARF-V7-FP:    .cfi_def_cfa r11, 8
    472 ; DWARF-V7-FP:    pop  {r4, r5, r11, pc}
    473 ; DWARF-V7-FP:    .cfi_endproc
    474 
    475 ; DWARF-V7-FP-ELIM-LABEL: test3:
    476 ; DWARF-V7-FP-ELIM:    .cfi_startproc
    477 ; DWARF-V7-FP-ELIM:    push {r4, r5, r11, lr}
    478 ; DWARF-V7-FP-ELIM:    .cfi_def_cfa_offset 16
    479 ; DWARF-V7-FP-ELIM:    .cfi_offset lr, -4
    480 ; DWARF-V7-FP-ELIM:    .cfi_offset r11, -8
    481 ; DWARF-V7-FP-ELIM:    .cfi_offset r5, -12
    482 ; DWARF-V7-FP-ELIM:    .cfi_offset r4, -16
    483 ; DWARF-V7-FP-ELIM:    pop  {r4, r5, r11, pc}
    484 ; DWARF-V7-FP-ELIM:    .cfi_endproc
    485 
    486 
    487 ;-------------------------------------------------------------------------------
    488 ; Test 4
    489 ;-------------------------------------------------------------------------------
    490 
    491 define void @test4() nounwind {
    492 entry:
    493   ret void
    494 }
    495 
    496 ; CHECK-FP-LABEL: test4:
    497 ; CHECK-FP:   .fnstart
    498 ; CHECK-FP:   mov pc, lr
    499 ; CHECK-FP:   .cantunwind
    500 ; CHECK-FP:   .fnend
    501 
    502 ; CHECK-FP-ELIM-LABEL: test4:
    503 ; CHECK-FP-ELIM:   .fnstart
    504 ; CHECK-FP-ELIM:   mov pc, lr
    505 ; CHECK-FP-ELIM:   .cantunwind
    506 ; CHECK-FP-ELIM:   .fnend
    507 
    508 ; CHECK-V7-FP-LABEL: test4:
    509 ; CHECK-V7-FP:   .fnstart
    510 ; CHECK-V7-FP:   bx lr
    511 ; CHECK-V7-FP:   .cantunwind
    512 ; CHECK-V7-FP:   .fnend
    513 
    514 ; CHECK-V7-FP-ELIM-LABEL: test4:
    515 ; CHECK-V7-FP-ELIM:   .fnstart
    516 ; CHECK-V7-FP-ELIM:   bx lr
    517 ; CHECK-V7-FP-ELIM:   .cantunwind
    518 ; CHECK-V7-FP-ELIM:   .fnend
    519 
    520 ; DWARF-FP-LABEL: test4:
    521 ; DWARF-FP-NOT: .cfi_startproc
    522 ; DWARF-FP:    mov pc, lr
    523 ; DWARF-FP-NOT: .cfi_endproc
    524 ; DWARF-FP:    .size test4,
    525 
    526 ; DWARF-FP-ELIM-LABEL: test4:
    527 ; DWARF-FP-ELIM-NOT: .cfi_startproc
    528 ; DWARF-FP-ELIM:     mov pc, lr
    529 ; DWARF-FP-ELIM-NOT: .cfi_endproc
    530 ; DWARF-FP-ELIM:     .size test4,
    531 
    532 ; DWARF-V7-FP-LABEL: test4:
    533 ; DWARF-V7-FP-NOT: .cfi_startproc
    534 ; DWARF-V7-FP:    bx lr
    535 ; DWARF-V7-FP-NOT: .cfi_endproc
    536 ; DWARF-V7-FP:    .size test4,
    537 
    538 ; DWARF-V7-FP-ELIM-LABEL: test4:
    539 ; DWARF-V7-FP-ELIM-NOT: .cfi_startproc
    540 ; DWARF-V7-FP-ELIM:     bx lr
    541 ; DWARF-V7-FP-ELIM-NOT: .cfi_endproc
    542 ; DWARF-V7-FP-ELIM:     .size test4,
    543