diff options
author | 2017-12-15 17:08:56 +1030 | |
---|---|---|
committer | 2017-12-19 06:51:33 +1030 | |
commit | f795c49463234dc347ddd9a1b07ee5b506295b96 (patch) | |
tree | e55a82360d64a55d45ed88ade2d1e9c4438ac470 /binutils/testsuite/binutils-all/hppa/objdump.exp | |
parent | Decode expression lists used with DW_AT_byte_size and other DWARF attributes. (diff) | |
download | binutils-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/hppa/objdump.exp')
-rw-r--r-- | binutils/testsuite/binutils-all/hppa/objdump.exp | 66 |
1 files changed, 34 insertions, 32 deletions
diff --git a/binutils/testsuite/binutils-all/hppa/objdump.exp b/binutils/testsuite/binutils-all/hppa/objdump.exp index b834a22f9c3..3f69f34a3f7 100644 --- a/binutils/testsuite/binutils-all/hppa/objdump.exp +++ b/binutils/testsuite/binutils-all/hppa/objdump.exp @@ -42,30 +42,31 @@ if {[which $OBJDUMP] == 0} then { send_user "Version [binutil_version $OBJDUMP]" if {![binutils_assemble $srcdir/$subdir/addendbug.s tmpdir/addendbug.o]} then { - return -} - -if [is_remote host] { - set objfile [remote_download host tmpdir/addendbug.o] + fail "addendbug test (assembling)" } else { - set objfile tmpdir/addendbug.o -} -# Make sure the SOM BFD code sign extends constants in R_DATA_OVERRIDE fixups. + if [is_remote host] { + set objfile [remote_download host tmpdir/addendbug.o] + } else { + set objfile tmpdir/addendbug.o + } -set got [binutils_run $OBJDUMP "$OBJDUMPFLAGS -r $objfile"] + # Make sure the SOM BFD code sign extends constants in + # R_DATA_OVERRIDE fixups. -if [istarget hppa*-*-*elf*] then { - set want "00000000 R_PARISC_DPREL21L\[ \]+is_idchar-0x00000020.*" -} else { - set want "00000000 R_DP_RELATIVE\[ \]+is_idchar-0x00000020.*" -} + set got [binutils_run $OBJDUMP "$OBJDUMPFLAGS -r $objfile"] + if [istarget hppa*-*-*elf*] then { + set want "00000000 R_PARISC_DPREL21L\[ \]+is_idchar-0x00000020.*" + } else { + set want "00000000 R_DP_RELATIVE\[ \]+is_idchar-0x00000020.*" + } -if [regexp $want $got] then { - pass "addendbug test" -} else { - fail "addendbug test" + if [regexp $want $got] then { + pass "addendbug test" + } else { + fail "addendbug test" + } } ########################### @@ -73,23 +74,24 @@ if [regexp $want $got] then { ########################### if {![binutils_assemble $srcdir/$subdir/freg.s tmpdir/freg.o]} then { - return -} - -if [is_remote host] { - set objfile [remote_download host tmpdir/freg.o] + fail "freg test (assembling)" } else { - set objfile tmpdir/freg.o -} -# Make sure that we get R float regs like we're supposed to + if [is_remote host] { + set objfile [remote_download host tmpdir/freg.o] + } else { + set objfile tmpdir/freg.o + } -set got [binutils_run $OBJDUMP "$OBJDUMPFLAGS --disassemble $objfile"] + # Make sure that we get R float regs like we're supposed to -set want "fmpyfadd,sgl fr4,fr4R,fr5R,fr5" + set got [binutils_run $OBJDUMP "$OBJDUMPFLAGS --disassemble $objfile"] -if [regexp $want $got] then { - pass "freg test" -} else { - fail "freg test" + set want "fmpyfadd,sgl fr4,fr4R,fr5R,fr5" + + if [regexp $want $got] then { + pass "freg test" + } else { + fail "freg test" + } } |