2010-03-31 Hans-Peter Nilsson <hp@axis.com>
+ * lib/ld-lib.exp (run_dump_test): When checking linker message and
+ return code, when success with no message is expected, don't
+ continue if we have an abnormal exit with a message. Check output
+ of inspection program and fail if it had output or an abnormal
+ exit code. Include "warning" and "error" among the directives
+ where multiples are allowed and append to previous values.
+
* ld-cris/cris.exp (loop over $srcdir/$subdir/*dso-*.d): Apply
"file rootname", not "file tail", before applying runtest_file_p.
# error: REGEX
# An error with message matching REGEX must be emitted for the test
# to pass. The PROG, objdump, nm and objcopy options have no
-# meaning and need not supplied if this is present.
+# meaning and need not supplied if this is present. Multiple "error"
+# directives append to the expected linker error message.
#
# warning: REGEX
# Expect a linker warning matching REGEX. It is an error to issue
-# both "error" and "warning".
+# both "error" and "warning". Multiple "warning" directives
+# append to the expected linker warning message.
#
# Each option may occur at most once unless otherwise mentioned.
#
xfail {}
target {}
notarget {}
+ warning {}
+ error {}
source {
# Move any source-specific as-flags to a separate array to
# simplify processing.
send_log "$comp_output\n"
verbose "$comp_output" 3
- if { [regexp $expmsg $comp_output] \
- && (($cmdret == 0) == ($opts(warning) != "")) } {
+ if { ($expmsg == "") == ($comp_output == "") \
+ && [regexp $expmsg $comp_output] \
+ && (($cmdret == 0) == ($opts(error) == "")) } {
# We have the expected output from ld.
if { $opts(error) != "" || $program == "" } {
pass $testname
set env(LC_ALL) "C"
send_log "$cmd\n"
set cmdret [remote_exec host [concat sh -c [list "$cmd 2>ld.tmp"]] "" "/dev/null"]
+ set cmdret [lindex $cmdret 0]
remote_upload host "ld.tmp"
set comp_output [prune_warnings [file_contents "ld.tmp"]]
remote_file host delete "ld.tmp"
} else {
unset env(LC_ALL)
}
- if ![string match "" $comp_output] then {
- send_log "$comp_output\n"
+ if { $cmdret != 0 || $comp_output != "" } {
+ send_log "exited abnormally with $cmdret, output:$comp_output\n"
fail $testname
return
}