aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlan Modra <amodra@gmail.com>2017-12-15 17:08:56 +1030
committerAlan Modra <amodra@gmail.com>2017-12-19 06:51:33 +1030
commitf795c49463234dc347ddd9a1b07ee5b506295b96 (patch)
treee55a82360d64a55d45ed88ade2d1e9c4438ac470 /binutils/testsuite/binutils-all/m68k/objdump.exp
parentDecode expression lists used with DW_AT_byte_size and other DWARF attributes. (diff)
downloadbinutils-gdb-f795c49463234dc347ddd9a1b07ee5b506295b96.tar.gz
binutils-gdb-f795c49463234dc347ddd9a1b07ee5b506295b96.tar.bz2
binutils-gdb-f795c49463234dc347ddd9a1b07ee5b506295b96.zip
Test binutils_assemble return value
This is a followup to "binutils nm testsuite tidy". Since the perror in binutils_assemble has been removed, we need to take more care in failure paths. The patch also fixed a number of .exp files that have multiple tests, where an assembly failure returns from the .exp file. In most cases it is nicer to attempt all tests. * testsuite/binutils-all/ar.exp (unique_symbol): Don't run AR if assembly fails. * testsuite/binutils-all/arc/objdump.exp (check_assembly): If objfile is empty, fail test. * testsuite/binutils-all/arm/objdump.exp: Don't return if assembly fails for a test, continue on to other tests. * testsuite/binutils-all/bfin/objdump.exp: Likewise. * testsuite/binutils-all/hppa/objdump.exp: Likewise. * testsuite/binutils-all/m68k/objdump.exp: Likewise. * testsuite/binutils-all/vax/objdump.exp: Likewise. * testsuite/binutils-all/size.exp: Likewise. * testsuite/binutils-all/nm.exp: Likewise. Move PR12753 test. * testsuite/binutils-all/objcopy.exp: Don't perror on assembly fail. * testsuite/binutils-all/objdump.exp: Report assembly fails.
Diffstat (limited to 'binutils/testsuite/binutils-all/m68k/objdump.exp')
-rw-r--r--binutils/testsuite/binutils-all/m68k/objdump.exp58
1 files changed, 30 insertions, 28 deletions
diff --git a/binutils/testsuite/binutils-all/m68k/objdump.exp b/binutils/testsuite/binutils-all/m68k/objdump.exp
index f1f53dd7559..10872525d72 100644
--- a/binutils/testsuite/binutils-all/m68k/objdump.exp
+++ b/binutils/testsuite/binutils-all/m68k/objdump.exp
@@ -30,25 +30,26 @@ send_user "Version [binutil_version $OBJDUMP]"
###########################
if {![binutils_assemble $srcdir/$subdir/movem.s tmpdir/movem.o]} then {
- return
-}
-
-if [is_remote host] {
- set objfile [remote_download host tmpdir/movem.o]
+ fail "movem test"
} else {
- set objfile tmpdir/movem.o
-}
-# Make sure that the movem is correctly decoded.
+ if [is_remote host] {
+ set objfile [remote_download host tmpdir/movem.o]
+ } else {
+ set objfile tmpdir/movem.o
+ }
-set got [binutils_run $OBJDUMP "$OBJDUMPFLAGS --disassemble $objfile"]
+ # Make sure that the movem is correctly decoded.
-set want "moveml %d0-%d3,%sp@-.*moveml %d0-%d3,%sp@\[\r\n\]"
+ set got [binutils_run $OBJDUMP "$OBJDUMPFLAGS --disassemble $objfile"]
-if [regexp $want $got] then {
- pass "movem test"
-} else {
- fail "movem test"
+ set want "moveml %d0-%d3,%sp@-.*moveml %d0-%d3,%sp@\[\r\n\]"
+
+ if [regexp $want $got] then {
+ pass "movem test"
+ } else {
+ fail "movem test"
+ }
}
###########################
@@ -56,23 +57,24 @@ if [regexp $want $got] then {
###########################
if {![binutils_assemble $srcdir/$subdir/fnop.s tmpdir/fnop.o]} then {
- return
-}
-
-if [is_remote host] {
- set objfile [remote_download host tmpdir/fnop.o]
+ fail "fnop test"
} else {
- set objfile tmpdir/fnop.o
-}
-# Make sure that fnop is decoded as fnop, not fbf.
+ if [is_remote host] {
+ set objfile [remote_download host tmpdir/fnop.o]
+ } else {
+ set objfile tmpdir/fnop.o
+ }
-set got [binutils_run $OBJDUMP "$OBJDUMPFLAGS --disassemble $objfile"]
+ # Make sure that fnop is decoded as fnop, not fbf.
-set want "fnop *\[\r\n\]"
+ set got [binutils_run $OBJDUMP "$OBJDUMPFLAGS --disassemble $objfile"]
-if [regexp $want $got] then {
- pass "fnop test"
-} else {
- fail "fnop test"
+ set want "fnop *\[\r\n\]"
+
+ if [regexp $want $got] then {
+ pass "fnop test"
+ } else {
+ fail "fnop test"
+ }
}