aboutsummaryrefslogtreecommitdiff
path: root/gas/testsuite
diff options
context:
space:
mode:
authorJakub Jelinek <jakub@redhat.com>2003-08-29 20:20:18 +0000
committerJakub Jelinek <jakub@redhat.com>2003-08-29 20:20:18 +0000
commit364b6d8b23fffbc773c2bda23348d73e8de86e84 (patch)
treeffe7b74218f18af4d967a05c8fb7bb373ca2161d /gas/testsuite
parente294916c5a6fd7e6f6a13261100cb1d3a2ee5a82 (diff)
downloadgdb-364b6d8b23fffbc773c2bda23348d73e8de86e84.zip
gdb-364b6d8b23fffbc773c2bda23348d73e8de86e84.tar.gz
gdb-364b6d8b23fffbc773c2bda23348d73e8de86e84.tar.bz2
* dw2gencfi.c (cfi_pseudo_table): Add cfi_gnu_window_save.
(dot_cfi, output_cfi_insn): Handle DW_CFA_GNU_window_save. (output_cie): Don't use DW_EH_PE_pcrel if neither DIFF_EXPR_OK nor tc_cfi_emit_pcrel_expr are defined. (output_fde): Use tc_cfi_emit_pcrel_expr if available and DIFF_EXPR_OK is not defined. * config/tc-sparc.h (TARGET_USE_CFIPOP): Define. (tc_cfi_frame_initial_instructions, tc_regname_to_dw2regnum, tc_cfi_emit_pcrel_expr): Define. (sparc_cfi_frame_initial_instructions, sparc_regname_to_dw2regnum, sparc_cfi_emit_pcrel_expr): New prototypes. (sparc_cie_data_alignment): New decl. (DWARF2_DEFAULT_RETURN_COLUMN, DWARF2_CIE_DATA_ALIGNMENT): Define. * config/tc-sparc.c: Include dw2gencfi.h. (sparc_cie_data_alignment): New variable. (md_begin): Initialize it. (sparc_cfi_frame_initial_instructions): New function. (sparc_regname_to_dw2regnum): Likewise. (sparc_cfi_emit_pcrel_expr): Likewise. * doc/as.texinfo: Document .cfi_gnu_window_save. * config/tc-sparc.c (s_common): Cast last argument to long and change format string to shut up warning. testsuite/ * gas/cfi/cfi-sparc-1.s: New test. * gas/cfi/cfi-sparc-1.d: New test. * gas/cfi/cfi-sparc64-1.s: New test. * gas/cfi/cfi-sparc64-1.d: New test. * gas/cfi/cfi.exp: Run them.
Diffstat (limited to 'gas/testsuite')
-rw-r--r--gas/testsuite/ChangeLog8
-rw-r--r--gas/testsuite/gas/cfi/cfi-sparc-1.d22
-rw-r--r--gas/testsuite/gas/cfi/cfi-sparc-1.s23
-rw-r--r--gas/testsuite/gas/cfi/cfi-sparc64-1.d25
-rw-r--r--gas/testsuite/gas/cfi/cfi-sparc64-1.s26
-rw-r--r--gas/testsuite/gas/cfi/cfi.exp10
6 files changed, 114 insertions, 0 deletions
diff --git a/gas/testsuite/ChangeLog b/gas/testsuite/ChangeLog
index e068922..28754a4 100644
--- a/gas/testsuite/ChangeLog
+++ b/gas/testsuite/ChangeLog
@@ -1,3 +1,11 @@
+2003-08-29 Jakub Jelinek <jakub@redhat.com>
+
+ * gas/cfi/cfi-sparc-1.s: New test.
+ * gas/cfi/cfi-sparc-1.d: New test.
+ * gas/cfi/cfi-sparc64-1.s: New test.
+ * gas/cfi/cfi-sparc64-1.d: New test.
+ * gas/cfi/cfi.exp: Run them.
+
2003-08-19 Nick Clifton <nickc@redhat.com>
* gas/arm/copro.s: Add tests of Addressing Mode 5 (Unindexed).
diff --git a/gas/testsuite/gas/cfi/cfi-sparc-1.d b/gas/testsuite/gas/cfi/cfi-sparc-1.d
new file mode 100644
index 0000000..ac927ac
--- /dev/null
+++ b/gas/testsuite/gas/cfi/cfi-sparc-1.d
@@ -0,0 +1,22 @@
+#readelf: -wf
+#name: CFI on SPARC 32-bit
+#as: -32
+
+The section .eh_frame contains:
+
+00000000 00000010 00000000 CIE
+ Version: 1
+ Augmentation: "zR"
+ Code alignment factor: 4
+ Data alignment factor: -4
+ Return address column: 15
+ Augmentation data: 1b
+
+ DW_CFA_def_cfa: r14 ofs 0
+
+00000014 00000014 00000018 FDE cie=00000000 pc=0000001c..00000040
+ DW_CFA_advance_loc: 4 to 00000020
+ DW_CFA_def_cfa_reg: r30
+ DW_CFA_GNU_window_save
+ DW_CFA_register: r15 in r31
+
diff --git a/gas/testsuite/gas/cfi/cfi-sparc-1.s b/gas/testsuite/gas/cfi/cfi-sparc-1.s
new file mode 100644
index 0000000..5e7812a
--- /dev/null
+++ b/gas/testsuite/gas/cfi/cfi-sparc-1.s
@@ -0,0 +1,23 @@
+#; $ as -o test.o -32 gas-cfi-test.s && gcc -m32 -nostdlib -o test test.o
+
+ .file "a.c"
+ .text
+ .align 4
+ .globl foo
+ .type foo, @function
+foo:
+ .cfi_startproc
+ save %sp, -104, %sp
+ .cfi_def_cfa_register %fp
+ .cfi_gnu_window_save
+ .cfi_register %o7, %i7
+ add %i0, 1, %o0
+ call bar, 0
+ add %i0, 2, %i0
+ call bar, 0
+ mov %i0, %o0
+ add %o0, 3, %o0
+ ret
+ restore %g0, %o0, %o0
+ .cfi_endproc
+ .size foo, .-foo
diff --git a/gas/testsuite/gas/cfi/cfi-sparc64-1.d b/gas/testsuite/gas/cfi/cfi-sparc64-1.d
new file mode 100644
index 0000000..ffe6239
--- /dev/null
+++ b/gas/testsuite/gas/cfi/cfi-sparc64-1.d
@@ -0,0 +1,25 @@
+#readelf: -wf
+#name: CFI on SPARC 64-bit
+#as: -64
+
+The section .eh_frame contains:
+
+00000000 00000011 00000000 CIE
+ Version: 1
+ Augmentation: "zR"
+ Code alignment factor: 4
+ Data alignment factor: -8
+ Return address column: 15
+ Augmentation data: 1b
+
+ DW_CFA_def_cfa: r14 ofs 2047
+
+00000015 00000017 00000019 FDE cie=00000000 pc=0000001d..0000004d
+ DW_CFA_advance_loc: 4 to 00000021
+ DW_CFA_def_cfa_reg: r30
+ DW_CFA_GNU_window_save
+ DW_CFA_register: r15 in r31
+ DW_CFA_nop
+ DW_CFA_nop
+ DW_CFA_nop
+
diff --git a/gas/testsuite/gas/cfi/cfi-sparc64-1.s b/gas/testsuite/gas/cfi/cfi-sparc64-1.s
new file mode 100644
index 0000000..0ddf8e1
--- /dev/null
+++ b/gas/testsuite/gas/cfi/cfi-sparc64-1.s
@@ -0,0 +1,26 @@
+#; $ as -o test.o -64 gas-cfi-test.s && gcc -m64 -nostdlib -o test test.o
+
+ .file "a.c"
+ .text
+ .align 4
+ .globl foo
+ .type foo, @function
+foo:
+ .cfi_startproc
+ save %sp, -192, %sp
+ .cfi_def_cfa_register %fp
+ .cfi_gnu_window_save
+ .cfi_register %o7, %i7
+ add %i0, 1, %o0
+ add %i0, 2, %i0
+ call bar, 0
+ sra %o0, 0, %o0
+ sra %i0, 0, %i0
+ call bar, 0
+ mov %i0, %o0
+ add %o0, 3, %o0
+ sra %o0, 0, %o0
+ ret
+ restore %g0, %o0, %o0
+ .cfi_endproc
+ .size foo, .-foo
diff --git a/gas/testsuite/gas/cfi/cfi.exp b/gas/testsuite/gas/cfi/cfi.exp
index d1b1ca8..d09d6fd 100644
--- a/gas/testsuite/gas/cfi/cfi.exp
+++ b/gas/testsuite/gas/cfi/cfi.exp
@@ -39,6 +39,16 @@ if [istarget "x86_64-*"] then {
} elseif { [istarget "m68*-*"] } then {
run_dump_test "cfi-m68k"
+} elseif { [istarget sparc*-*-*] } then {
+ global NM
+ global NMFLAGS
+ global srcdir
+
+ catch "exec $srcdir/lib/run $NM $NMFLAGS --help" nm_help
+ run_dump_test "cfi-sparc-1"
+ if { [regexp "elf64\[_-\]sparc" $nm_help] } then {
+ run_dump_test "cfi-sparc64-1"
+ }
} else {
return
}