Home | History | Annotate | Download | only in ARM
      1 ; ARM EHABI integrated test
      2 
      3 ; This test case checks whether the ARM DWARF stack frame directives
      4 ; are properly generated or not.
      5 
      6 ; We have to check several cases:
      7 ; (1) arm with -disable-fp-elim
      8 ; (2) arm without -disable-fp-elim
      9 ; (3) armv7 with -disable-fp-elim
     10 ; (4) armv7 without -disable-fp-elim
     11 ; (5) thumb with -disable-fp-elim
     12 ; (6) thumb without -disable-fp-elim
     13 ; (7) thumbv7 with -disable-fp-elim
     14 ; (8) thumbv7 without -disable-fp-elim
     15 ; (9) thumbv7 with -no-integrated-as
     16 
     17 ; RUN: llc -mtriple arm-unknown-linux-gnueabi \
     18 ; RUN:     -disable-fp-elim -filetype=asm -o - %s \
     19 ; RUN:   | FileCheck %s --check-prefix=CHECK-FP
     20 
     21 ; RUN: llc -mtriple arm-unknown-linux-gnueabi \
     22 ; RUN:     -filetype=asm -o - %s \
     23 ; RUN:   | FileCheck %s --check-prefix=CHECK-FP-ELIM
     24 
     25 ; RUN: llc -mtriple armv7-unknown-linux-gnueabi \
     26 ; RUN:     -disable-fp-elim -filetype=asm -o - %s \
     27 ; RUN:   | FileCheck %s --check-prefix=CHECK-V7-FP
     28 
     29 ; RUN: llc -mtriple armv7-unknown-linux-gnueabi \
     30 ; RUN:     -filetype=asm -o - %s \
     31 ; RUN:   | FileCheck %s --check-prefix=CHECK-V7-FP-ELIM
     32 
     33 ; RUN: llc -mtriple thumb-unknown-linux-gnueabi \
     34 ; RUN:     -disable-fp-elim -filetype=asm -o - %s \
     35 ; RUN:   | FileCheck %s --check-prefix=CHECK-THUMB-FP
     36 
     37 ; RUN: llc -mtriple thumb-unknown-linux-gnueabi \
     38 ; RUN:     -filetype=asm -o - %s \
     39 ; RUN:   | FileCheck %s --check-prefix=CHECK-THUMB-FP-ELIM
     40 
     41 ; RUN: llc -mtriple thumbv7-unknown-linux-gnueabi \
     42 ; RUN:     -disable-fp-elim -filetype=asm -o - %s \
     43 ; RUN:   | FileCheck %s --check-prefix=CHECK-THUMB-V7-FP
     44 
     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
     48 
     49 ; RUN: llc -mtriple thumbv7-unknown-linux-gnueabi \
     50 ; RUN:     -disable-fp-elim -no-integrated-as -filetype=asm -o - %s \
     51 ; RUN:   | FileCheck %s --check-prefix=CHECK-THUMB-V7-FP-NOIAS
     52 
     53 ;-------------------------------------------------------------------------------
     54 ; Test 1
     55 ;-------------------------------------------------------------------------------
     56 ; This is the LLVM assembly generated from following C++ code:
     57 ;
     58 ;   extern void print(int, int, int, int, int);
     59 ;   extern void print(double, double, double, double, double);
     60 ;
     61 ;   void test(int a, int b, int c, int d, int e,
     62 ;             double m, double n, double p, double q, double r) {
     63 ;     try {
     64 ;       print(a, b, c, d, e);
     65 ;     } catch (...) {
     66 ;       print(m, n, p, q, r);
     67 ;     }
     68 ;   }
     69 
     70 declare void @_Z5printiiiii(i32, i32, i32, i32, i32)
     71 
     72 declare void @_Z5printddddd(double, double, double, double, double)
     73 
     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) {
     77 entry:
     78   invoke void @_Z5printiiiii(i32 %a, i32 %b, i32 %c, i32 %d, i32 %e)
     79           to label %try.cont unwind label %lpad
     80 
     81 lpad:
     82   %0 = landingpad { i8*, i32 }
     83           personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*)
     84           catch i8* null
     85   %1 = extractvalue { i8*, i32 } %0, 0
     86   %2 = tail call i8* @__cxa_begin_catch(i8* %1)
     87   invoke void @_Z5printddddd(double %m, double %n, double %p,
     88                              double %q, double %r)
     89           to label %invoke.cont2 unwind label %lpad1
     90 
     91 invoke.cont2:
     92   tail call void @__cxa_end_catch()
     93   br label %try.cont
     94 
     95 try.cont:
     96   ret void
     97 
     98 lpad1:
     99   %3 = landingpad { i8*, i32 }
    100           personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*)
    101           cleanup
    102   invoke void @__cxa_end_catch()
    103           to label %eh.resume unwind label %terminate.lpad
    104 
    105 eh.resume:
    106   resume { i8*, i32 } %3
    107 
    108 terminate.lpad:
    109   %4 = landingpad { i8*, i32 }
    110           personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*)
    111           catch i8* null
    112   %5 = extractvalue { i8*, i32 } %4, 0
    113   tail call void @__clang_call_terminate(i8* %5)
    114   unreachable
    115 }
    116 
    117 declare void @__clang_call_terminate(i8*)
    118 
    119 declare i32 @__gxx_personality_v0(...)
    120 
    121 declare i8* @__cxa_begin_catch(i8*)
    122 
    123 declare void @__cxa_end_catch()
    124 
    125 declare void @_ZSt9terminatev()
    126 
    127 !llvm.dbg.cu = !{!0}
    128 !llvm.module.flags = !{!10, !11}
    129 !llvm.ident = !{!12}
    130 
    131 !0 = metadata !{i32 786449, metadata !1, i32 4, metadata !"clang version 3.5 ", i1 false, metadata !"", i32 0, metadata !2, metadata !2, metadata !3, metadata !2, metadata !2, metadata !""} ; [ DW_TAG_compile_unit ] [/tmp/exp.cpp] [DW_LANG_C_plus_plus]
    132 !1 = metadata !{metadata !"exp.cpp", metadata !"/tmp"}
    133 !2 = metadata !{}
    134 !3 = metadata !{metadata !4}
    135 !4 = metadata !{i32 786478, metadata !1, metadata !5, metadata !"test", metadata !"test", metadata !"_Z4testiiiiiddddd", i32 4, metadata !6, i1 false, i1 true, i32 0, i32 0, null, i32 256, i1 false, void (i32, i32, i32, i32, i32, double, double, double, double, double)* @_Z4testiiiiiddddd, null, null, metadata !2, i32 5} ; [ DW_TAG_subprogram ] [line 4] [def] [scope 5] [test]
    136 !5 = metadata !{i32 786473, metadata !1}          ; [ DW_TAG_file_type ] [/tmp/exp.cpp]
    137 !6 = metadata !{i32 786453, i32 0, null, metadata !"", i32 0, i64 0, i64 0, i64 0, i32 0, null, metadata !7, i32 0, null, null, null} ; [ DW_TAG_subroutine_type ] [line 0, size 0, align 0, offset 0] [from ]
    138 !7 = metadata !{null, metadata !8, metadata !8, metadata !8, metadata !8, metadata !8, metadata !9, metadata !9, metadata !9, metadata !9, metadata !9}
    139 !8 = metadata !{i32 786468, null, null, metadata !"int", i32 0, i64 32, i64 32, i64 0, i32 0, i32 5} ; [ DW_TAG_base_type ] [int] [line 0, size 32, align 32, offset 0, enc DW_ATE_signed]
    140 !9 = metadata !{i32 786468, null, null, metadata !"double", i32 0, i64 64, i64 64, i64 0, i32 0, i32 4} ; [ DW_TAG_base_type ] [double] [line 0, size 64, align 64, offset 0, enc DW_ATE_float]
    141 !10 = metadata !{i32 2, metadata !"Dwarf Version", i32 4}
    142 !11 = metadata !{i32 1, metadata !"Debug Info Version", i32 1}
    143 !12 = metadata !{metadata !"clang version 3.5 "}
    144 !13 = metadata !{i32 786689, metadata !4, metadata !"a", metadata !5, i32 16777220, metadata !8, i32 0, i32 0} ; [ DW_TAG_arg_variable ] [a] [line 4]
    145 !14 = metadata !{i32 4, i32 0, metadata !4, null}
    146 !15 = metadata !{i32 786689, metadata !4, metadata !"b", metadata !5, i32 33554436, metadata !8, i32 0, i32 0} ; [ DW_TAG_arg_variable ] [b] [line 4]
    147 !16 = metadata !{i32 786689, metadata !4, metadata !"c", metadata !5, i32 50331652, metadata !8, i32 0, i32 0} ; [ DW_TAG_arg_variable ] [c] [line 4]
    148 !17 = metadata !{i32 786689, metadata !4, metadata !"d", metadata !5, i32 67108868, metadata !8, i32 0, i32 0} ; [ DW_TAG_arg_variable ] [d] [line 4]
    149 !18 = metadata !{i32 786689, metadata !4, metadata !"e", metadata !5, i32 83886084, metadata !8, i32 0, i32 0} ; [ DW_TAG_arg_variable ] [e] [line 4]
    150 !19 = metadata !{i32 786689, metadata !4, metadata !"m", metadata !5, i32 100663301, metadata !9, i32 0, i32 0} ; [ DW_TAG_arg_variable ] [m] [line 5]
    151 !20 = metadata !{i32 5, i32 0, metadata !4, null}
    152 !21 = metadata !{i32 786689, metadata !4, metadata !"n", metadata !5, i32 117440517, metadata !9, i32 0, i32 0} ; [ DW_TAG_arg_variable ] [n] [line 5]
    153 !22 = metadata !{i32 786689, metadata !4, metadata !"p", metadata !5, i32 134217733, metadata !9, i32 0, i32 0} ; [ DW_TAG_arg_variable ] [p] [line 5]
    154 !23 = metadata !{i32 786689, metadata !4, metadata !"q", metadata !5, i32 150994949, metadata !9, i32 0, i32 0} ; [ DW_TAG_arg_variable ] [q] [line 5]
    155 !24 = metadata !{i32 786689, metadata !4, metadata !"r", metadata !5, i32 167772165, metadata !9, i32 0, i32 0} ; [ DW_TAG_arg_variable ] [r] [line 5]
    156 !25 = metadata !{i32 7, i32 0, metadata !26, null}
    157 !26 = metadata !{i32 786443, metadata !1, metadata !4, i32 6, i32 0, i32 0} ; [ DW_TAG_lexical_block ] [/tmp/exp.cpp]
    158 !27 = metadata !{i32 8, i32 0, metadata !26, null} ; [ DW_TAG_imported_declaration ]
    159 !28 = metadata !{i32 11, i32 0, metadata !26, null}
    160 !29 = metadata !{i32 9, i32 0, metadata !30, null}
    161 !30 = metadata !{i32 786443, metadata !1, metadata !4, i32 8, i32 0, i32 1} ; [ DW_TAG_lexical_block ] [/tmp/exp.cpp]
    162 !31 = metadata !{i32 10, i32 0, metadata !30, null}
    163 !32 = metadata !{i32 10, i32 0, metadata !4, null}
    164 !33 = metadata !{i32 11, i32 0, metadata !4, null}
    165 !34 = metadata !{i32 11, i32 0, metadata !30, null}
    166 
    167 ; CHECK-FP-LABEL: _Z4testiiiiiddddd:
    168 ; CHECK-FP:   .cfi_startproc
    169 ; CHECK-FP:   push   {r4, r5, r6, r7, r8, r9, r10, r11, lr}
    170 ; CHECK-FP:   .cfi_def_cfa_offset 36
    171 ; CHECK-FP:   .cfi_offset lr, -4
    172 ; CHECK-FP:   .cfi_offset r11, -8
    173 ; CHECK-FP:   .cfi_offset r10, -12
    174 ; CHECK-FP:   .cfi_offset r9, -16
    175 ; CHECK-FP:   .cfi_offset r8, -20
    176 ; CHECK-FP:   .cfi_offset r7, -24
    177 ; CHECK-FP:   .cfi_offset r6, -28
    178 ; CHECK-FP:   .cfi_offset r5, -32
    179 ; CHECK-FP:   .cfi_offset r4, -36
    180 ; CHECK-FP:   add    r11, sp, #28
    181 ; CHECK-FP:   .cfi_def_cfa r11, 8
    182 ; CHECK-FP:   sub    sp, sp, #28
    183 ; CHECK-FP:   .cfi_endproc
    184 
    185 ; CHECK-FP-ELIM-LABEL: _Z4testiiiiiddddd:
    186 ; CHECK-FP-ELIM:   .cfi_startproc
    187 ; CHECK-FP-ELIM:   push  {r4, r5, r6, r7, r8, r9, r10, r11, lr}
    188 ; CHECK-FP-ELIM:   .cfi_def_cfa_offset 36
    189 ; CHECK-FP-ELIM:   .cfi_offset lr, -4
    190 ; CHECK-FP-ELIM:   .cfi_offset r11, -8
    191 ; CHECK-FP-ELIM:   .cfi_offset r10, -12
    192 ; CHECK-FP-ELIM:   .cfi_offset r9, -16
    193 ; CHECK-FP-ELIM:   .cfi_offset r8, -20
    194 ; CHECK-FP-ELIM:   .cfi_offset r7, -24
    195 ; CHECK-FP-ELIM:   .cfi_offset r6, -28
    196 ; CHECK-FP-ELIM:   .cfi_offset r5, -32
    197 ; CHECK-FP-ELIM:   .cfi_offset r4, -36
    198 ; CHECK-FP-ELIM:   sub   sp, sp, #28
    199 ; CHECK-FP-ELIM:   .cfi_def_cfa_offset 64
    200 ; CHECK-FP-ELIM:   .cfi_endproc
    201 
    202 ; CHECK-V7-FP-LABEL: _Z4testiiiiiddddd:
    203 ; CHECK-V7-FP:   .cfi_startproc
    204 ; CHECK-V7-FP:   push   {r4, r10, r11, lr}
    205 ; CHECK-V7-FP:   .cfi_def_cfa_offset 16
    206 ; CHECK-V7-FP:   .cfi_offset lr, -4
    207 ; CHECK-V7-FP:   .cfi_offset r11, -8
    208 ; CHECK-V7-FP:   .cfi_offset r10, -12
    209 ; CHECK-V7-FP:   .cfi_offset r4, -16
    210 ; CHECK-V7-FP:   add    r11, sp, #8
    211 ; CHECK-V7-FP:   .cfi_def_cfa r11, 8
    212 ; CHECK-V7-FP:   vpush  {d8, d9, d10, d11, d12}
    213 ; CHECK-V7-FP:   .cfi_offset d12, -24
    214 ; CHECK-V7-FP:   .cfi_offset d11, -32
    215 ; CHECK-V7-FP:   .cfi_offset d10, -40
    216 ; CHECK-V7-FP:   .cfi_offset d9, -48
    217 ; CHECK-V7-FP:   .cfi_offset d8, -56
    218 ; CHECK-V7-FP:   sub    sp, sp, #24
    219 ; CHECK-V7-FP:   .cfi_endproc
    220 
    221 ; CHECK-V7-FP-ELIM-LABEL: _Z4testiiiiiddddd:
    222 ; CHECK-V7-FP-ELIM:   .cfi_startproc
    223 ; CHECK-V7-FP-ELIM:   push   {r4, lr}
    224 ; CHECK-V7-FP-ELIM:   .cfi_def_cfa_offset 8
    225 ; CHECK-V7-FP-ELIM:   .cfi_offset lr, -4
    226 ; CHECK-V7-FP-ELIM:   .cfi_offset r4, -8
    227 ; CHECK-V7-FP-ELIM:   vpush  {d8, d9, d10, d11, d12}
    228 ; CHECK-V7-FP-ELIM:   .cfi_def_cfa_offset 48
    229 ; CHECK-V7-FP-ELIM:   .cfi_offset d12, -16
    230 ; CHECK-V7-FP-ELIM:   .cfi_offset d11, -24
    231 ; CHECK-V7-FP-ELIM:   .cfi_offset d10, -32
    232 ; CHECK-V7-FP-ELIM:   .cfi_offset d9, -40
    233 ; CHECK-V7-FP-ELIM:   .cfi_offset d8, -48
    234 ; CHECK-V7-FP-ELIM:   sub    sp, sp, #24
    235 ; CHECK-V7-FP-ELIM:   .cfi_def_cfa_offset 72
    236 ; CHECK-V7-FP-ELIM:   .cfi_endproc
    237 
    238 ; CHECK-THUMB-FP-LABEL: _Z4testiiiiiddddd:
    239 ; CHECK-THUMB-FP:   .cfi_startproc
    240 ; CHECK-THUMB-FP:   push   {r4, r5, r6, r7, lr}
    241 ; CHECK-THUMB-FP:   .cfi_def_cfa_offset 20
    242 ; CHECK-THUMB-FP:   .cfi_offset lr, -4
    243 ; CHECK-THUMB-FP:   .cfi_offset r7, -8
    244 ; CHECK-THUMB-FP:   .cfi_offset r6, -12
    245 ; CHECK-THUMB-FP:   .cfi_offset r5, -16
    246 ; CHECK-THUMB-FP:   .cfi_offset r4, -20
    247 ; CHECK-THUMB-FP:   add    r7, sp, #12
    248 ; CHECK-THUMB-FP:   .cfi_def_cfa r7, 8
    249 ; CHECK-THUMB-FP:   sub    sp, #60
    250 ; CHECK-THUMB-FP:   .cfi_endproc
    251 
    252 ; CHECK-THUMB-FP-ELIM-LABEL: _Z4testiiiiiddddd:
    253 ; CHECK-THUMB-FP-ELIM:   .cfi_startproc
    254 ; CHECK-THUMB-FP-ELIM:   push   {r4, r5, r6, r7, lr}
    255 ; CHECK-THUMB-FP-ELIM:   .cfi_def_cfa_offset 20
    256 ; CHECK-THUMB-FP-ELIM:   .cfi_offset lr, -4
    257 ; CHECK-THUMB-FP-ELIM:   .cfi_offset r7, -8
    258 ; CHECK-THUMB-FP-ELIM:   .cfi_offset r6, -12
    259 ; CHECK-THUMB-FP-ELIM:   .cfi_offset r5, -16
    260 ; CHECK-THUMB-FP-ELIM:   .cfi_offset r4, -20
    261 ; CHECK-THUMB-FP-ELIM:   sub    sp, #60
    262 ; CHECK-THUMB-FP-ELIM:   .cfi_def_cfa_offset 80
    263 ; CHECK-THUMB-FP-ELIM:   .cfi_endproc
    264 
    265 ; CHECK-THUMB-V7-FP-LABEL: _Z4testiiiiiddddd:
    266 ; CHECK-THUMB-V7-FP:   .cfi_startproc
    267 ; CHECK-THUMB-V7-FP:   push.w   {r4, r7, r11, lr}
    268 ; CHECK-THUMB-V7-FP:   .cfi_def_cfa_offset 16
    269 ; CHECK-THUMB-V7-FP:   .cfi_offset lr, -4
    270 ; CHECK-THUMB-V7-FP:   .cfi_offset r11, -8
    271 ; CHECK-THUMB-V7-FP:   .cfi_offset r7, -12
    272 ; CHECK-THUMB-V7-FP:   .cfi_offset r4, -16
    273 ; CHECK-THUMB-V7-FP:   add    r7, sp, #4
    274 ; CHECK-THUMB-V7-FP:   .cfi_def_cfa r7, 12
    275 ; CHECK-THUMB-V7-FP:   vpush  {d8, d9, d10, d11, d12}
    276 ; CHECK-THUMB-V7-FP:   .cfi_offset d12, -24
    277 ; CHECK-THUMB-V7-FP:   .cfi_offset d11, -32
    278 ; CHECK-THUMB-V7-FP:   .cfi_offset d10, -40
    279 ; CHECK-THUMB-V7-FP:   .cfi_offset d9, -48
    280 ; CHECK-THUMB-V7-FP:   .cfi_offset d8, -56
    281 ; CHECK-THUMB-V7-FP:   sub    sp, #24
    282 ; CHECK-THUMB-V7-FP:   .cfi_endproc
    283 
    284 ; CHECK-THUMB-V7-FP-ELIM-LABEL: _Z4testiiiiiddddd:
    285 ; CHECK-THUMB-V7-FP-ELIM:   .cfi_startproc
    286 ; CHECK-THUMB-V7-FP-ELIM:   push   {r4, lr}
    287 ; CHECK-THUMB-V7-FP-ELIM:   .cfi_def_cfa_offset 8
    288 ; CHECK-THUMB-V7-FP-ELIM:   .cfi_offset lr, -4
    289 ; CHECK-THUMB-V7-FP-ELIM:   .cfi_offset r4, -8
    290 ; CHECK-THUMB-V7-FP-ELIM:   vpush  {d8, d9, d10, d11, d12}
    291 ; CHECK-THUMB-V7-FP-ELIM:   .cfi_def_cfa_offset 48
    292 ; CHECK-THUMB-V7-FP-ELIM:   .cfi_offset d12, -16
    293 ; CHECK-THUMB-V7-FP-ELIM:   .cfi_offset d11, -24
    294 ; CHECK-THUMB-V7-FP-ELIM:   .cfi_offset d10, -32
    295 ; CHECK-THUMB-V7-FP-ELIM:   .cfi_offset d9, -40
    296 ; CHECK-THUMB-V7-FP-ELIM:   .cfi_offset d8, -48
    297 ; CHECK-THUMB-V7-FP-ELIM:   sub    sp, #24
    298 ; CHECK-THUMB-V7-FP-ELIM:   .cfi_def_cfa_offset 72
    299 ; CHECK-THUMB-V7-FP-ELIM:   .cfi_endproc
    300 
    301 ; CHECK-THUMB-V7-FP-NOIAS-LABEL: _Z4testiiiiiddddd:
    302 ; CHECK-THUMB-V7-FP-NOIAS:   .cfi_startproc
    303 ; CHECK-THUMB-V7-FP-NOIAS:   push.w   {r4, r7, r11, lr}
    304 ; CHECK-THUMB-V7-FP-NOIAS:   .cfi_def_cfa_offset 16
    305 ; CHECK-THUMB-V7-FP-NOIAS:   .cfi_offset 14, -4
    306 ; CHECK-THUMB-V7-FP-NOIAS:   .cfi_offset 11, -8
    307 ; CHECK-THUMB-V7-FP-NOIAS:   .cfi_offset 7, -12
    308 ; CHECK-THUMB-V7-FP-NOIAS:   .cfi_offset 4, -16
    309 ; CHECK-THUMB-V7-FP-NOIAS:   add    r7, sp, #4
    310 ; CHECK-THUMB-V7-FP-NOIAS:   .cfi_def_cfa 7, 12
    311 ; CHECK-THUMB-V7-FP-NOIAS:   vpush  {d8, d9, d10, d11, d12}
    312 ; CHECK-THUMB-V7-FP-NOIAS:   .cfi_offset 268, -24
    313 ; CHECK-THUMB-V7-FP-NOIAS:   .cfi_offset 267, -32
    314 ; CHECK-THUMB-V7-FP-NOIAS:   .cfi_offset 266, -40
    315 ; CHECK-THUMB-V7-FP-NOIAS:   .cfi_offset 265, -48
    316 ; CHECK-THUMB-V7-FP-NOIAS:   .cfi_offset 264, -56
    317 ; CHECK-THUMB-V7-FP-NOIAS:   sub    sp, #24
    318 ; CHECK-THUMB-V7-FP-NOIAS:   .cfi_endproc
    319 
    320 ;-------------------------------------------------------------------------------
    321 ; Test 2
    322 ;-------------------------------------------------------------------------------
    323 
    324 declare void @throw_exception_2()
    325 
    326 define void @test2() {
    327 entry:
    328   call void @throw_exception_2()
    329   ret void
    330 }
    331 
    332 ; CHECK-FP-LABEL: test2:
    333 ; CHECK-FP:   .cfi_startproc
    334 ; CHECK-FP:   push   {r11, lr}
    335 ; CHECK-FP:   .cfi_def_cfa_offset 8
    336 ; CHECK-FP:   .cfi_offset lr, -4
    337 ; CHECK-FP:   .cfi_offset r11, -8
    338 ; CHECK-FP:   mov    r11, sp
    339 ; CHECK-FP:   .cfi_def_cfa_register r11
    340 ; CHECK-FP:   pop    {r11, lr}
    341 ; CHECK-FP:   mov    pc, lr
    342 ; CHECK-FP:   .cfi_endproc
    343 
    344 ; CHECK-FP-ELIM-LABEL: test2:
    345 ; CHECK-FP-ELIM:   .cfi_startproc
    346 ; CHECK-FP-ELIM:   push  {r11, lr}
    347 ; CHECK-FP-ELIM:   .cfi_def_cfa_offset 8
    348 ; CHECK-FP-ELIM:   .cfi_offset lr, -4
    349 ; CHECK-FP-ELIM:   .cfi_offset r11, -8
    350 ; CHECK-FP-ELIM:   pop   {r11, lr}
    351 ; CHECK-FP-ELIM:   mov   pc, lr
    352 ; CHECK-FP-ELIM:   .cfi_endproc
    353 
    354 ; CHECK-V7-FP-LABEL: test2:
    355 ; CHECK-V7-FP:   .cfi_startproc
    356 ; CHECK-V7-FP:   push   {r11, lr}
    357 ; CHECK-V7-FP:   .cfi_def_cfa_offset 8
    358 ; CHECK-V7-FP:   .cfi_offset lr, -4
    359 ; CHECK-V7-FP:   .cfi_offset r11, -8
    360 ; CHECK-V7-FP:   mov    r11, sp
    361 ; CHECK-V7-FP:   .cfi_def_cfa_register r11
    362 ; CHECK-V7-FP:   pop    {r11, pc}
    363 ; CHECK-V7-FP:   .cfi_endproc
    364 
    365 ; CHECK-V7-FP-ELIM-LABEL: test2:
    366 ; CHECK-V7-FP-ELIM:   .cfi_startproc
    367 ; CHECK-V7-FP-ELIM:   push  {r11, lr}
    368 ; CHECK-V7-FP-ELIM:   .cfi_def_cfa_offset 8
    369 ; CHECK-V7-FP-ELIM:   .cfi_offset lr, -4
    370 ; CHECK-V7-FP-ELIM:   .cfi_offset r11, -8
    371 ; CHECK-V7-FP-ELIM:   pop   {r11, pc}
    372 ; CHECK-V7-FP-ELIM:   .cfi_endproc
    373 
    374 ; CHECK-THUMB-FP-LABEL: test2:
    375 ; CHECK-THUMB-FP:   .cfi_startproc
    376 ; CHECK-THUMB-FP:   push   {r7, lr}
    377 ; CHECK-THUMB-FP:   .cfi_def_cfa_offset 8
    378 ; CHECK-THUMB-FP:   .cfi_offset lr, -4
    379 ; CHECK-THUMB-FP:   .cfi_offset r7, -8
    380 ; CHECK-THUMB-FP:   add    r7, sp, #0
    381 ; CHECK-THUMB-FP:   .cfi_def_cfa_register r7
    382 ; CHECK-THUMB-FP:   pop    {r7, pc}
    383 ; CHECK-THUMB-FP:   .cfi_endproc
    384 
    385 ; CHECK-THUMB-FP-ELIM-LABEL: test2:
    386 ; CHECK-THUMB-FP-ELIM:   .cfi_startproc
    387 ; CHECK-THUMB-FP-ELIM:   push  {r7, lr}
    388 ; CHECK-THUMB-FP-ELIM:   .cfi_def_cfa_offset 8
    389 ; CHECK-THUMB-FP-ELIM:   .cfi_offset lr, -4
    390 ; CHECK-THUMB-FP-ELIM:   .cfi_offset r7, -8
    391 ; CHECK-THUMB-FP-ELIM:   pop   {r7, pc}
    392 ; CHECK-THUMB-FP-ELIM:   .cfi_endproc
    393 
    394 ; CHECK-THUMB-V7-FP-LABEL: test2:
    395 ; CHECK-THUMB-V7-FP:   .cfi_startproc
    396 ; CHECK-THUMB-V7-FP:   push   {r7, lr}
    397 ; CHECK-THUMB-V7-FP:   .cfi_def_cfa_offset 8
    398 ; CHECK-THUMB-V7-FP:   .cfi_offset lr, -4
    399 ; CHECK-THUMB-V7-FP:   .cfi_offset r7, -8
    400 ; CHECK-THUMB-V7-FP:   mov    r7, sp
    401 ; CHECK-THUMB-V7-FP:   .cfi_def_cfa_register r7
    402 ; CHECK-THUMB-V7-FP:   pop    {r7, pc}
    403 ; CHECK-THUMB-V7-FP:   .cfi_endproc
    404 
    405 ; CHECK-THUMB-V7-FP-ELIM-LABEL: test2:
    406 ; CHECK-THUMB-V7-FP-ELIM:   .cfi_startproc
    407 ; CHECK-THUMB-V7-FP-ELIM:   push.w  {r11, lr}
    408 ; CHECK-THUMB-V7-FP-ELIM:   .cfi_def_cfa_offset 8
    409 ; CHECK-THUMB-V7-FP-ELIM:   .cfi_offset lr, -4
    410 ; CHECK-THUMB-V7-FP-ELIM:   .cfi_offset r11, -8
    411 ; CHECK-THUMB-V7-FP-ELIM:   pop.w   {r11, pc}
    412 ; CHECK-THUMB-V7-FP-ELIM:   .cfi_endproc
    413 
    414 
    415 ;-------------------------------------------------------------------------------
    416 ; Test 3
    417 ;-------------------------------------------------------------------------------
    418 
    419 declare void @throw_exception_3(i32)
    420 
    421 define i32 @test3(i32 %a, i32 %b, i32 %c, i32 %d,
    422                   i32 %e, i32 %f, i32 %g, i32 %h) {
    423 entry:
    424   %add = add nsw i32 %b, %a
    425   %add1 = add nsw i32 %add, %c
    426   %add2 = add nsw i32 %add1, %d
    427   tail call void @throw_exception_3(i32 %add2)
    428   %add3 = add nsw i32 %f, %e
    429   %add4 = add nsw i32 %add3, %g
    430   %add5 = add nsw i32 %add4, %h
    431   tail call void @throw_exception_3(i32 %add5)
    432   %add6 = add nsw i32 %add5, %add2
    433   ret i32 %add6
    434 }
    435 
    436 ; CHECK-FP-LABEL: test3:
    437 ; CHECK-FP:   .cfi_startproc
    438 ; CHECK-FP:   push   {r4, r5, r11, lr}
    439 ; CHECK-FP:   .cfi_def_cfa_offset 16
    440 ; CHECK-FP:   .cfi_offset lr, -4
    441 ; CHECK-FP:   .cfi_offset r11, -8
    442 ; CHECK-FP:   .cfi_offset r5, -12
    443 ; CHECK-FP:   .cfi_offset r4, -16
    444 ; CHECK-FP:   add    r11, sp, #8
    445 ; CHECK-FP:   .cfi_def_cfa r11, 8
    446 ; CHECK-FP:   pop    {r4, r5, r11, lr}
    447 ; CHECK-FP:   mov    pc, lr
    448 ; CHECK-FP:   .cfi_endproc
    449 
    450 ; CHECK-FP-ELIM-LABEL: test3:
    451 ; CHECK-FP-ELIM:   .cfi_startproc
    452 ; CHECK-FP-ELIM:   push  {r4, r5, r11, lr}
    453 ; CHECK-FP-ELIM:   .cfi_def_cfa_offset 16
    454 ; CHECK-FP-ELIM:   .cfi_offset lr, -4
    455 ; CHECK-FP-ELIM:   .cfi_offset r11, -8
    456 ; CHECK-FP-ELIM:   .cfi_offset r5, -12
    457 ; CHECK-FP-ELIM:   .cfi_offset r4, -16
    458 ; CHECK-FP-ELIM:   pop   {r4, r5, r11, lr}
    459 ; CHECK-FP-ELIM:   mov   pc, lr
    460 ; CHECK-FP-ELIM:   .cfi_endproc
    461 
    462 ; CHECK-V7-FP-LABEL: test3:
    463 ; CHECK-V7-FP:   .cfi_startproc
    464 ; CHECK-V7-FP:   push   {r4, r5, r11, lr}
    465 ; CHECK-V7-FP:   .cfi_def_cfa_offset 16
    466 ; CHECK-V7-FP:   .cfi_offset lr, -4
    467 ; CHECK-V7-FP:   .cfi_offset r11, -8
    468 ; CHECK-V7-FP:   .cfi_offset r5, -12
    469 ; CHECK-V7-FP:   .cfi_offset r4, -16
    470 ; CHECK-V7-FP:   add    r11, sp, #8
    471 ; CHECK-V7-FP:   .cfi_def_cfa r11, 8
    472 ; CHECK-V7-FP:   pop    {r4, r5, r11, pc}
    473 ; CHECK-V7-FP:   .cfi_endproc
    474 
    475 ; CHECK-V7-FP-ELIM-LABEL: test3:
    476 ; CHECK-V7-FP-ELIM:   .cfi_startproc
    477 ; CHECK-V7-FP-ELIM:   push  {r4, r5, r11, lr}
    478 ; CHECK-V7-FP-ELIM:   .cfi_def_cfa_offset 16
    479 ; CHECK-V7-FP-ELIM:   .cfi_offset lr, -4
    480 ; CHECK-V7-FP-ELIM:   .cfi_offset r11, -8
    481 ; CHECK-V7-FP-ELIM:   .cfi_offset r5, -12
    482 ; CHECK-V7-FP-ELIM:   .cfi_offset r4, -16
    483 ; CHECK-V7-FP-ELIM:   pop   {r4, r5, r11, pc}
    484 ; CHECK-V7-FP-ELIM:   .cfi_endproc
    485 
    486 ; CHECK-THUMB-FP-LABEL: test3:
    487 ; CHECK-THUMB-FP:   .cfi_startproc
    488 ; CHECK-THUMB-FP:   push   {r4, r5, r7, lr}
    489 ; CHECK-THUMB-FP:   .cfi_def_cfa_offset 16
    490 ; CHECK-THUMB-FP:   .cfi_offset lr, -4
    491 ; CHECK-THUMB-FP:   .cfi_offset r7, -8
    492 ; CHECK-THUMB-FP:   .cfi_offset r5, -12
    493 ; CHECK-THUMB-FP:   .cfi_offset r4, -16
    494 ; CHECK-THUMB-FP:   add    r7, sp, #8
    495 ; CHECK-THUMB-FP:   .cfi_def_cfa r7, 8
    496 ; CHECK-THUMB-FP:   pop    {r4, r5, r7, pc}
    497 ; CHECK-THUMB-FP:   .cfi_endproc
    498 
    499 ; CHECK-THUMB-FP-ELIM-LABEL: test3:
    500 ; CHECK-THUMB-FP-ELIM:   .cfi_startproc
    501 ; CHECK-THUMB-FP-ELIM:   push  {r4, r5, r7, lr}
    502 ; CHECK-THUMB-FP-ELIM:   .cfi_def_cfa_offset 16
    503 ; CHECK-THUMB-FP-ELIM:   .cfi_offset lr, -4
    504 ; CHECK-THUMB-FP-ELIM:   .cfi_offset r7, -8
    505 ; CHECK-THUMB-FP-ELIM:   .cfi_offset r5, -12
    506 ; CHECK-THUMB-FP-ELIM:   .cfi_offset r4, -16
    507 ; CHECK-THUMB-FP-ELIM:   pop   {r4, r5, r7, pc}
    508 ; CHECK-THUMB-FP-ELIM:   .cfi_endproc
    509 
    510 ; CHECK-THUMB-V7-FP-LABEL: test3:
    511 ; CHECK-THUMB-V7-FP:   .cfi_startproc
    512 ; CHECK-THUMB-V7-FP:   push   {r4, r5, r7, lr}
    513 ; CHECK-THUMB-V7-FP:   .cfi_def_cfa_offset 16
    514 ; CHECK-THUMB-V7-FP:   .cfi_offset lr, -4
    515 ; CHECK-THUMB-V7-FP:   .cfi_offset r7, -8
    516 ; CHECK-THUMB-V7-FP:   .cfi_offset r5, -12
    517 ; CHECK-THUMB-V7-FP:   .cfi_offset r4, -16
    518 ; CHECK-THUMB-V7-FP:   add    r7, sp, #8
    519 ; CHECK-THUMB-V7-FP:   .cfi_def_cfa r7, 8
    520 ; CHECK-THUMB-V7-FP:   pop    {r4, r5, r7, pc}
    521 ; CHECK-THUMB-V7-FP:   .cfi_endproc
    522 
    523 ; CHECK-THUMB-V7-FP-ELIM-LABEL: test3:
    524 ; CHECK-THUMB-V7-FP-ELIM:   .cfi_startproc
    525 ; CHECK-THUMB-V7-FP-ELIM:   push.w  {r4, r5, r11, lr}
    526 ; CHECK-THUMB-V7-FP-ELIM:   .cfi_def_cfa_offset 16
    527 ; CHECK-THUMB-V7-FP-ELIM:   .cfi_offset lr, -4
    528 ; CHECK-THUMB-V7-FP-ELIM:   .cfi_offset r11, -8
    529 ; CHECK-THUMB-V7-FP-ELIM:   .cfi_offset r5, -12
    530 ; CHECK-THUMB-V7-FP-ELIM:   .cfi_offset r4, -16
    531 ; CHECK-THUMB-V7-FP-ELIM:   pop.w   {r4, r5, r11, pc}
    532 ; CHECK-THUMB-V7-FP-ELIM:   .cfi_endproc
    533 
    534 
    535 ;-------------------------------------------------------------------------------
    536 ; Test 4
    537 ;-------------------------------------------------------------------------------
    538 
    539 define void @test4() nounwind {
    540 entry:
    541   ret void
    542 }
    543 
    544 ; CHECK-FP-LABEL: test4:
    545 ; CHECK-FP:   mov pc, lr
    546 ; CHECK-FP-NOT:   .cfi_def_cfa_offset
    547 
    548 ; CHECK-FP-ELIM-LABEL: test4:
    549 ; CHECK-FP-ELIM:   mov pc, lr
    550 ; CHECK-FP-ELIM-NOT:   .cfi_def_cfa_offset
    551 
    552 ; CHECK-V7-FP-LABEL: test4:
    553 ; CHECK-V7-FP:   bx lr
    554 ; CHECK-V7-FP-NOT:   .cfi_def_cfa_offset
    555 
    556 ; CHECK-V7-FP-ELIM-LABEL: test4:
    557 ; CHECK-V7-FP-ELIM:   bx lr
    558 ; CHECK-V7-FP-ELIM-NOT:   .cfi_def_cfa_offset
    559 
    560 ; CHECK-THUMB-FP-LABEL: test4:
    561 ; CHECK-THUMB-FP:   bx lr
    562 ; CHECK-THUMB-FP-NOT:   .cfi_def_cfa_offset
    563 
    564 ; CHECK-THUMB-FP-ELIM-LABEL: test4:
    565 ; CHECK-THUMB-FP-ELIM:   bx lr
    566 ; CHECK-THUMB-FP-ELIM-NOT:   .cfi_def_cfa_offset
    567 
    568 ; CHECK-THUMB-V7-FP-LABEL: test4:
    569 ; CHECK-THUMB-V7-FP:   bx lr
    570 ; CHECK-THUMB-V7-FP-NOT:   .cfi_def_cfa_offset
    571 
    572 ; CHECK-THUMB-V7-FP-ELIM-LABEL: test4:
    573 ; CHECK-THUMB-V7-FP-ELIM:   bx lr
    574 ; CHECK-THUMB-V7-FP-ELIM-NOT:   .cfi_def_cfa_offset
    575 
    576