96037eb0b8
* testsuite/binutils-all/ar.exp: Skip tests for Alpha target. Skip bfdtest1 tests for tic30 target. * testsuite/binutils-all/arm/objdump.exp: Skip for aout arm target. * testsuite/binutils-all/compress.exp: Expect some tests to fail on the nds32. * testsuite/binutils-all/copy-3.d: Skip for go32 targets. * testsuite/binutils-all/copy-4.d: Skip for AIX and linuxecoff targets. * testsuite/binutils-all/nm.exp: Treat beos based targets as ELF targets. * testsuite/binutils-all/objcopy.exp: Only run reverse bytes tests if the bintest.o file was created. Use the get_standard_section_names proc to get the name of the data section. * testsuite/binutils-all/objdump.exp: Update regexps to allow for RX section names. * testsuite/binutils-all/readelf.exp: Use get_standard_section_names proc to get the name of the data section. * testsuite/binutils-all/readelf.r: Allow for non standard text section names. * testsuite/binutils-all/readelf.s: Update regexps for tilepro. * testsuite/binutils-all/size.exp: Allow for non standard section names. * testsuite/binutils-all/update-section.exp: Expect comapre 1vs4 to fail on mips targets. * testsuite/lib/utils-lib.exp (default_binutils_run): Use get_standard_section_names proc. (run_dump_test): Likewise. (proc get_standard_section_names): New proc.
81 lines
2.3 KiB
Text
81 lines
2.3 KiB
Text
# Copyright (C) 1993-2016 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 3 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., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA.
|
|
|
|
# Please email any bugs, comments, and/or additions to this file to:
|
|
# bug-dejagnu@prep.ai.mit.edu
|
|
|
|
# This file was written by Rob Savoye <rob@cygnus.com>
|
|
# and rewritten by Ian Lance Taylor <ian@cygnus.com>
|
|
|
|
if ![is_remote host] {
|
|
if {[which $SIZE] == 0} then {
|
|
perror "$SIZE does not exist"
|
|
return
|
|
}
|
|
}
|
|
|
|
send_user "Version [binutil_version $SIZE]"
|
|
|
|
|
|
if {![binutils_assemble $srcdir/$subdir/bintest.s tmpdir/bintest.o]} then {
|
|
return
|
|
}
|
|
|
|
if [is_remote host] {
|
|
set testfile [remote_download host tmpdir/bintest.o]
|
|
} else {
|
|
set testfile tmpdir/bintest.o
|
|
}
|
|
|
|
set dec "\[0-9\]+"
|
|
set hex "\[0-9a-fA-F\]+"
|
|
|
|
# Test size with no arguments
|
|
|
|
set got [binutils_run $SIZE "$SIZEFLAGS $testfile"]
|
|
|
|
set want "($dec)\[ \]+($dec)\[ \]+($dec)\[ \]+($dec)\[ \]+($hex)\[ \]+${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"
|
|
fail "size (no arguments)"
|
|
} else {
|
|
pass "size (no arguments)"
|
|
}
|
|
}
|
|
|
|
# Test size -A
|
|
|
|
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"
|
|
|
|
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 {
|
|
fail "size -A"
|
|
} else {
|
|
pass "size -A"
|
|
}
|
|
}
|