aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIan Lance Taylor <iant@google.com>2011-09-23 23:44:14 +0000
committerIan Lance Taylor <ian@gcc.gnu.org>2011-09-23 23:44:14 +0000
commit6ed22bc81776ea1bc046a8ed693619a6fd7c14c2 (patch)
treec9685bdc3fd15e4091c64e262658601d477a7914
parentb07000d94215ee742a8c7d0a7a38b27af106c871 (diff)
downloadgcc-6ed22bc81776ea1bc046a8ed693619a6fd7c14c2.zip
gcc-6ed22bc81776ea1bc046a8ed693619a6fd7c14c2.tar.gz
gcc-6ed22bc81776ea1bc046a8ed693619a6fd7c14c2.tar.bz2
go-test.exp (errchk): Handle more cases of getting correct Tcl backslash quoting in regular...
* go.test/go-test.exp (errchk): Handle more cases of getting correct Tcl backslash quoting in regular expressions in test file. Also fix some tests to match gccgo error messages. From-SVN: r179134
-rw-r--r--gcc/testsuite/ChangeLog5
-rw-r--r--gcc/testsuite/go.test/go-test.exp12
-rw-r--r--gcc/testsuite/go.test/test/fixedbugs/bug340.go6
-rw-r--r--gcc/testsuite/go.test/test/fixedbugs/bug350.go8
-rw-r--r--gcc/testsuite/go.test/test/fixedbugs/bug351.go2
5 files changed, 19 insertions, 14 deletions
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index 208add9..4f0cebc 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,3 +1,8 @@
+2011-09-23 Ian Lance Taylor <iant@google.com>
+
+ * go.test/go-test.exp (errchk): Handle more cases of getting
+ correct Tcl backslash quoting in regular expressions in test file.
+
2011-09-23 Jason Merrill <jason@redhat.com>
Core 234
diff --git a/gcc/testsuite/go.test/go-test.exp b/gcc/testsuite/go.test/go-test.exp
index 0e8f2a6..10cd151 100644
--- a/gcc/testsuite/go.test/go-test.exp
+++ b/gcc/testsuite/go.test/go-test.exp
@@ -61,13 +61,17 @@ proc errchk { test opts } {
# experimentation, not analysis.
regsub -all "\\.\\*" $out_line "\\\\\[ -~\\\\\]*" out_line
}
+ if [string match "*dg-error*\\\[?\\\]*" $out_line] {
+ set index [string first "dg-error" $out_line]
+ regsub -all "\\\[\(.\)\\\]" $out_line "\\\\\[\\1\\\\\]" out_line
+ }
if [string match "*dg-error*\{*" $out_line] {
set index [string first "dg-error" $out_line]
- regsub -start $index -all "\{" $out_line "\\\\\[\\\{\\\\\]" out_line
+ regsub -start $index -all "\(\[^\\\\]\)\{" $out_line "\\1\\\\\[\\\{\\\\\]" out_line
}
if [string match "*dg-error*\}*\}" $out_line] {
set index [string first "dg-error" $out_line]
- regsub -start $index -all "\}\(.\)" $out_line "\\\\\[\\\}\\\\\]\\1" out_line
+ regsub -start $index -all "\(\[^\\\\]\)\}\(.\)" $out_line "\\1\\\\\[\\\}\\\\\]\\2" out_line
}
if [string match "*dg-error*\(*" $out_line] {
set index [string first "dg-error" $out_line]
@@ -77,10 +81,6 @@ proc errchk { test opts } {
set index [string first "dg-error" $out_line]
regsub -start $index -all "\\\\\\\)\(.\)" $out_line "\\\\\[\\\)\\\\\]\\1" out_line
}
- if [string match "*dg-error*\[.\]*" $out_line] {
- set index [string first "dg-error" $out_line]
- regsub -all "\\\[\\.\\\]" $out_line "\\\\\[.\\\\\]" out_line
- }
# Special case for bug332, in which the error message wants to
# match the file name, which is not what dg-error expects.
if [string match "*dg-error*bug332*" $out_line] {
diff --git a/gcc/testsuite/go.test/test/fixedbugs/bug340.go b/gcc/testsuite/go.test/test/fixedbugs/bug340.go
index 461cc6c..af72513 100644
--- a/gcc/testsuite/go.test/test/fixedbugs/bug340.go
+++ b/gcc/testsuite/go.test/test/fixedbugs/bug340.go
@@ -10,8 +10,8 @@ package main
func main() {
var x interface{}
- switch t := x.(type) { // ERROR "0 is not a type"
- case 0:
- t.x = 1 // ERROR "type interface \{ \}"
+ switch t := x.(type) { // GC_ERROR "0 is not a type"
+ case 0: // GCCGO_ERROR "expected type"
+ t.x = 1 // ERROR "type interface \{ \}|reference to undefined field or method"
}
}
diff --git a/gcc/testsuite/go.test/test/fixedbugs/bug350.go b/gcc/testsuite/go.test/test/fixedbugs/bug350.go
index aac2949..f8df3f5 100644
--- a/gcc/testsuite/go.test/test/fixedbugs/bug350.go
+++ b/gcc/testsuite/go.test/test/fixedbugs/bug350.go
@@ -8,8 +8,8 @@ package main
type T int
-func (T) m() {}
-func (T) m() {} // ERROR "T[.]m redeclared"
+func (T) m() {} // GCCGO_ERROR "previous"
+func (T) m() {} // ERROR "T[.]m redeclared|redefinition"
-func (*T) p() {}
-func (*T) p() {} // ERROR "[(][*]T[)][.]p redeclared"
+func (*T) p() {} // GCCGO_ERROR "previous"
+func (*T) p() {} // ERROR "[(][*]T[)][.]p redeclared|redefinition"
diff --git a/gcc/testsuite/go.test/test/fixedbugs/bug351.go b/gcc/testsuite/go.test/test/fixedbugs/bug351.go
index 2f631bb..9625c6a 100644
--- a/gcc/testsuite/go.test/test/fixedbugs/bug351.go
+++ b/gcc/testsuite/go.test/test/fixedbugs/bug351.go
@@ -9,5 +9,5 @@ package main
var x int
func main() {
- (x) := 0 // ERROR "non-name [(]x[)]"
+ (x) := 0 // ERROR "non-name [(]x[)]|non-name on left side"
}