OpenCores
URL https://opencores.org/ocsvn/openrisc_me/openrisc_me/trunk

Subversion Repositories openrisc_me

[/] [openrisc/] [trunk/] [gnu-src/] [binutils-2.18.50/] [binutils/] [testsuite/] [binutils-all/] [size.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, 1998, 2007 Free Software Foundation, Inc.
#   Copyright 1993, 1994, 1995, 1997, 1998, 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 $SIZE] == 0} then {
    if {[which $SIZE] == 0} then {
        perror "$SIZE does not exist"
        perror "$SIZE does not exist"
        return
        return
    }
    }
}
}
send_user "Version [binutil_version $SIZE]"
send_user "Version [binutil_version $SIZE]"
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 testfile [remote_download host tmpdir/bintest.o]
    set testfile [remote_download host tmpdir/bintest.o]
} else {
} else {
    set testfile tmpdir/bintest.o
    set testfile tmpdir/bintest.o
}
}
set dec "\[0-9\]+"
set dec "\[0-9\]+"
set hex "\[0-9a-fA-F\]+"
set hex "\[0-9a-fA-F\]+"
# Test size with no arguments
# Test size with no arguments
set got [binutils_run $SIZE "$SIZEFLAGS $testfile"]
set got [binutils_run $SIZE "$SIZEFLAGS $testfile"]
set want "($dec)\[      \]+($dec)\[     \]+($dec)\[     \]+($dec)\[     \]+($hex)\[     \]+${testfile}"
set want "($dec)\[      \]+($dec)\[     \]+($dec)\[     \]+($dec)\[     \]+($hex)\[     \]+${testfile}"
if ![regexp $want $got all text data bss dtot hextot] then {
if ![regexp $want $got all text data bss dtot hextot] then {
    fail "size (no arguments)"
    fail "size (no arguments)"
} else {
} else {
    if {$text < 8 || $data < 4} then {
    if {$text < 8 || $data < 4} then {
        # The z80-coff port defaults to a "binary" like output
        # The z80-coff port defaults to a "binary" like output
        # file format which does not include a data section.
        # file format which does not include a data section.
        setup_xfail "z80-*-coff"
        setup_xfail "z80-*-coff"
        fail "size (no arguments)"
        fail "size (no arguments)"
    } else {
    } else {
        pass "size (no arguments)"
        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)\[^\n\r\]*\[  \]($dec)\[      \]+$dec.*(\\.data|DATA)\[^\n\r\]*\[     \]($dec)\[      \]+$dec"
set want "${testfile}.*(text|TEXT)\[^\n\r\]*\[  \]($dec)\[      \]+$dec.*(\\.data|DATA)\[^\n\r\]*\[     \]($dec)\[      \]+$dec"
if ![regexp $want $got all textname textsize dataname datasize] then {
if ![regexp $want $got all textname textsize dataname datasize] then {
    fail "size -A"
    fail "size -A"
} else {
} else {
    verbose "text size: $textsize"
    verbose "text size: $textsize"
    verbose "data size: $datasize"
    verbose "data size: $datasize"
    if {$textsize < 8 || $datasize < 4} then {
    if {$textsize < 8 || $datasize < 4} then {
        fail "size -A"
        fail "size -A"
    } else {
    } else {
        pass "size -A"
        pass "size -A"
    }
    }
}
}
 
 

powered by: WebSVN 2.1.0

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