OSDN Git Service

* lib/scanasm.exp (dg-scan): Quote pattern before display.
authormmitchel <mmitchel@138bc75d-0d04-0410-961f-82ee72b054a4>
Thu, 12 Feb 2004 17:47:47 +0000 (17:47 +0000)
committermmitchel <mmitchel@138bc75d-0d04-0410-961f-82ee72b054a4>
Thu, 12 Feb 2004 17:47:47 +0000 (17:47 +0000)
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@77715 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/testsuite/ChangeLog
gcc/testsuite/lib/scanasm.exp

index a0e5f70..c4cdf7e 100644 (file)
@@ -1,3 +1,7 @@
+2004-02-12  Nathaniel Smith <njs@codesourcery.com>
+
+       * lib/scanasm.exp (dg-scan): Quote pattern before display.
+
 2004-02-12  Hartmut Penner  <hpenner@de.ibm.com>
 
         * g++.dg/simd-2.C: xfail on ppc64-linux.
index cf414fb..79d93cb 100644 (file)
@@ -48,11 +48,14 @@ proc dg-scan { name positive testcase output_file orig_args } {
     set text [read $fd]
     close $fd
 
-    set match [regexp -- [lindex $orig_args 0] $text]
+    set pattern [lindex $orig_args 0]
+    set printable_pattern [string map {\t \\t \n \\n \r \\r \\ \\\\} $pattern]
+
+    set match [regexp -- $pattern $text]
     if { $match == $positive } {
-       pass "$testcase $name [lindex $orig_args 0]"
+       pass "$testcase $name $printable_pattern"
     } else {
-       fail "$testcase $name [lindex $orig_args 0]"
+       fail "$testcase $name $printable_pattern"
     }
 }