ld/testing: Fix error and warning checks in run_dump_test

The options warning_output and error_output to the run_dump_test
function were incorrectly checking the return value from the regexp_diff
function, and so, as a result failing tests were showing as a pass.
Fixed in this commit.

ld/ChangeLog:

	* testsuite/lib/ld-lib.exp (run_dump_test): Fix check of return
	value from regexp_diff.
	* testsuite/ld-elf/orphan-5.l: Fix expected output.
	* testsuite/ld-elf/orphan-6.l: Likewise.
This commit is contained in:
Andrew Burgess 2016-03-30 14:34:34 +01:00
parent fb3f3d25c3
commit 62bdf2d66e
4 changed files with 12 additions and 5 deletions

View File

@ -1,3 +1,10 @@
2016-03-30 Andrew Burgess <andrew.burgess@embecosm.com>
* testsuite/lib/ld-lib.exp (run_dump_test): Fix check of return
value from regexp_diff.
* testsuite/ld-elf/orphan-5.l: Fix expected output.
* testsuite/ld-elf/orphan-6.l: Likewise.
2016-03-30 Alan Modra <amodra@gmail.com>
PR 18452

View File

@ -1,5 +1,5 @@
#...
.*warning: orphan section `\.notbad' from `tmpdir/orphan\.o' being placed in section `\.notbad'\.
.*warning: orphan section `\.notbad' from `tmpdir/.*\.o' being placed in section `\.notbad'\.
#...
.*warning: orphan section `\.note\.bar' from `tmpdir/orphan\.o' being placed in section `\.note\.bar'\.
.*warning: orphan section `\.note\.bar' from `tmpdir/.*\.o' being placed in section `\.note\.bar'\.
#...

View File

@ -1,5 +1,5 @@
#...
.*error: unplaced orphan section `\.notbad' from `tmpdir/orphan\.o'\.
.*error: unplaced orphan section `\.notbad' from `tmpdir/.*\.o'\.
#...
.*error: unplaced orphan section `\.note\.bar' from `tmpdir/orphan\.o'\.
.*error: unplaced orphan section `\.note\.bar' from `tmpdir/.*\.o'\.
#...

View File

@ -975,7 +975,7 @@ proc run_dump_test { name {extra_options {}} } {
&& ($check_ld(regex) == "") == ($comp_output == "") \
&& [regexp $check_ld(regex) $comp_output]) \
|| (($check_ld(source) == "file") \
&& ([regexp_diff "tmpdir/ld.messages" "$srcdir/$subdir/$check_ld(file)"]))) } {
&& (![regexp_diff "tmpdir/ld.messages" "$srcdir/$subdir/$check_ld(file)"]))) } {
# We have the expected output from ld.
if { $check_ld(terminal) || $program == "" } {
pass $testname