OpenCores
URL https://opencores.org/ocsvn/openrisc_2011-10-31/openrisc_2011-10-31/trunk

Subversion Repositories openrisc_2011-10-31

[/] [openrisc/] [trunk/] [gnu-src/] [binutils-2.18.50/] [binutils/] [testsuite/] [binutils-all/] [nm.exp] - Diff between revs 38 and 156

Only display areas with differences | Details | Blame | View Log

Rev 38 Rev 156
#   Copyright 1993, 1994, 1995, 1997, 2007 Free Software Foundation, Inc.
#   Copyright 1993, 1994, 1995, 1997, 2007 Free Software Foundation, Inc.
# This program is free software; you can redistribute it and/or modify
# 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
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3 of the License, or
# the Free Software Foundation; either version 3 of the License, or
# (at your option) any later version.
# (at your option) any later version.
#
#
# This program is distributed in the hope that it will be useful,
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
# GNU General Public License for more details.
#
#
# You should have received a copy of the GNU General Public License
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA.
# Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA.
# Please email any bugs, comments, and/or additions to this file to:
# Please email any bugs, comments, and/or additions to this file to:
# bug-dejagnu@prep.ai.mit.edu
# bug-dejagnu@prep.ai.mit.edu
# This file was written by Rob Savoye 
# This file was written by Rob Savoye 
# and rewritten by Ian Lance Taylor 
# and rewritten by Ian Lance Taylor 
if ![is_remote host] {
if ![is_remote host] {
    if {[which $NM] == 0} then {
    if {[which $NM] == 0} then {
        perror "$NM does not exist"
        perror "$NM does not exist"
        return
        return
    }
    }
}
}
send_user "Version [binutil_version $NM]"
send_user "Version [binutil_version $NM]"
if {![binutils_assemble $srcdir/$subdir/bintest.s tmpdir/bintest.o]} then {
if {![binutils_assemble $srcdir/$subdir/bintest.s tmpdir/bintest.o]} then {
    return
    return
}
}
if [is_remote host] {
if [is_remote host] {
    set tempfile [remote_download host tmpdir/bintest.o]
    set tempfile [remote_download host tmpdir/bintest.o]
} else {
} else {
    set tempfile tmpdir/bintest.o
    set tempfile tmpdir/bintest.o
}
}
# Test nm with no arguments.
# Test nm with no arguments.
# This test does not work correctly on ECOFF targets, because ECOFF
# This test does not work correctly on ECOFF targets, because ECOFF
# stores most symbols twice, which messes up the nm output.
# stores most symbols twice, which messes up the nm output.
setup_xfail "alpha*-*-osf*" "alpha*-*-netware*"
setup_xfail "alpha*-*-osf*" "alpha*-*-netware*"
setup_xfail "mips*-*-ultrix*" "mips*-*-ecoff*" "mips*-*-irix4*"
setup_xfail "mips*-*-ultrix*" "mips*-*-ecoff*" "mips*-*-irix4*"
setup_xfail "mips*-*-riscos*" "mips*-*-sysv3*" "mips*-sony-bsd*"
setup_xfail "mips*-*-riscos*" "mips*-*-sysv3*" "mips*-sony-bsd*"
# This test does not work correctly on XCOFF targets, because XCOFF
# This test does not work correctly on XCOFF targets, because XCOFF
# does not enter static symbols in the symbol table.
# does not enter static symbols in the symbol table.
setup_xfail "*-*-aix*"
setup_xfail "*-*-aix*"
set got [binutils_run $NM "$NMFLAGS $tempfile"]
set got [binutils_run $NM "$NMFLAGS $tempfile"]
if [info exists vars] then { unset vars }
if [info exists vars] then { unset vars }
while {[regexp "(\[a-zA-Z\]) (\[a-z_\]*_symbol)(.*)" $got all type symbol rest]} {
while {[regexp "(\[a-zA-Z\]) (\[a-z_\]*_symbol)(.*)" $got all type symbol rest]} {
    set vars($symbol) $type
    set vars($symbol) $type
    set got $rest
    set got $rest
}
}
if {![info exists vars(text_symbol)] \
if {![info exists vars(text_symbol)] \
     || $vars(text_symbol) != "T" \
     || $vars(text_symbol) != "T" \
     || ![info exists vars(data_symbol)] \
     || ![info exists vars(data_symbol)] \
     || $vars(data_symbol) != "D" \
     || $vars(data_symbol) != "D" \
     || ![info exists vars(common_symbol)] \
     || ![info exists vars(common_symbol)] \
     || $vars(common_symbol) != "C" \
     || $vars(common_symbol) != "C" \
     || ![info exists vars(external_symbol)] \
     || ![info exists vars(external_symbol)] \
     || $vars(external_symbol) != "U" \
     || $vars(external_symbol) != "U" \
     || ![info exists vars(static_text_symbol)] \
     || ![info exists vars(static_text_symbol)] \
     || $vars(static_text_symbol) != "t" \
     || $vars(static_text_symbol) != "t" \
     || ![info exists vars(static_data_symbol)] \
     || ![info exists vars(static_data_symbol)] \
     || $vars(static_data_symbol) != "d"} {
     || $vars(static_data_symbol) != "d"} {
    fail "nm (no arguments)"
    fail "nm (no arguments)"
} else {
} else {
    pass "nm (no arguments)"
    pass "nm (no arguments)"
}
}
# Test nm -g
# Test nm -g
set got [binutils_run $NM "$NMFLAGS -g $tempfile"]
set got [binutils_run $NM "$NMFLAGS -g $tempfile"]
if [info exists vars] then { unset vars }
if [info exists vars] then { unset vars }
while {[regexp "(\[a-z_\]*_symbol)(.*)" $got all symbol rest]} {
while {[regexp "(\[a-z_\]*_symbol)(.*)" $got all symbol rest]} {
    set vars($symbol) 1
    set vars($symbol) 1
    set got $rest
    set got $rest
}
}
if {![info exists vars(text_symbol)] \
if {![info exists vars(text_symbol)] \
     || ![info exists vars(data_symbol)] \
     || ![info exists vars(data_symbol)] \
     || ![info exists vars(common_symbol)] \
     || ![info exists vars(common_symbol)] \
     || ![info exists vars(external_symbol)] \
     || ![info exists vars(external_symbol)] \
     || [info exists vars(static_text_symbol)] \
     || [info exists vars(static_text_symbol)] \
     || [info exists vars(static_data_symbol)]} {
     || [info exists vars(static_data_symbol)]} {
    fail "nm -g"
    fail "nm -g"
} else {
} else {
    pass "nm -g"
    pass "nm -g"
}
}
# Test nm -P
# Test nm -P
# This test does not work correctly on ECOFF targets, because ECOFF
# This test does not work correctly on ECOFF targets, because ECOFF
# stores most symbols twice, which messes up the nm output.
# stores most symbols twice, which messes up the nm output.
setup_xfail "alpha*-*-osf*" "alpha*-*-netware*"
setup_xfail "alpha*-*-osf*" "alpha*-*-netware*"
setup_xfail "mips*-*-ultrix*" "mips*-*-ecoff*" "mips*-*-irix4*"
setup_xfail "mips*-*-ultrix*" "mips*-*-ecoff*" "mips*-*-irix4*"
setup_xfail "mips*-*-riscos*" "mips*-*-sysv3*" "mips*-sony-bsd*"
setup_xfail "mips*-*-riscos*" "mips*-*-sysv3*" "mips*-sony-bsd*"
# This test does not work correctly on XCOFF targets, because XCOFF
# This test does not work correctly on XCOFF targets, because XCOFF
# does not enter static symbols in the symbol table.
# does not enter static symbols in the symbol table.
setup_xfail "*-*-aix*"
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 {
if [regexp $want $got] then {
    pass "nm -P"
    pass "nm -P"
} else {
} else {
    fail "nm -P"
    fail "nm -P"
}
}
# There are certainly other tests that could be run.
# There are certainly other tests that could be run.
 
 

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.