2006-10-29 Randolph Chung <tausq@debian.org>
authorRandolph Chung <tausq@debian.org>
Mon, 30 Oct 2006 01:10:46 +0000 (01:10 +0000)
committerRandolph Chung <tausq@debian.org>
Mon, 30 Oct 2006 01:10:46 +0000 (01:10 +0000)
* 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
gas/testsuite/gas/cfi/cfi-hppa-1.d [new file with mode: 0644]
gas/testsuite/gas/cfi/cfi-hppa-1.s [new file with mode: 0644]
gas/testsuite/gas/cfi/cfi.exp

index 69c2ea89791ccfb8ac17ae4f30bcfeb35eef005c..23dc6a96038fa3b5ceaf93840bb7130e37bcc9ee 100644 (file)
@@ -1,3 +1,9 @@
+2006-10-29  Randolph Chung  <tausq@debian.org>
+
+       * 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  <andrew_pinski@playstation.sony.com>
 
        * 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 (file)
index 0000000..7b06d55
--- /dev/null
@@ -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 (file)
index 0000000..923350c
--- /dev/null
@@ -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
index eeb5510982919708e3287fd23209b4c0a8edaae2..de67b011b7c3ec5391b65b2ae3f34b41504784b1 100644 (file)
@@ -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
 }