aboutsummaryrefslogtreecommitdiff
path: root/binutils/testsuite
diff options
context:
space:
mode:
authorNick Clifton <nickc@redhat.com>2005-03-29 16:13:48 +0000
committerNick Clifton <nickc@redhat.com>2005-03-29 16:13:48 +0000
commitec72cfe589400f06810a571ce4d7f45fb6e19621 (patch)
tree1e025ae585dad3287f278cc57f80f1ed8179af11 /binutils/testsuite
parentdeb04cdb5ef9b4efa0e57b0e9d02c7800f2ee29a (diff)
downloadgdb-ec72cfe589400f06810a571ce4d7f45fb6e19621.zip
gdb-ec72cfe589400f06810a571ce4d7f45fb6e19621.tar.gz
gdb-ec72cfe589400f06810a571ce4d7f45fb6e19621.tar.bz2
Add VAX specific disassembler option -Mentry: to specify a function entry
address, and add code to test this new option.
Diffstat (limited to 'binutils/testsuite')
-rw-r--r--binutils/testsuite/ChangeLog7
-rw-r--r--binutils/testsuite/binutils-all/vax/entrymask.s11
-rw-r--r--binutils/testsuite/binutils-all/vax/objdump.exp82
3 files changed, 100 insertions, 0 deletions
diff --git a/binutils/testsuite/ChangeLog b/binutils/testsuite/ChangeLog
index 0902adc..bd490af 100644
--- a/binutils/testsuite/ChangeLog
+++ b/binutils/testsuite/ChangeLog
@@ -1,3 +1,10 @@
+2005-03-29 Jan-Benedict Glaw <jbglaw@lug-owl.de>
+
+ * binutils-all/vax: New directory.
+ * binutils-all/vax/objdump.exp: New script. Test the -Mentry:
+ switch added to the VAX disassembler.
+ * binutils-all/vax/entrymask.s: New assembler source file.
+
2005-03-08 Ben Elliston <bje@au.ibm.com>
* config/default.exp: Remove send_user call for stray output.
diff --git a/binutils/testsuite/binutils-all/vax/entrymask.s b/binutils/testsuite/binutils-all/vax/entrymask.s
new file mode 100644
index 0000000..18f9010
--- /dev/null
+++ b/binutils/testsuite/binutils-all/vax/entrymask.s
@@ -0,0 +1,11 @@
+.text
+
+.global label1
+label1:
+ .word 0x0110
+
+.global label2
+.type label2,@function
+label2:
+ .word 0x0224
+
diff --git a/binutils/testsuite/binutils-all/vax/objdump.exp b/binutils/testsuite/binutils-all/vax/objdump.exp
new file mode 100644
index 0000000..dd81633
--- /dev/null
+++ b/binutils/testsuite/binutils-all/vax/objdump.exp
@@ -0,0 +1,82 @@
+#
+# Copyright 1993, 1994, 1995, 1997, 1999, 2000, 2002, 2005
+# Free Software Foundation, Inc.
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+#
+
+#
+# This file was written by Jan-Benedict Glaw <jbglaw@lug-owl.de>. It's goal
+# is to check the VAX-specific support of the -M entry:0xf00 switch, which
+# allows to force function entry masks at given addresses.
+#
+
+if ![istarget vax*-*-*] then {
+ return
+}
+
+if {[which $OBJDUMP] == 0} then {
+ perror "$OBJDUMP does not exist"
+ return
+}
+
+send_user "Version [binutil_version $OBJDUMP]"
+
+if {![binutils_assemble $srcdir/$subdir/entrymask.s tmpdir/entrymask.o]} then {
+ return
+}
+
+if [is_remote host] {
+ set objfile [remote_download host tmpdir/entrymask.o]
+} else {
+ set objfile tmpdir/entrymask.o
+}
+
+#
+# First run. We expect the function to be a function and the sole label
+# not to produce an entry mask.
+#
+set got [binutils_run $OBJDUMP "$OBJDUMPFLAGS -d $objfile"]
+set want1 "\[ \]+0:\[ \]+10 01\[ \]+bsbb 3"
+set want2 "\[ \]+2:\[ \]+24 02\[ \]+\\.word 0x0224.\*r9 r5 r2"
+if [regexp $want1 $got] then {
+ pass "entrymask test 1"
+} else {
+ fail "entrymask test 1"
+}
+if [regexp $want2 $got] then {
+ pass "entrymask test 2"
+} else {
+ fail "entrymask test 2"
+}
+
+#
+# Second run. Now, we force the label as a function, so we expect that
+# it also produces an entry mask, as any call'able function should.
+#
+set got [binutils_run $OBJDUMP "$OBJDUMPFLAGS -d -M entry:0x0 $objfile"]
+set want3 "\[ \]+0:\[ \]+10 01\[ \]+\\.word 0x0110.\*r8 r4"
+set want4 "\[ \]+2:\[ \]+24 02\[ \]+\\.word 0x0224.\*r9 r5 r2"
+if [regexp $want3 $got] then {
+ pass "entrymask test 3"
+} else {
+ fail "entrymask test 3"
+}
+if [regexp $want4 $got] then {
+ pass "entrymask test 4"
+} else {
+ fail "entrymask test 4"
+}
+