On 12/11/14 14:09, Marek Polacek wrote:


... 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.

thanks, this make sense, and LGTM.

(my fault, my test diff base must be wrong...)


Ok for trunk?

2014-11-12  Marek Polacek  <pola...@redhat.com>

        * 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





Reply via email to