aboutsummaryrefslogtreecommitdiff
path: root/ld/testsuite/lib
diff options
context:
space:
mode:
authorAlan Modra <amodra@gmail.com>2020-06-20 15:53:37 +0930
committerAlan Modra <amodra@gmail.com>2020-06-20 15:53:37 +0930
commit348fe36b1d64f12c60e08f6313520b3191663063 (patch)
tree0ba7dba17349d8877b3c73e1685405e8933f660a /ld/testsuite/lib
parentb0ee49d21ba0c4b7f9817db01dc247255eebd516 (diff)
downloadgdb-348fe36b1d64f12c60e08f6313520b3191663063.zip
gdb-348fe36b1d64f12c60e08f6313520b3191663063.tar.gz
gdb-348fe36b1d64f12c60e08f6313520b3191663063.tar.bz2
Remove perror from ld_assemble, ld_compile and ld_nm
ERROR should really be reserved for errors in the testsuite framework, not just normal errors from the tools under test. Removing use of perror has been suggested before but without action, over concerns that some test failures might be missed. This patch removes uses of perror in ld_assemble, ld_compile and ld_nm, and updates numerous places that ignored the result of these functions by inappropriately returning an "unresolved" test status. Net result over my large set of targets look good, in some cases improving the diagnostics, eg: i386-msdos -ERROR: tmpdir/script: nm failed i386-msdos -ERROR: tmpdir/script: nm failed i386-msdos -ERROR: tmpdir/script: nm failed i386-msdos -ERROR: tmpdir/script: nm failed i386-msdos +FAIL: script i386-msdos +FAIL: MRI script i386-msdos +FAIL: MEMORY i386-msdos +FAIL: MEMORY with symbols * testsuite/lib/ld-lib.exp (default_ld_compile): Don't perror on a compiler error. (default_ld_assemble): Similarly for an assembler error. (default_ld_nm): Similarly for an nm error. (run_ld_link_tests): Report ld_assemble errors as a fail. (check_as_cfi): Remove now unnecessary perror substitution. * testsuite/ld-elf/exclude.exp: Report ld_nm error return as test fails rather then unresolved. * testsuite/ld-gc/gc.exp: Likewise. * testsuite/ld-scripts/alignof.exp: Likewise. * testsuite/ld-scripts/defined.exp: Likewise. * testsuite/ld-scripts/script.exp: Likewise. * testsuite/ld-scripts/sizeof.exp: Likewise. * testsuite/ld-selective/selective.exp: Likewise. * testsuite/ld-scripts/extern.exp: Likewise. Return on ld_link failure. * testsuite/ld-elfweak/elfweak.exp: Report compiler errors as test unresolved. * testsuite/ld-fastcall/fastcall.exp: Report assember errors as test fails. * testsuite/ld-i386/i386.exp (iamcu_tests): Likewise. * testsuite/ld-ia64/line.exp: Likewise. * testsuite/ld-mep/mep.exp: Likewise. * testsuite/ld-mips-elf/mips-elf-flags.exp: Likewise. * testsuite/ld-nios2/nios2.exp: Likewise. * testsuite/ld-scripts/alignof.exp: Likewise. * testsuite/ld-x86-64/line.exp: Likewise. * testsuite/ld-x86-64/x86-64.exp: Likewise. * testsuite/ld-scripts/log2.exp: Formatting. * testsuite/ld-tic6x/tic6x.exp: Report ld_link errors as a test fail.
Diffstat (limited to 'ld/testsuite/lib')
-rw-r--r--ld/testsuite/lib/ld-lib.exp14
1 files changed, 6 insertions, 8 deletions
diff --git a/ld/testsuite/lib/ld-lib.exp b/ld/testsuite/lib/ld-lib.exp
index 0a256c2..8d851a9 100644
--- a/ld/testsuite/lib/ld-lib.exp
+++ b/ld/testsuite/lib/ld-lib.exp
@@ -289,7 +289,6 @@ proc default_ld_compile { cc source object } {
return 1
} else {
verbose -log "$exec_output"
- perror "$source: compilation failed"
return 0
}
}
@@ -310,7 +309,6 @@ proc default_ld_assemble { as in_flags source object } {
if [string match "" $exec_output] then {
return 1
} else {
- perror "$source: assembly failed"
return 0
}
}
@@ -361,7 +359,6 @@ proc default_ld_nm { nm nmflags object } {
return 1
} else {
verbose -log "$exec_output"
- perror "$object: nm failed"
return 0
}
}
@@ -520,12 +517,17 @@ proc run_ld_link_tests { ldtests args } {
set as_file "$srcdir/$subdir/$src_file"
}
if ![ld_assemble $as "$as_options $as_file" $objfile] {
- set is_unresolved 1
+ set failed 1
break
}
}
# Catch assembler errors.
+ if { $failed } {
+ fail $testname
+ continue
+ }
+ # Catch compiler errors.
if { $is_unresolved } {
unresolved $testname
continue
@@ -1367,11 +1369,7 @@ proc check_as_cfi { } {
close $as_fh
remote_download host $as_file
verbose -log "Checking CFI support:"
- rename "perror" "check_as_cfi_perror"
- proc perror { args } { }
set success [ld_assemble $as $as_file "/dev/null"]
- rename "perror" ""
- rename "check_as_cfi_perror" "perror"
#remote_file host delete $as_file
set check_as_cfi_result $success
return $success