This is the mail archive of the binutils@sources.redhat.com mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[PATCH-RFC] Testcase(s) for VAX' new -M entry:0xf00 feature


Hi!

This is my very first try to add something to the testsuite. It's
a new test checking that the -M entry:0xf00 feature (of objdump)
for VAX works as expected. This test is currently be run for
vax-*, but I'm not sure if this is correct. At least, I expect
it to be run for vax-dec-linux-gnu ...

This adds 4 single tests, of which one will fail (only for VAX)
until Nick actually checks in this feature. Just in case this is
already correct, here's the changelog:

2005-03-4  Jan-Benedict Glaw  <jbglaw@lug-owl.de>

	binutils/binutils/testsuite/binutils-all/vax:
	* entrymask.s: New file, simple assembler test.
	* objdump.exp: New file, implementing 4 tests for the
	VAX-specific objdump option '-M entry:0xf000'.

diff -Nurp src-fresh/binutils/testsuite/binutils-all/vax/entrymask.s src-hacked/binutils/testsuite/binutils-all/vax/entrymask.s
--- src-fresh/binutils/testsuite/binutils-all/vax/entrymask.s	1970-01-01 01:00:00.000000000 +0100
+++ src-hacked/binutils/testsuite/binutils-all/vax/entrymask.s	2005-03-24 23:00:50.000000000 +0100
@@ -0,0 +1,11 @@
+.text
+
+.global label1
+label1:
+	.word 0x0110
+
+.global label2
+.type label2,@function
+label2:
+	.word 0x0224
+
diff -Nurp src-fresh/binutils/testsuite/binutils-all/vax/objdump.exp src-hacked/binutils/testsuite/binutils-all/vax/objdump.exp
--- src-fresh/binutils/testsuite/binutils-all/vax/objdump.exp	1970-01-01 01:00:00.000000000 +0100
+++ src-hacked/binutils/testsuite/binutils-all/vax/objdump.exp	2005-03-24 23:06:53.000000000 +0100
@@ -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"
+}
+

MfG, JBG

-- 
AWEK microdata GmbH -- Am Wellbach 4 -- 33609 Bielefeld


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]