From 406601a1e304bd2ddf2be6a1e2be7899df620a69 Mon Sep 17 00:00:00 2001 From: Randolph Chung Date: Mon, 30 Oct 2006 01:10:46 +0000 Subject: [PATCH] 2006-10-29 Randolph Chung * gas/cfi/cfi.exp [hppa*-linux*]: Run hppa CFI test. * gas/cfi/cfi-hppa-1.s: New file. * gas/cfi/cfi-hppa-1.h: New file. --- gas/testsuite/ChangeLog | 6 +++ gas/testsuite/gas/cfi/cfi-hppa-1.d | 38 +++++++++++++++++ gas/testsuite/gas/cfi/cfi-hppa-1.s | 66 ++++++++++++++++++++++++++++++ gas/testsuite/gas/cfi/cfi.exp | 2 + 4 files changed, 112 insertions(+) create mode 100644 gas/testsuite/gas/cfi/cfi-hppa-1.d create mode 100644 gas/testsuite/gas/cfi/cfi-hppa-1.s diff --git a/gas/testsuite/ChangeLog b/gas/testsuite/ChangeLog index 69c2ea89791..23dc6a96038 100644 --- a/gas/testsuite/ChangeLog +++ b/gas/testsuite/ChangeLog @@ -1,3 +1,9 @@ +2006-10-29 Randolph Chung + + * gas/cfi/cfi.exp [hppa*-linux*]: Run hppa CFI test. + * gas/cfi/cfi-hppa-1.s: New file. + * gas/cfi/cfi-hppa-1.h: New file. + 2006-10-24 Andrew Pinski * gas/ppc/cell.s: New file. diff --git a/gas/testsuite/gas/cfi/cfi-hppa-1.d b/gas/testsuite/gas/cfi/cfi-hppa-1.d new file mode 100644 index 00000000000..7b06d55f327 --- /dev/null +++ b/gas/testsuite/gas/cfi/cfi-hppa-1.d @@ -0,0 +1,38 @@ +#readelf: -wf +#name: CFI on hppa +The section .eh_frame contains: + +00000000 00000010 00000000 CIE + Version: 1 + Augmentation: "zR" + Code alignment factor: 4 + Data alignment factor: -[48] + Return address column: 2 + Augmentation data: 1b + + DW_CFA_def_cfa: r30 ofs 0 + +00000014 00000018 00000018 FDE cie=00000000 pc=00000000..00000018 + DW_CFA_advance_loc: 8 to 00000008 + DW_CFA_def_cfa_reg: r3 + DW_CFA_advance_loc: 4 to 0000000c + DW_CFA_def_cfa_offset: 4660 + DW_CFA_advance_loc: 8 to 00000014 + DW_CFA_def_cfa_reg: r30 + DW_CFA_nop + +00000030 00000018 00000034 FDE cie=00000000 pc=00000018..00000040 + DW_CFA_advance_loc: 12 to 00000024 + DW_CFA_def_cfa_reg: r3 + DW_CFA_offset: r2 at cfa-24 + DW_CFA_advance_loc: 24 to 0000003c + DW_CFA_def_cfa_reg: r30 + DW_CFA_nop + DW_CFA_nop + DW_CFA_nop + +0000004c 00000010 00000050 FDE cie=00000000 pc=00000040..00000048 + DW_CFA_nop + DW_CFA_nop + DW_CFA_nop + diff --git a/gas/testsuite/gas/cfi/cfi-hppa-1.s b/gas/testsuite/gas/cfi/cfi-hppa-1.s new file mode 100644 index 00000000000..923350ccb94 --- /dev/null +++ b/gas/testsuite/gas/cfi/cfi-hppa-1.s @@ -0,0 +1,66 @@ +#; $ as -o test.o gas-cfi-test.s && gcc -nostdlib -o test test.o + + .text + .align 4 + .level 1.1 + +.globl func_locvars + .type func_locvars, @function +func_locvars: + .PROC + .CALLINFO FRAME=0x1234,NO_CALLS,SAVE_SP,ENTRY_GR=3 + .ENTRY + .cfi_startproc + copy %r3,%r1 + copy %r30,%r3 + .cfi_def_cfa_register r3 + stwm %r1,0x1234(%r30) + .cfi_adjust_cfa_offset 0x1234 + ldo 64(%r3),%r30 + ldwm -64(%r30),%r3 + .cfi_def_cfa_register sp + bv,n %r0(%r2) + .cfi_endproc + .EXIT + .PROCEND + +.globl func_prologue + .type func_prologue, @function +func_prologue: + .PROC + .CALLINFO FRAME=64,CALLS,SAVE_RP,SAVE_SP,ENTRY_GR=3 + .ENTRY + .cfi_startproc +#; This is not ABI-compliant but helps the test to run on both +#; 32-bit and 64-bit targets + stw %r2,-24(%r30) + copy %r3,%r1 + copy %r30,%r3 + .cfi_def_cfa_register r3 + .cfi_offset r2, -24 + stwm %r1,64(%r30) + bl func_locvars,%r2 + nop + ldw -20(%r3),%r2 + ldo 64(%r3),%r30 + ldwm -64(%r30),%r3 + .cfi_def_cfa_register sp + bv,n %r0(%r2) + .cfi_endproc + .EXIT + .PROCEND + + .align 4 +.globl main + .type main, @function +main: + .PROC + .CALLINFO CALLS + .ENTRY + #; tail call - simple function that doesn't touch the stack + .cfi_startproc + b func_prologue + nop + .cfi_endproc + .EXIT + .PROCEND diff --git a/gas/testsuite/gas/cfi/cfi.exp b/gas/testsuite/gas/cfi/cfi.exp index eeb55109829..de67b011b7c 100644 --- a/gas/testsuite/gas/cfi/cfi.exp +++ b/gas/testsuite/gas/cfi/cfi.exp @@ -61,6 +61,8 @@ if [istarget "x86_64-*"] then { } elseif { [istarget "mips*-*"] } then { run_dump_test "cfi-mips-1" +} elseif { [istarget "hppa*-linux*"] } then { + run_dump_test "cfi-hppa-1" } else { return } -- 2.30.2