On Tue, Nov 11, 2014 at 04:51:38PM +0000, Jiong Wang wrote:
> currently, only sanitizer tess (asan/tsan/ubsan) and a couple of fortran test
> will invoke dg-output.
>
> pass x86-64 c/c++ regression.
> pass aarch64-none-linux-gnu c/c++ regression.
This patch broke a few tests in ubsan.exp. The reason is that...
> diff --git a/gcc/testsuite/lib/gcc-dg.exp b/gcc/testsuite/lib/gcc-dg.exp
> index a0d1e7d..8168a77 100644
> --- a/gcc/testsuite/lib/gcc-dg.exp
> +++ b/gcc/testsuite/lib/gcc-dg.exp
> @@ -281,6 +281,8 @@ if { [info procs ${tool}_load] != [list] \
> }
> set result [list $status [lindex $result 1]]
> }
> +
> + set result [list [lindex $result 0] [prune_gcc_output [lindex $result
> 1]]]
... prune_gcc_output prunes more than just absolute file paths, it
prunes even the "note: " messages. And several ubsan tests have
/* { dg-output "\[^\n\r]*note: pointer points here\[^\n\r]*(\n|\r\n|\r)" } */
but since the note's are already gone, the test fails.
The following patch moves the path prunning code into a separate
procedure and fixes the failures.
Ok for trunk?
2014-11-12 Marek Polacek <[email protected]>
* lib/gcc-dg.exp (${tool}_load): Call prune_file_path instead
of prune_gcc_output.
* lib/prune.exp (prune_file_path): New procedure.
diff --git gcc/testsuite/lib/gcc-dg.exp gcc/testsuite/lib/gcc-dg.exp
index 8168a77..6df8ae1 100644
--- gcc/testsuite/lib/gcc-dg.exp
+++ gcc/testsuite/lib/gcc-dg.exp
@@ -282,7 +282,7 @@ if { [info procs ${tool}_load] != [list] \
set result [list $status [lindex $result 1]]
}
- set result [list [lindex $result 0] [prune_gcc_output [lindex $result
1]]]
+ set result [list [lindex $result 0] [prune_file_path [lindex $result
1]]]
return $result
}
}
diff --git gcc/testsuite/lib/prune.exp gcc/testsuite/lib/prune.exp
index 65028c2..df0e053 100644
--- gcc/testsuite/lib/prune.exp
+++ gcc/testsuite/lib/prune.exp
@@ -68,13 +68,19 @@ proc prune_gcc_output { text } {
# Ignore harmless warnings from Xcode 4.0.
regsub -all "(^|\n)\[^\n\]*ld: warning: could not create compact unwind
for\[^\n\]*" $text "" text
+ #send_user "After:$text\n"
+
+ return $text
+}
+
+proc prune_file_path { text } {
+ global srcdir
+
# Truncate absolute file path into relative path.
set topdir "[file dirname [file dirname [file dirname $srcdir]]]"
regsub -all "$srcdir\/" $text "" text
regsub -all "$topdir\/" $text "" text
- #send_user "After:$text\n"
-
return $text
}
Marek