From: Ian Lance Taylor Date: Tue, 24 Jan 1995 20:16:49 +0000 (+0000) Subject: * ld-bootstrap/bootstrap.exp: If not in the ld build directory, X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=2a056eaff2d9280f56abe59343f57f28b0505f5b;p=binutils-gdb.git * ld-bootstrap/bootstrap.exp: If not in the ld build directory, call untested for each test, rather than ignoring it. If one test fails, go on to the next one instead of returning. * ld-cdtest/cdtest.exp: If compilations fail, mark tests as unresolved. * ld-empic/empic.exp: Likewise. Also, always pass the same test name to pass or fail. * ld-shared/shared.exp: Likewise. Also, always run all tests. * ld-scripts/defined.exp: If as or nm fail, mark test as unresolved. Always pass the same test name to pass or fail. * ld-scripts/script.exp: Likewise. * ld-scripts/sizeof.exp: Likewise. --- diff --git a/ld/testsuite/ld-empic/empic.exp b/ld/testsuite/ld-empic/empic.exp index a103cb31ea1..9cc1b07bd24 100644 --- a/ld/testsuite/ld-empic/empic.exp +++ b/ld/testsuite/ld-empic/empic.exp @@ -1,5 +1,5 @@ # Expect script for ld-empic tests -# Copyright (C) 1994 Free Software Foundation +# Copyright (C) 1994,1995 Free Software Foundation # # This file is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -23,27 +23,26 @@ # embedded PIC is a GNU enhancement to standard MIPS tools. # Embedded PIC is only supported for MIPS ECOFF targets. -if ![istarget mips*-*-ecoff*] { return } +if ![istarget mips*-*-ecoff*] { + return +} + +set testname relax # Test that relaxation works correctly. This testsuite was composed # (by experimentation) to force the linker to relax twice--that is, # the first relaxation pass will force another call to be out of # range, requiring a second relaxation pass. -if ![ld_compile "$CC $CFLAGS -membedded-pic" $srcdir$subdir/relax1.c tmpdir/relax1.o] { - return -} -if ![ld_compile "$CC $CFLAGS -membedded-pic" $srcdir$subdir/relax2.c tmpdir/relax2.o] { - return -} -if ![ld_compile "$CC $CFLAGS -membedded-pic" $srcdir$subdir/relax3.c tmpdir/relax3.o] { - return -} -if ![ld_compile "$CC $CFLAGS -membedded-pic" $srcdir$subdir/relax4.c tmpdir/relax4.o] { +if { ![ld_compile "$CC $CFLAGS -membedded-pic" $srcdir$subdir/relax1.c tmpdir/relax1.o] + || ![ld_compile "$CC $CFLAGS -membedded-pic" $srcdir$subdir/relax2.c tmpdir/relax2.o] + || ![ld_compile "$CC $CFLAGS -membedded-pic" $srcdir$subdir/relax3.c tmpdir/relax3.o] + || ![ld_compile "$CC $CFLAGS -membedded-pic" $srcdir$subdir/relax4.c tmpdir/relax4.o] } { + unresolved $testname return } if ![ld_simple_link $ld tmpdir/relax "--relax -T $srcdir$subdir/relax.t tmpdir/relax1.o tmpdir/relax2.o tmpdir/relax3.o tmpdir/relax4.o"] { - fail relax + fail $testname } else { # Check that the relaxation produced the correct result. Check # each bal instruction. Some will go directly to the start of a @@ -57,6 +56,7 @@ if ![ld_simple_link $ld tmpdir/relax "--relax -T $srcdir$subdir/relax.t tmpdir/r # Get the symbol table. if ![ld_nm $nm tmpdir/relax] { + unresolved $testname return } @@ -67,7 +67,7 @@ if ![ld_simple_link $ld tmpdir/relax "--relax -T $srcdir$subdir/relax.t tmpdir/r if ![string match "" $exec_output] { send_log "$exec_output\n" verbose $exec_output - perror "tmpdir/relax: objdump failed" + unresolved $testname return } @@ -86,6 +86,7 @@ if ![ld_simple_link $ld tmpdir/relax "--relax -T $srcdir$subdir/relax.t tmpdir/r if ![regexp "^(\[0-9a-fA-F\]+) (<\[a-z+0-9A-Z\]+>)? bal (\[0-9a-fA-F\]+)" $line whole addr label dest] { perror "unrecognized format for $line" + unresolved $testname return } @@ -94,7 +95,7 @@ if ![ld_simple_link $ld tmpdir/relax "--relax -T $srcdir$subdir/relax.t tmpdir/r # this example are to either foo or bar. if "0x$dest != $nm_output(foo) && 0x$dest != $nm_output(bar)" { send_log "$line\n" - fail "relax (bad direct function call)" + fail $testname return } } else { @@ -104,7 +105,7 @@ if ![ld_simple_link $ld tmpdir/relax "--relax -T $srcdir$subdir/relax.t tmpdir/r # should be an addiu, followed by an addu to $31. if { [gets $file l] == -1 } { send_log "$line\n" - fail "relax (unexpected EOF after bal)" + fail $testname return } verbose $l @@ -115,13 +116,13 @@ if ![ld_simple_link $ld tmpdir/relax "--relax -T $srcdir$subdir/relax.t tmpdir/r if ![regexp "lui (\[\$a-z0-9\]+),(\[0-9\]+)" $l whole reg upper] { send_log "$line\n" send_log "$l\n" - fail "relax (could not find expected lui)" + fail $testname return } if { [gets $file l] == -1 } { send_log "$line\n" - fail "relax (unexpected EOF after lui)" + fail $testname return } verbose "$l" @@ -129,20 +130,20 @@ if ![ld_simple_link $ld tmpdir/relax "--relax -T $srcdir$subdir/relax.t tmpdir/r send_log "$line\n" send_log "$l\n" send_log "addiu \\$reg,\\$reg,(\[-0-9\]+)\n" - fail "relax (could not find expected addiu)" + fail $testname return } if { [gets $file l] == -1 } { send_log "$line\n" - fail "relax (unexpected EOF after addiu)" + fail $testname return } verbose "$l" if ![regexp "addu \\$reg,\\$reg,\\\$ra" $l] { send_log "$line\n" send_log "$l\n" - fail "relax (could not find expected addu)" + fail $testname return } @@ -152,7 +153,7 @@ if ![ld_simple_link $ld tmpdir/relax "--relax -T $srcdir$subdir/relax.t tmpdir/r if { [gets $file l] == -1 } { send_log "$line\n" - fail "relax (unexpected EOF after addu)" + fail $testname return } @@ -160,19 +161,19 @@ if ![ld_simple_link $ld tmpdir/relax "--relax -T $srcdir$subdir/relax.t tmpdir/r set dest [expr 0x$addr + 8 + ($upper << 16) + $lower] if { $dest != $nm_output(foo) && $dest != $nm_output(bar) } { send_log "$line\n" - fail "relax (bad expanded function call)" + fail $testname return } } else { set dest [expr ($upper << 16) + $lower] if ![regexp "<\[a-z\]+\\+(\[0-9a-fA-F\]+)>" $label whole offset] { send_log "$line\n" - fail "relax (unrecognized label)" + fail $testname return } if "0x$offset + 8 != - $dest" { send_log "$line\n" - fail "relax (bad function start: 0x$offset + 8 != - $dest)" + fail $testname return } } @@ -182,10 +183,10 @@ if ![ld_simple_link $ld tmpdir/relax "--relax -T $srcdir$subdir/relax.t tmpdir/r close $file if {$balcnt < 10} { - fail "relax (not enough branches)" + fail $testname } else { verbose "$balcnt bal instructions" - pass relax + pass $testname } } @@ -201,6 +202,8 @@ if [istarget mipsel-*-*] { } } +set testname "run embedded PIC code" + # Compile the program which will run the test. This code must be # compiled for the host, not the target. send_log "$CC_FOR_HOST $CFLAGS_FOR_HOST -o tmpdir/run $srcdir$subdir/run.c\n" @@ -209,22 +212,19 @@ catch "exec $CC_FOR_HOST $CFLAGS_FOR_HOST -o tmpdir/run $srcdir$subdir/run.c" ex if ![string match "" $exec_output] { send_log "$exec_output\n" verbose "$exec_output" - perror "$srcdir$subdir/run.c: compilation failed" + unresolved $testname return } # Compile and link the test. -if ![ld_compile "$CC $CFLAGS -membedded-pic" $srcdir$subdir/runtesti.s tmpdir/runtesti.o] { - return -} -if ![ld_compile "$CC $CFLAGS -membedded-pic" $srcdir$subdir/runtest1.c tmpdir/runtest1.o] { - return -} -if ![ld_compile "$CC $CFLAGS -membedded-pic" $srcdir$subdir/runtest2.c tmpdir/runtest2.o] { +if { ![ld_compile "$CC $CFLAGS -membedded-pic" $srcdir$subdir/runtesti.s tmpdir/runtesti.o] + || ![ld_compile "$CC $CFLAGS -membedded-pic" $srcdir$subdir/runtest1.c tmpdir/runtest1.o] + || ![ld_compile "$CC $CFLAGS -membedded-pic" $srcdir$subdir/runtest2.c tmpdir/runtest2.o] } { + unresolved $testname return } if ![ld_simple_link $ld tmpdir/runtest "--embedded-relocs tmpdir/runtesti.o tmpdir/runtest1.o tmpdir/runtest2.o"] { - fail "run embedded PIC code (link)" + fail $testname } else { # Now run the test. send_log "tmpdir/run tmpdir/runtest\n" @@ -233,10 +233,10 @@ if ![ld_simple_link $ld tmpdir/runtest "--embedded-relocs tmpdir/runtesti.o tmpd if [string match "*ran and returned 0*" $exec_output] { send_log "$exec_output\n" verbose "$exec_output" - pass "run embedded PIC code" + pass $testname } else { send_log "$exec_output\n" verbose "$exec_output" - fail "run embedded PIC code" + fail $testname } }