+2017-12-19 Alan Modra <amodra@gmail.com>
+
+ * 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.
+
2017-12-18 Nick Clifton <nickc@redhat.com>
PR 22532
if ![binutils_assemble $srcdir/$subdir/unique.s tmpdir/unique.o] {
unresolved $testname
+ return
}
if [is_remote host] {
global OBJDUMP
global OBJDUMPFLAGS
+ if [string equal "" $objfile] then {
+ fail $testname
+ return
+ }
set got [binutils_run $OBJDUMP "$OBJDUMPFLAGS --disassemble $disas_flags \
$objfile"]
###########################
if {![binutils_assemble $srcdir/$subdir/thumb2-cond.s tmpdir/thumb2-cond.o]} then {
- return
-}
-
-if [is_remote host] {
- set objfile [remote_download host tmpdir/thumb2-cond.o]
+ fail "thumb2-cond (assembling)"
} else {
- set objfile tmpdir/thumb2-cond.o
-}
-# Make sure that conditional instructions are correctly decoded.
+ if [is_remote host] {
+ set objfile [remote_download host tmpdir/thumb2-cond.o]
+ } else {
+ set objfile tmpdir/thumb2-cond.o
+ }
-set got [binutils_run $OBJDUMP "$OBJDUMPFLAGS --disassemble --start-address=6 $objfile"]
+ # Make sure that conditional instructions are correctly decoded.
-set want "bcc.w\[ \t\]*e12.*bx\[ \t\]*lr"
+ set got [binutils_run $OBJDUMP "$OBJDUMPFLAGS --disassemble --start-address=6 $objfile"]
-if [regexp $want $got] then {
- pass "thumb2-cond test1"
-} else {
- fail "thumb2-cond test1"
-}
+ set want "bcc.w\[ \t\]*e12.*bx\[ \t\]*lr"
-set got [binutils_run $OBJDUMP "$OBJDUMPFLAGS --disassemble --start-address=10 $objfile"]
+ if [regexp $want $got] then {
+ pass "thumb2-cond test1"
+ } else {
+ fail "thumb2-cond test1"
+ }
-set want "bx\[ \t\]*lr"
+ set got [binutils_run $OBJDUMP "$OBJDUMPFLAGS --disassemble --start-address=10 $objfile"]
-if [regexp $want $got] then {
- pass "thumb2-cond test2"
-} else {
- fail "thumb2-cond test2"
+ set want "bx\[ \t\]*lr"
+
+ if [regexp $want $got] then {
+ pass "thumb2-cond test2"
+ } else {
+ fail "thumb2-cond test2"
+ }
}
###########################
###########################
if {![binutils_assemble $srcdir/$subdir/simple.s tmpdir/simple.o]} then {
- return
-}
-
-if [is_remote host] {
- set objfile [remote_download host tmpdir/simple.o]
+ fail "multiple input files"
} else {
- set objfile tmpdir/simple.o
-}
-# Make sure multiple disassemblies come out the same
+ if [is_remote host] {
+ set objfile [remote_download host tmpdir/simple.o]
+ } else {
+ set objfile tmpdir/simple.o
+ }
-set got [binutils_run $OBJDUMP "-dr $objfile $objfile"]
+ # Make sure multiple disassemblies come out the same
-set want "$objfile:\[ \]*file format.*$objfile:\[ \]*file format.*push.*add.*sub.*str.*add.*ldmfd"
+ set got [binutils_run $OBJDUMP "-dr $objfile $objfile"]
-if [regexp $want $got] then {
- pass "multiple input files"
-} else {
- fail "multiple input files"
-}
+ set want "$objfile:\[ \]*file format.*$objfile:\[ \]*file format.*push.*add.*sub.*str.*add.*ldmfd"
-if {![binutils_assemble $srcdir/$subdir/rvct_symbol.s tmpdir/rvct_symbol.o]} then {
- return
+ if [regexp $want $got] then {
+ pass "multiple input files"
+ } else {
+ fail "multiple input files"
+ }
}
-if [is_remote host] {
- set objfile [remote_download host tmpdir/rvct_symbol.o]
+if {![binutils_assemble $srcdir/$subdir/rvct_symbol.s tmpdir/rvct_symbol.o]} then {
+ fail "skip rvct symbol"
} else {
- set objfile tmpdir/rvct_symbol.o
-}
-# Make sure multiple disassemblies come out the same
+ if [is_remote host] {
+ set objfile [remote_download host tmpdir/rvct_symbol.o]
+ } else {
+ set objfile tmpdir/rvct_symbol.o
+ }
-set got [binutils_run $OBJDUMP "-D $objfile $objfile"]
+ # Make sure multiple disassemblies come out the same
-set want "foo.*global_a.*global_b"
+ set got [binutils_run $OBJDUMP "-D $objfile $objfile"]
-if [regexp $want $got] then {
- pass "skip rvct symbol"
-} else {
- fail "skip rvct symbol"
+ set want "foo.*global_a.*global_b"
+
+ if [regexp $want $got] then {
+ pass "skip rvct symbol"
+ } else {
+ fail "skip rvct symbol"
+ }
}
###################################
if {![binutils_assemble $srcdir/$subdir/unknown-mode.s tmpdir/unknown-mode.o]} then {
- return
-}
-
-if [is_remote host] {
- set objfile [remote_download host tmpdir/unknown-mode.o]
+ fail "unknown mode test (assembling)"
} else {
- set objfile tmpdir/unknown-mode.o
-}
-# Make sure that the unknown mode does not cause abort.
+ if [is_remote host] {
+ set objfile [remote_download host tmpdir/unknown-mode.o]
+ } else {
+ set objfile tmpdir/unknown-mode.o
+ }
-set got [binutils_run $OBJDUMP "$OBJDUMPFLAGS -D $objfile"]
+ # Make sure that the unknown mode does not cause abort.
-set want "e1 c1\[ \t\]*ILLEGAL.*34 98 .*\[\r\n\]"
+ set got [binutils_run $OBJDUMP "$OBJDUMPFLAGS -D $objfile"]
-if [regexp $want $got] then {
- pass "unknown mode test"
-} else {
- fail "unknown mode test"
+ set want "e1 c1\[ \t\]*ILLEGAL.*34 98 .*\[\r\n\]"
+
+ if [regexp $want $got] then {
+ pass "unknown mode test"
+ } else {
+ fail "unknown mode test"
+ }
}
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"
+ }
}
###########################
###########################
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"
+ }
}
###########################
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"
+ }
}
###########################
###########################
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"
+ }
}
if {![binutils_assemble $srcdir/$subdir/bintest.s tmpdir/bintest.o]} then {
- return
-}
-
-if [is_remote host] {
- set tempfile [remote_download host tmpdir/bintest.o]
+ fail "nm (assembling)"
} else {
- set tempfile tmpdir/bintest.o
-}
-# Test nm with no arguments.
+ if [is_remote host] {
+ set tempfile [remote_download host tmpdir/bintest.o]
+ } else {
+ set tempfile tmpdir/bintest.o
+ }
-# This test does not work correctly on ECOFF targets, because ECOFF
-# stores most symbols twice, which messes up the nm output.
-setup_xfail "alpha*-*-osf*" "alpha*-*-netware*"
-setup_xfail "mips*-*-ultrix*" "mips*-*-ecoff*" "mips*-*-irix4*"
-setup_xfail "mips*-*-riscos*" "mips*-*-sysv3*" "mips*-sony-bsd*"
+ # Test nm with no arguments.
-# This test does not work correctly on XCOFF targets, because XCOFF
-# does not enter static symbols in the symbol table.
-setup_xfail "*-*-aix*"
+ # This test does not work correctly on ECOFF targets, because ECOFF
+ # stores most symbols twice, which messes up the nm output.
+ setup_xfail "alpha*-*-osf*" "alpha*-*-netware*"
+ setup_xfail "mips*-*-ultrix*" "mips*-*-ecoff*" "mips*-*-irix4*"
+ setup_xfail "mips*-*-riscos*" "mips*-*-sysv3*" "mips*-sony-bsd*"
-set got [binutils_run $NM "$NMFLAGS $tempfile"]
+ # This test does not work correctly on XCOFF targets, because XCOFF
+ # does not enter static symbols in the symbol table.
+ setup_xfail "*-*-aix*"
-if [info exists vars] then { unset vars }
-while {[regexp "(\[a-zA-Z\]) (\[a-z_\]*_symbol)(.*)" $got all type symbol rest]} {
- set vars($symbol) $type
- set got $rest
-}
+ set got [binutils_run $NM "$NMFLAGS $tempfile"]
-if {![info exists vars(text_symbol)] \
- || $vars(text_symbol) != "T" \
- || ![info exists vars(data_symbol)] \
- || $vars(data_symbol) != "D" \
- || ![info exists vars(common_symbol)] \
- || $vars(common_symbol) != "C" \
- || ![info exists vars(external_symbol)] \
- || $vars(external_symbol) != "U" \
- || ![info exists vars(static_text_symbol)] \
- || $vars(static_text_symbol) != "t" \
- || ![info exists vars(static_data_symbol)] \
- || $vars(static_data_symbol) != "d"} {
- fail "nm (no arguments)"
-} else {
- pass "nm (no arguments)"
-}
+ if [info exists vars] then { unset vars }
+ while {[regexp "(\[a-zA-Z\]) (\[a-z_\]*_symbol)(.*)" $got all type symbol rest]} {
+ set vars($symbol) $type
+ set got $rest
+ }
-# Test nm -g
+ if {![info exists vars(text_symbol)] \
+ || $vars(text_symbol) != "T" \
+ || ![info exists vars(data_symbol)] \
+ || $vars(data_symbol) != "D" \
+ || ![info exists vars(common_symbol)] \
+ || $vars(common_symbol) != "C" \
+ || ![info exists vars(external_symbol)] \
+ || $vars(external_symbol) != "U" \
+ || ![info exists vars(static_text_symbol)] \
+ || $vars(static_text_symbol) != "t" \
+ || ![info exists vars(static_data_symbol)] \
+ || $vars(static_data_symbol) != "d"} {
+ fail "nm (no arguments)"
+ } else {
+ pass "nm (no arguments)"
+ }
-set got [binutils_run $NM "$NMFLAGS -g $tempfile"]
+ # Test nm -g
-if [info exists vars] then { unset vars }
-while {[regexp "(\[a-z_\]*_symbol)(.*)" $got all symbol rest]} {
- set vars($symbol) 1
- set got $rest
-}
+ set got [binutils_run $NM "$NMFLAGS -g $tempfile"]
-if {![info exists vars(text_symbol)] \
- || ![info exists vars(data_symbol)] \
- || ![info exists vars(common_symbol)] \
- || ![info exists vars(external_symbol)] \
- || [info exists vars(static_text_symbol)] \
- || [info exists vars(static_data_symbol)]} {
- fail "nm -g"
-} else {
- pass "nm -g"
-}
+ if [info exists vars] then { unset vars }
+ while {[regexp "(\[a-z_\]*_symbol)(.*)" $got all symbol rest]} {
+ set vars($symbol) 1
+ set got $rest
+ }
-if [is_elf_format] {
- # PR binutils/12753
- # Test nm -g on a unique global symbol.
- if {![binutils_assemble $srcdir/$subdir/unique.s tmpdir/unique.o]} then {
- unsupported "nm -g on unique symbols"
+ if {![info exists vars(text_symbol)] \
+ || ![info exists vars(data_symbol)] \
+ || ![info exists vars(common_symbol)] \
+ || ![info exists vars(external_symbol)] \
+ || [info exists vars(static_text_symbol)] \
+ || [info exists vars(static_data_symbol)]} {
+ fail "nm -g"
} else {
- if [is_remote host] {
- set tmpfile [remote_download host tmpdir/unique.o]
- } else {
- set tmpfile tmpdir/unique.o
- }
-
- set got [binutils_run $NM "$NMFLAGS -g $tmpfile"]
-
- if [regexp "u foo" $got] then {
- pass "nm -g on unique symbols"
- } else {
- fail "nm -g on unique symbols"
- }
-
- if { $verbose < 1 } {
- remote_file host delete "tmpdir/unique.o"
- }
+ pass "nm -g"
}
-}
-# Test nm -P
+ # Test nm -P
-# This test does not work correctly on ECOFF targets, because ECOFF
-# stores most symbols twice, which messes up the nm output.
-setup_xfail "alpha*-*-osf*" "alpha*-*-netware*"
-setup_xfail "mips*-*-ultrix*" "mips*-*-ecoff*" "mips*-*-irix4*"
-setup_xfail "mips*-*-riscos*" "mips*-*-sysv3*" "mips*-sony-bsd*"
+ # This test does not work correctly on ECOFF targets, because ECOFF
+ # stores most symbols twice, which messes up the nm output.
+ setup_xfail "alpha*-*-osf*" "alpha*-*-netware*"
+ setup_xfail "mips*-*-ultrix*" "mips*-*-ecoff*" "mips*-*-irix4*"
+ setup_xfail "mips*-*-riscos*" "mips*-*-sysv3*" "mips*-sony-bsd*"
-# This test does not work correctly on XCOFF targets, because XCOFF
-# does not enter static symbols in the symbol table.
-setup_xfail "*-*-aix*"
+ # This test does not work correctly on XCOFF targets, because XCOFF
+ # does not enter static symbols in the symbol table.
+ setup_xfail "*-*-aix*"
-set got [binutils_run $NM "$NMFLAGS -P $tempfile"]
+ set got [binutils_run $NM "$NMFLAGS -P $tempfile"]
-set want "common_symbol C \[0\]*4.*data_symbol D \[0-9a-fA-F\]*.*external_symbol U.*static_data_symbol d \[0-9a-fA-F\]*.*static_text_symbol t \[0-9a-fA-F\]*.*text_symbol T \[0-9a-fA-F\]*"
+ set want "common_symbol C \[0\]*4.*data_symbol D \[0-9a-fA-F\]*.*external_symbol U.*static_data_symbol d \[0-9a-fA-F\]*.*static_text_symbol t \[0-9a-fA-F\]*.*text_symbol T \[0-9a-fA-F\]*"
-if [regexp $want $got] then {
- pass "nm -P"
-} else {
- fail "nm -P"
+ if [regexp $want $got] then {
+ pass "nm -P"
+ } else {
+ fail "nm -P"
+ }
}
# Test nm --size-sort
}
if {![binutils_assemble $srcdir/$subdir/$nm_1_src tmpdir/nm-1.o]} then {
- return
-}
-
-if [is_remote host] {
- set tempfile [remote_download host tmpdir/nm-1.o]
+ fail "nm --size-sort (assembling)"
} else {
- set tempfile tmpdir/nm-1.o
-}
-# This test does not work correctly on ECOFF targets, because ECOFF
-# stores most symbols twice, which messes up the nm output.
-setup_xfail "alpha*-*-osf*" "alpha*-*-netware*"
-setup_xfail "mips*-*-ultrix*" "mips*-*-ecoff*" "mips*-*-irix4*"
-setup_xfail "mips*-*-riscos*" "mips*-*-sysv3*" "mips*-sony-bsd*"
+ if [is_remote host] {
+ set tempfile [remote_download host tmpdir/nm-1.o]
+ } else {
+ set tempfile tmpdir/nm-1.o
+ }
-set got [binutils_run $NM "$NMFLAGS --size-sort $tempfile"]
+ # This test does not work correctly on ECOFF targets, because ECOFF
+ # stores most symbols twice, which messes up the nm output.
+ setup_xfail "alpha*-*-osf*" "alpha*-*-netware*"
+ setup_xfail "mips*-*-ultrix*" "mips*-*-ecoff*" "mips*-*-irix4*"
+ setup_xfail "mips*-*-riscos*" "mips*-*-sysv3*" "mips*-sony-bsd*"
-set want "0*4 T text_symbol3.*0*8 T text_symbol2.*0*c T text_symbol1"
+ set got [binutils_run $NM "$NMFLAGS --size-sort $tempfile"]
-if [regexp $want $got] then {
- pass "nm --size-sort"
-} else {
- fail "nm --size-sort"
+ set want "0*4 T text_symbol3.*0*8 T text_symbol2.*0*c T text_symbol1"
+
+ if [regexp $want $got] then {
+ pass "nm --size-sort"
+ } else {
+ fail "nm --size-sort"
+ }
}
if [is_elf_format] {
+ # PR binutils/12753
+ # Test nm -g on a unique global symbol.
+ if {![binutils_assemble $srcdir/$subdir/unique.s tmpdir/unique.o]} then {
+ unsupported "nm -g on unique symbols"
+ } else {
+ if [is_remote host] {
+ set tmpfile [remote_download host tmpdir/unique.o]
+ } else {
+ set tmpfile tmpdir/unique.o
+ }
+
+ set got [binutils_run $NM "$NMFLAGS -g $tmpfile"]
+
+ if [regexp "u foo" $got] then {
+ pass "nm -g on unique symbols"
+ } else {
+ fail "nm -g on unique symbols"
+ }
+
+ if { $verbose < 1 } {
+ remote_file host delete "tmpdir/unique.o"
+ }
+ }
+
# PR binutils/20751
# Test nm --with-symbol-versions
global copyfile
if {![binutils_assemble $srcdir/$subdir/${srcfile} $tempfile]} then {
- perror "unresolved $testname"
unresolved "objcopy ($testname)"
remote_file host delete $tempfile
return
if {![binutils_assemble $srcdir/$subdir/bintest.s tmpdir/bintest.o]} then {
+ fail "objdump (assembling)"
return
}
if {![binutils_assemble $srcdir/$subdir/bintest.s tmpdir/bintest2.o]} then {
+ fail "objdump (assembling)"
return
}
if [is_remote host] {
if {![binutils_assemble $srcdir/$subdir/bintest.s tmpdir/bintest.o]} then {
- return
-}
-
-if [is_remote host] {
- set testfile [remote_download host tmpdir/bintest.o]
+ fail "size (assembling)"
} else {
- set testfile tmpdir/bintest.o
-}
-set dec "\[0-9\]+"
-set hex "\[0-9a-fA-F\]+"
+ if [is_remote host] {
+ set testfile [remote_download host tmpdir/bintest.o]
+ } else {
+ set testfile tmpdir/bintest.o
+ }
-# Test size with no arguments
+ set dec "\[0-9\]+"
+ set hex "\[0-9a-fA-F\]+"
-set got [binutils_run $SIZE "$SIZEFLAGS $testfile"]
+ # Test size with no arguments
-set want "($dec)\[ \]+($dec)\[ \]+($dec)\[ \]+($dec)\[ \]+($hex)\[ \]+${testfile}"
+ set got [binutils_run $SIZE "$SIZEFLAGS $testfile"]
-if ![regexp $want $got all text data bss dtot hextot] then {
- fail "size (no arguments)"
-} else {
- if {$text < 8 || $data < 4} then {
- # The z80-coff port defaults to a "binary" like output
- # file format which does not include a data section.
- setup_xfail "z80-*-coff"
+ set want "($dec)\[ \]+($dec)\[ \]+($dec)\[ \]+($dec)\[ \]+($hex)\[ \]+${testfile}"
+
+ if ![regexp $want $got all text data bss dtot hextot] then {
fail "size (no arguments)"
} else {
- pass "size (no arguments)"
+ if {$text < 8 || $data < 4} then {
+ # The z80-coff port defaults to a "binary" like output
+ # file format which does not include a data section.
+ setup_xfail "z80-*-coff"
+ fail "size (no arguments)"
+ } else {
+ pass "size (no arguments)"
+ }
}
-}
-# Test size -A
+ # Test size -A
-set got [binutils_run $SIZE "$SIZEFLAGS -A ${testfile}"]
+ set got [binutils_run $SIZE "$SIZEFLAGS -A ${testfile}"]
-set want "${testfile}.*(text|TEXT|P)\[^\n\r\]*\[ \]($dec)\[ \]+$dec.*(\\.data|DATA|D_1)\[^\n\r\]*\[ \]($dec)\[ \]+$dec"
+ set want "${testfile}.*(text|TEXT|P)\[^\n\r\]*\[ \]($dec)\[ \]+$dec.*(\\.data|DATA|D_1)\[^\n\r\]*\[ \]($dec)\[ \]+$dec"
-if ![regexp $want $got all textname textsize dataname datasize] then {
- fail "size -A"
-} else {
- verbose "text size: $textsize"
- verbose "data size: $datasize"
- if {$textsize < 8 || $datasize < 4} then {
+ if ![regexp $want $got all textname textsize dataname datasize] then {
fail "size -A"
} else {
- pass "size -A"
+ verbose "text size: $textsize"
+ verbose "data size: $datasize"
+ if {$textsize < 8 || $datasize < 4} then {
+ fail "size -A"
+ } else {
+ pass "size -A"
+ }
}
}
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]
+ fail "entrymask test (assembling)"
} else {
- set objfile tmpdir/entrymask.o
-}
-#
-# We check both function entry points. The second one at offset 2 will
-# show up automatically on ELF targets, but needs to be set on a.out
-# targets.
-#
-set got [binutils_run $OBJDUMP "$OBJDUMPFLAGS -d -M entry:0x0 -M entry:2 $objfile"]
-set want1 "\[ \]+0:\[ \]+10 01\[ \]+\\.word 0x0110.\*r8 r4"
-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"
+ if [is_remote host] {
+ set objfile [remote_download host tmpdir/entrymask.o]
+ } else {
+ set objfile tmpdir/entrymask.o
+ }
+
+ #
+ # We check both function entry points. The second one at offset 2 will
+ # show up automatically on ELF targets, but needs to be set on a.out
+ # targets.
+ #
+ set got [binutils_run $OBJDUMP "$OBJDUMPFLAGS -d -M entry:0x0 -M entry:2 $objfile"]
+ set want1 "\[ \]+0:\[ \]+10 01\[ \]+\\.word 0x0110.\*r8 r4"
+ 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"
+ }
}