1 ; ARM EHABI integrated test 2 3 ; This test case checks that the ARM DWARF stack frame directives 4 ; are not generated if compiling with no debug information. 5 6 ; RUN: llc -mtriple arm-unknown-linux-gnueabi \ 7 ; RUN: -filetype=asm -o - %s \ 8 ; RUN: | FileCheck %s --check-prefix=CHECK-FP-ELIM 9 10 ; RUN: llc -mtriple thumb-unknown-linux-gnueabi \ 11 ; RUN: -disable-fp-elim -filetype=asm -o - %s \ 12 ; RUN: | FileCheck %s --check-prefix=CHECK-THUMB-FP 13 14 ;------------------------------------------------------------------------------- 15 ; Test 1 16 ;------------------------------------------------------------------------------- 17 ; This is the LLVM assembly generated from following C++ code: 18 ; 19 ; extern void print(int, int, int, int, int); 20 ; extern void print(double, double, double, double, double); 21 ; 22 ; void test(int a, int b, int c, int d, int e, 23 ; double m, double n, double p, double q, double r) { 24 ; try { 25 ; print(a, b, c, d, e); 26 ; } catch (...) { 27 ; print(m, n, p, q, r); 28 ; } 29 ; } 30 31 declare void @_Z5printiiiii(i32, i32, i32, i32, i32) 32 33 declare void @_Z5printddddd(double, double, double, double, double) 34 35 define void @_Z4testiiiiiddddd(i32 %a, i32 %b, i32 %c, i32 %d, i32 %e, 36 double %m, double %n, double %p, 37 double %q, double %r) { 38 entry: 39 invoke void @_Z5printiiiii(i32 %a, i32 %b, i32 %c, i32 %d, i32 %e) 40 to label %try.cont unwind label %lpad 41 42 lpad: 43 %0 = landingpad { i8*, i32 } 44 personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*) 45 catch i8* null 46 %1 = extractvalue { i8*, i32 } %0, 0 47 %2 = tail call i8* @__cxa_begin_catch(i8* %1) 48 invoke void @_Z5printddddd(double %m, double %n, double %p, 49 double %q, double %r) 50 to label %invoke.cont2 unwind label %lpad1 51 52 invoke.cont2: 53 tail call void @__cxa_end_catch() 54 br label %try.cont 55 56 try.cont: 57 ret void 58 59 lpad1: 60 %3 = landingpad { i8*, i32 } 61 personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*) 62 cleanup 63 invoke void @__cxa_end_catch() 64 to label %eh.resume unwind label %terminate.lpad 65 66 eh.resume: 67 resume { i8*, i32 } %3 68 69 terminate.lpad: 70 %4 = landingpad { i8*, i32 } 71 personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*) 72 catch i8* null 73 %5 = extractvalue { i8*, i32 } %4, 0 74 tail call void @__clang_call_terminate(i8* %5) 75 unreachable 76 } 77 78 declare void @__clang_call_terminate(i8*) 79 80 declare i32 @__gxx_personality_v0(...) 81 82 declare i8* @__cxa_begin_catch(i8*) 83 84 declare void @__cxa_end_catch() 85 86 declare void @_ZSt9terminatev() 87 88 ; CHECK-FP-ELIM-LABEL: _Z4testiiiiiddddd: 89 ; CHECK-FP-ELIM-NOT: .cfi_startproc 90 ; CHECK-FP-ELIM: push {r4, r5, r6, r7, r8, r9, r10, r11, lr} 91 ; CHECK-FP-ELIM-NOT: .cfi_def_cfa_offset 36 92 93 ; CHECK-THUMB-FP-LABEL: _Z4testiiiiiddddd: 94 ; CHECK-THUMB-FP-NOT: .cfi_startproc 95 ; CHECK-THUMB-FP: push {r4, r5, r6, r7, lr} 96 ; CHECK-THUMB-FP-NOT: .cfi_def_cfa_offset 20 97 98