aboutsummaryrefslogtreecommitdiff
path: root/gas/testsuite
diff options
context:
space:
mode:
authorAndreas Schwab <schwab@linux-m68k.org>2003-08-08 14:46:41 +0000
committerAndreas Schwab <schwab@linux-m68k.org>2003-08-08 14:46:41 +0000
commitc04898f807516f8361a4ec6f55b984bdf0955f7e (patch)
tree6a90d5b09ae4147038486dfddb9130bd4785f0a2 /gas/testsuite
parent9a146a111fcdf46255451553ef8be9bb571e5853 (diff)
downloadgdb-c04898f807516f8361a4ec6f55b984bdf0955f7e.zip
gdb-c04898f807516f8361a4ec6f55b984bdf0955f7e.tar.gz
gdb-c04898f807516f8361a4ec6f55b984bdf0955f7e.tar.bz2
gas/
* config/tc-m68k.h (TARGET_USE_CFIPOP) (DWARF2_DEFAULT_RETURN_COLUMN, DWARF2_CIE_DATA_ALIGNMENT) (tc_regname_to_dw2regnum, tc_cfi_frame_initial_instructions): Define. * config/tc-m68k.c: Include "dw2gencfi.h". (tc_m68k_regname_to_dw2regnum) (tc_m68k_frame_initial_instructions): New functions. gas/testsuite/ * gas/cfi/cfi-m68k.s, gas/cfi/cfi-m68k.d: New test. * gas/cfi/cfi.exp (run_list_test): Run it.
Diffstat (limited to 'gas/testsuite')
-rw-r--r--gas/testsuite/ChangeLog5
-rw-r--r--gas/testsuite/gas/cfi/cfi-m68k.d33
-rw-r--r--gas/testsuite/gas/cfi/cfi-m68k.s64
-rw-r--r--gas/testsuite/gas/cfi/cfi.exp3
4 files changed, 105 insertions, 0 deletions
diff --git a/gas/testsuite/ChangeLog b/gas/testsuite/ChangeLog
index 51a1239..f372e87 100644
--- a/gas/testsuite/ChangeLog
+++ b/gas/testsuite/ChangeLog
@@ -1,3 +1,8 @@
+2003-08-08 Andreas Schwab <schwab@suse.de>
+
+ * gas/cfi/cfi-m68k.s, gas/cfi/cfi-m68k.d: New test.
+ * gas/cfi/cfi.exp (run_list_test): Run it.
+
2003-08-06 Jason Eckhardt <jle@rice.edu>
* gas/i860/dir-align01.{s,d}: New files.
diff --git a/gas/testsuite/gas/cfi/cfi-m68k.d b/gas/testsuite/gas/cfi/cfi-m68k.d
new file mode 100644
index 0000000..a728759
--- /dev/null
+++ b/gas/testsuite/gas/cfi/cfi-m68k.d
@@ -0,0 +1,33 @@
+#readelf: -wf
+#name: CFI on m68k
+The section .eh_frame contains:
+
+00000000 00000012 00000000 CIE
+ Version: 1
+ Augmentation: "zR"
+ Code alignment factor: 2
+ Data alignment factor: -4
+ Return address column: 24
+ Augmentation data: 1b
+
+ DW_CFA_def_cfa: r15 ofs 4
+ DW_CFA_offset: r24 at cfa-4
+
+00000016 00000014 0000001a FDE cie=00000000 pc=0000001e..0000002a
+ DW_CFA_advance_loc: 4 to 00000022
+ DW_CFA_def_cfa_offset: 4664
+ DW_CFA_advance_loc: 6 to 00000028
+ DW_CFA_def_cfa_offset: 4
+
+0000002e 00000017 00000032 FDE cie=00000000 pc=00000036..00000042
+ DW_CFA_advance_loc: 4 to 0000003a
+ DW_CFA_def_cfa_offset: 8
+ DW_CFA_offset: r14 at cfa-8
+ DW_CFA_def_cfa_reg: r14
+ DW_CFA_advance_loc: 6 to 00000040
+ DW_CFA_def_cfa_reg: r15
+
+00000049 0000000f 0000004d FDE cie=00000000 pc=00000051..00000055
+
+ DW_CFA_nop
+ DW_CFA_nop
diff --git a/gas/testsuite/gas/cfi/cfi-m68k.s b/gas/testsuite/gas/cfi/cfi-m68k.s
new file mode 100644
index 0000000..6bf0cb2
--- /dev/null
+++ b/gas/testsuite/gas/cfi/cfi-m68k.s
@@ -0,0 +1,64 @@
+#; $ as -o test.o gas-cfi-test.s && gcc -nostdlib -o test test.o
+
+ .text
+
+#; func_locvars
+#; - function with a space on the stack
+#; allocated for local variables
+
+ .type func_locvars,@function
+func_locvars:
+ .cfi_startproc
+
+ #; alocate space for local vars
+ suba.w #0x1234,%sp
+ .cfi_adjust_cfa_offset 0x1234
+
+ #; dummy body
+ moveq.l #1,%d0
+
+ #; release space of local vars and return
+ adda.w #0x1234,%sp
+ .cfi_adjust_cfa_offset -0x1234
+ rts
+ .cfi_endproc
+
+#; func_prologue
+#; - functions that begins with standard
+#; prologue: "link %a6,#0"
+
+ .type func_prologue,@function
+func_prologue:
+ .cfi_startproc
+
+ #; prologue, CFI is valid after
+ #; each instruction.
+ link %a6,#0
+ .cfi_def_cfa_offset 8
+ .cfi_offset a6,-8
+ .cfi_def_cfa_register a6
+
+ #; function body
+ jbsr func_locvars
+ addq.l #3, %d0
+
+ #; epilogue with valid CFI
+ #; (we're better than gcc :-)
+ unlk %a6
+ .cfi_def_cfa_register sp
+ rts
+ .cfi_endproc
+
+#; main
+#; - typical function
+ .type main,@function
+main:
+ .cfi_startproc
+
+ #; only function body that doesn't
+ #; touch the stack at all.
+ jbsr func_prologue
+
+ #; return
+ rts
+ .cfi_endproc
diff --git a/gas/testsuite/gas/cfi/cfi.exp b/gas/testsuite/gas/cfi/cfi.exp
index 8824c22..d1b1ca8 100644
--- a/gas/testsuite/gas/cfi/cfi.exp
+++ b/gas/testsuite/gas/cfi/cfi.exp
@@ -36,6 +36,9 @@ if [istarget "x86_64-*"] then {
run_dump_test "cfi-s390x-1"
}
+} elseif { [istarget "m68*-*"] } then {
+ run_dump_test "cfi-m68k"
+
} else {
return
}