aboutsummaryrefslogtreecommitdiff
path: root/gas/testsuite
diff options
context:
space:
mode:
authorRichard Henderson <rth@redhat.com>2003-06-08 03:59:44 +0000
committerRichard Henderson <rth@redhat.com>2003-06-08 03:59:44 +0000
commitfa87b337c32686ec4526ea03e3041737ebdeb9f0 (patch)
tree7b507e8b570fbdc12d4a02ff4318cdda18ef5d5b /gas/testsuite
parenta0273b2f038b41d2903dbfa48048d83d5c4291fc (diff)
downloadfsf-binutils-gdb-fa87b337c32686ec4526ea03e3041737ebdeb9f0.zip
fsf-binutils-gdb-fa87b337c32686ec4526ea03e3041737ebdeb9f0.tar.gz
fsf-binutils-gdb-fa87b337c32686ec4526ea03e3041737ebdeb9f0.tar.bz2
* dw2gencfi.c (struct cfa_save_data, cfa_save_stack): New.
(cfi_add_CFA_offset): Detect invalid offsets. (cfi_add_CFA_remember_state): Save cur_cfa_offset. (cfi_add_CFA_restore_state): Restore it. (CFI_rel_offset): New. (cfi_pseudo_table): Add it. (dot_cfi): Handle it. * gas/cfi/cfi-common-1.d, gas/cfi/cfi-common-1.s: New. * gas/cfi/cfi-common-2.d, gas/cfi/cfi-common-2.s: New. * gas/cfi/cfi-diag-1.d, gas/cfi/cfi-diag-1.s: New. * gas/cfi/cfi.exp: Run them.
Diffstat (limited to 'gas/testsuite')
-rw-r--r--gas/testsuite/ChangeLog7
-rw-r--r--gas/testsuite/gas/cfi/cfi-common-1.d24
-rw-r--r--gas/testsuite/gas/cfi/cfi-common-1.s8
-rw-r--r--gas/testsuite/gas/cfi/cfi-common-2.d29
-rw-r--r--gas/testsuite/gas/cfi/cfi-common-2.s12
-rw-r--r--gas/testsuite/gas/cfi/cfi-diag-1.l2
-rw-r--r--gas/testsuite/gas/cfi/cfi-diag-1.s3
-rw-r--r--gas/testsuite/gas/cfi/cfi.exp25
8 files changed, 110 insertions, 0 deletions
diff --git a/gas/testsuite/ChangeLog b/gas/testsuite/ChangeLog
index 665da6a..6d895a0 100644
--- a/gas/testsuite/ChangeLog
+++ b/gas/testsuite/ChangeLog
@@ -1,3 +1,10 @@
+2003-06-07 Richard Henderson <rth@redhat.com>
+
+ * gas/cfi/cfi-common-1.d, gas/cfi/cfi-common-1.s: New.
+ * gas/cfi/cfi-common-2.d, gas/cfi/cfi-common-2.s: New.
+ * gas/cfi/cfi-diag-1.d, gas/cfi/cfi-diag-1.s: New.
+ * gas/cfi/cfi.exp: Run them.
+
2003-06-05 Michael Snyder <msnyder@redhat.com>
* gas/h8300/t01_mov.s: New file, tests mov instructions.
diff --git a/gas/testsuite/gas/cfi/cfi-common-1.d b/gas/testsuite/gas/cfi/cfi-common-1.d
new file mode 100644
index 0000000..8e7db37
--- /dev/null
+++ b/gas/testsuite/gas/cfi/cfi-common-1.d
@@ -0,0 +1,24 @@
+#readelf: -wf
+#name: CFI common 1
+The section .eh_frame contains:
+
+00000000 00000010 00000000 CIE
+ Version: 1
+ Augmentation: "zR"
+ Code alignment factor: .*
+ Data alignment factor: .*
+ Return address column: .*
+ Augmentation data: 1b
+
+ DW_CFA_nop
+ DW_CFA_nop
+ DW_CFA_nop
+
+00000014 00000018 00000018 FDE cie=00000000 pc=.*
+ DW_CFA_advance_loc: 4 to .*
+ DW_CFA_def_cfa: r0 ofs 16
+ DW_CFA_offset: r1 at cfa-8
+ DW_CFA_advance_loc: 4 to .*
+ DW_CFA_def_cfa_offset: 32
+ DW_CFA_offset: r2 at cfa-24
+
diff --git a/gas/testsuite/gas/cfi/cfi-common-1.s b/gas/testsuite/gas/cfi/cfi-common-1.s
new file mode 100644
index 0000000..72db279
--- /dev/null
+++ b/gas/testsuite/gas/cfi/cfi-common-1.s
@@ -0,0 +1,8 @@
+ .cfi_startproc simple
+ .long 0
+ .cfi_def_cfa 0, 16
+ .cfi_rel_offset 1, 8
+ .long 0
+ .cfi_adjust_cfa_offset 16
+ .cfi_rel_offset 2, 8
+ .cfi_endproc
diff --git a/gas/testsuite/gas/cfi/cfi-common-2.d b/gas/testsuite/gas/cfi/cfi-common-2.d
new file mode 100644
index 0000000..03f0d88
--- /dev/null
+++ b/gas/testsuite/gas/cfi/cfi-common-2.d
@@ -0,0 +1,29 @@
+#readelf: -wf
+#name: CFI common 2
+The section .eh_frame contains:
+
+00000000 00000010 00000000 CIE
+ Version: 1
+ Augmentation: "zR"
+ Code alignment factor: .*
+ Data alignment factor: .*
+ Return address column: .*
+ Augmentation data: 1b
+
+ DW_CFA_nop
+ DW_CFA_nop
+ DW_CFA_nop
+
+00000014 0000001c 00000018 FDE cie=00000000 pc=.*
+ DW_CFA_advance_loc: 4 to .*
+ DW_CFA_def_cfa: r0 ofs 16
+ DW_CFA_advance_loc: 4 to .*
+ DW_CFA_remember_state
+ DW_CFA_advance_loc: 4 to .*
+ DW_CFA_def_cfa_offset: 0
+ DW_CFA_advance_loc: 4 to .*
+ DW_CFA_restore_state
+ DW_CFA_advance_loc: 4 to .*
+ DW_CFA_def_cfa_offset: 0
+ DW_CFA_nop
+
diff --git a/gas/testsuite/gas/cfi/cfi-common-2.s b/gas/testsuite/gas/cfi/cfi-common-2.s
new file mode 100644
index 0000000..e2a9443
--- /dev/null
+++ b/gas/testsuite/gas/cfi/cfi-common-2.s
@@ -0,0 +1,12 @@
+ .cfi_startproc simple
+ .long 0
+ .cfi_def_cfa 0, 16
+ .long 0
+ .cfi_remember_state
+ .long 0
+ .cfi_adjust_cfa_offset -16
+ .long 0
+ .cfi_restore_state
+ .long 0
+ .cfi_adjust_cfa_offset -16
+ .cfi_endproc
diff --git a/gas/testsuite/gas/cfi/cfi-diag-1.l b/gas/testsuite/gas/cfi/cfi-diag-1.l
new file mode 100644
index 0000000..3dc8a61
--- /dev/null
+++ b/gas/testsuite/gas/cfi/cfi-diag-1.l
@@ -0,0 +1,2 @@
+.*: Assembler messages:
+.*:2: Error: register save offset not a multiple of .*
diff --git a/gas/testsuite/gas/cfi/cfi-diag-1.s b/gas/testsuite/gas/cfi/cfi-diag-1.s
new file mode 100644
index 0000000..de0f865
--- /dev/null
+++ b/gas/testsuite/gas/cfi/cfi-diag-1.s
@@ -0,0 +1,3 @@
+ .cfi_startproc
+ .cfi_offset 0, 1
+ .cfi_endproc
diff --git a/gas/testsuite/gas/cfi/cfi.exp b/gas/testsuite/gas/cfi/cfi.exp
index 0c24682..88baac2 100644
--- a/gas/testsuite/gas/cfi/cfi.exp
+++ b/gas/testsuite/gas/cfi/cfi.exp
@@ -1,9 +1,27 @@
+# ??? This probably shouldn't be replicated here...
+proc run_list_test { name opts } {
+ global srcdir subdir
+ set testname "cfi $name"
+ set file $srcdir/$subdir/$name
+ gas_run ${name}.s $opts ">&dump.out"
+ if { [regexp_diff "dump.out" "${file}.l"] } then {
+ fail $testname
+ verbose "output is [file_contents "dump.out"]" 2
+ return
+ }
+ pass $testname
+}
+
+set any "0"
+
if [istarget "x86_64-*"] then {
run_dump_test "cfi-x86_64"
+ set any "1"
}
if [istarget "i?86-*"] then {
run_dump_test "cfi-i386"
+ set any "1"
}
if { [istarget alpha*-*-*] } then {
@@ -17,5 +35,12 @@ if { [istarget alpha*-*-*] } then {
run_dump_test "cfi-alpha-1"
run_dump_test "cfi-alpha-2"
run_dump_test "cfi-alpha-3"
+ set any "1"
}
}
+
+if $any {
+ run_list_test "cfi-diag-1" ""
+ run_dump_test "cfi-common-1"
+ run_dump_test "cfi-common-2"
+}