1@ Integrated test for ARM unwind directive parser and assembler. 2 3@ This is a simplified real world test case generated from this C++ code 4@ (with and without -fomit-frame-pointer) 5@ 6@ extern void print(int, int, int, int, int); 7@ extern void print(double, double, double, double, double); 8@ 9@ void test(int a, int b, int c, int d, int e, 10@ double m, double n, double p, double q, double r) { 11@ try { 12@ print(a, b, c, d, e); 13@ } catch (...) { 14@ print(m, n, p, q, r); 15@ } 16@ } 17@ 18@ This test case should check the unwind opcode to adjust the opcode and 19@ restore the general-purpose and VFP registers. 20 21 22@ RUN: llvm-mc %s -triple=armv7-unknown-linux-gnueabi -filetype=obj -o - \ 23@ RUN: | llvm-readobj -s -sd | FileCheck %s 24 25 26@------------------------------------------------------------------------------- 27@ Assembly without frame pointer elimination 28@------------------------------------------------------------------------------- 29 .syntax unified 30 .section .TEST1 31 .globl func1 32 .align 2 33 .type func1,%function 34func1: 35 .fnstart 36 .save {r4, r11, lr} 37 push {r4, r11, lr} 38 .setfp r11, sp, #4 39 add r11, sp, #4 40 .vsave {d8, d9, d10, d11, d12} 41 vpush {d8, d9, d10, d11, d12} 42 .pad #28 43 sub sp, sp, #28 44 sub sp, r11, #44 45 vpop {d8, d9, d10, d11, d12} 46 pop {r4, r11, pc} 47.Ltmp1: 48 .size func1, .Ltmp1-func1 49 .globl __gxx_personality_v0 50 .personality __gxx_personality_v0 51 .handlerdata 52 .fnend 53 54@ CHECK: Section { 55@ CHECK: Name: .ARM.extab.TEST1 56@ CHECK: SectionData ( 57@ CHECK: 0000: 00000000 C94A9B01 B0818484 |.....J......| 58@ CHECK: ) 59@ CHECK: } 60 61 62 63@------------------------------------------------------------------------------- 64@ Assembly with frame pointer elimination 65@------------------------------------------------------------------------------- 66 .section .TEST2 67 .globl func2 68 .align 2 69 .type func2,%function 70func2: 71 .fnstart 72 .save {r4, lr} 73 push {r4, lr} 74 .vsave {d8, d9, d10, d11, d12} 75 vpush {d8, d9, d10, d11, d12} 76 .pad #24 77 sub sp, sp, #24 78 add sp, sp, #24 79 vpop {d8, d9, d10, d11, d12} 80 pop {r4, pc} 81.Ltmp2: 82 .size func2, .Ltmp2-func2 83 .globl __gxx_personality_v0 84 .personality __gxx_personality_v0 85 .handlerdata 86 .fnend 87 88@ CHECK: Section { 89@ CHECK: Name: .ARM.extab.TEST2 90@ CHECK: SectionData ( 91@ CHECK: 0000: 00000000 84C90501 B0B0B0A8 |............| 92@ CHECK: ) 93@ CHECK: } 94