test: match gofrontend error messages

These changes match the following gofrontend error messages:

blank1.go:16:1: error: may not define methods on non-local type

chan/perm.go:28:9: error: expected channel
chan/perm.go:29:11: error: left operand of ‘<-’ must be channel
chan/perm.go:69:9: error: argument must be channel

complit1.go:25:16: error: attempt to slice object that is not array, slice, or string
complit1.go:26:16: error: attempt to slice object that is not array, slice, or string
complit1.go:27:17: error: attempt to slice object that is not array, slice, or string
complit1.go:49:41: error: may only omit types within composite literals of slice, array, or map type
complit1.go:50:14: error: expected struct, slice, array, or map type for composite literal

convlit.go:24:9: error: invalid type conversion (cannot use type unsafe.Pointer as type string)
convlit.go:25:9: error: invalid type conversion (cannot use type unsafe.Pointer as type float64)
convlit.go:26:9: error: invalid type conversion (cannot use type unsafe.Pointer as type int)

ddd1.go:63:9: error: invalid use of ‘...’ calling non-variadic function

fixedbugs/bug176.go:12:18: error: index expression is not integer constant

fixedbugs/bug332.go:17:10: error: use of undefined type ‘T’

fixedbugs/issue4232.go:22:16: error: integer constant overflow
fixedbugs/issue4232.go:33:16: error: integer constant overflow
fixedbugs/issue4232.go:44:25: error: integer constant overflow
fixedbugs/issue4232.go:55:16: error: integer constant overflow

fixedbugs/issue4458.go:19:14: error: type has no method ‘foo’

fixedbugs/issue5172.go:24:14: error: too many expressions for struct

init.go:17:9: error: reference to undefined name ‘runtime’

initializerr.go:26:29: error: duplicate value for index 1

interface/explicit.go:60:14: error: type assertion only valid for interface types

label.go:64:9: error: reference to undefined label ‘go2’

label1.go:18:97: error: continue statement not within for
label1.go:22:97: error: continue statement not within for
label1.go:106:89: error: continue statement not within for
label1.go:108:26: error: invalid continue label ‘on’
label1.go:111:118: error: break statement not within for or switch or select
label1.go:113:23: error: invalid break label ‘dance’

map1.go:64:9: error: not enough arguments
map1.go:65:9: error: not enough arguments
map1.go:67:9: error: argument 1 must be a map

method2.go:36:11: error: reference to undefined field or method ‘val’
method2.go:37:11: error: reference to undefined field or method ‘val’
method2.go:41:12: error: method requires pointer (use ‘(*T).g’)

syntax/chan1.go:13:19: error: send statement used as value; use select for non-blocking send
syntax/chan1.go:17:11: error: send statement used as value; use select for non-blocking send

Change-Id: I98047b60a376e3d2788836300f7fcac3f2c285cb
Reviewed-on: https://go-review.googlesource.com/c/go/+/273527
Trust: Ian Lance Taylor <iant@golang.org>
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Cherry Zhang <cherryyz@google.com>
diff --git a/test/blank1.go b/test/blank1.go
index c9a8e6a..70e01b1 100644
--- a/test/blank1.go
+++ b/test/blank1.go
@@ -13,7 +13,7 @@
 	_ int
 }
 
-func (x int) _() { // ERROR "cannot define new methods on non-local type"
+func (x int) _() { // ERROR "methods on non-local type"
 	println(x)
 }
 
diff --git a/test/chan/perm.go b/test/chan/perm.go
index 7da88bd..0c96d92 100644
--- a/test/chan/perm.go
+++ b/test/chan/perm.go
@@ -25,8 +25,8 @@
 	cs = cr // ERROR "illegal types|incompatible|cannot"
 
 	var n int
-	<-n    // ERROR "receive from non-chan"
-	n <- 2 // ERROR "send to non-chan"
+	<-n    // ERROR "receive from non-chan|expected channel"
+	n <- 2 // ERROR "send to non-chan|must be channel"
 
 	c <- 0       // ok
 	<-c          // ok
@@ -66,5 +66,5 @@
 	close(c)
 	close(cs)
 	close(cr) // ERROR "receive"
-	close(n)  // ERROR "invalid operation.*non-chan type"
+	close(n)  // ERROR "invalid operation.*non-chan type|must be channel"
 }
diff --git a/test/complit1.go b/test/complit1.go
index eb0f920..7c2a4e2 100644
--- a/test/complit1.go
+++ b/test/complit1.go
@@ -22,9 +22,9 @@
 	_ = m[0][:]            // ERROR "slice of unaddressable value"
 	_ = f()[:]             // ERROR "slice of unaddressable value"
 
-	_ = 301[:]  // ERROR "cannot slice"
-	_ = 3.1[:]  // ERROR "cannot slice"
-	_ = true[:] // ERROR "cannot slice"
+	_ = 301[:]  // ERROR "cannot slice|attempt to slice object that is not"
+	_ = 3.1[:]  // ERROR "cannot slice|attempt to slice object that is not"
+	_ = true[:] // ERROR "cannot slice|attempt to slice object that is not"
 
 	// these are okay because they are slicing a pointer to an array
 	_ = (&[3]int{1, 2, 3})[:]
@@ -46,8 +46,8 @@
 	_ = &T{0, 0, "", nil}               // ok
 	_ = &T{i: 0, f: 0, s: "", next: {}} // ERROR "missing type in composite literal|omit types within composite literal"
 	_ = &T{0, 0, "", {}}                // ERROR "missing type in composite literal|omit types within composite literal"
-	_ = TP{i: 0, f: 0, s: "", next: {}} // ERROR "invalid composite literal type TP"
-	_ = &Ti{}                           // ERROR "invalid composite literal type Ti"
+	_ = TP{i: 0, f: 0, s: "", next: {}} // ERROR "invalid composite literal type TP|omit types within composite literal"
+	_ = &Ti{}                           // ERROR "invalid composite literal type Ti|expected.*type for composite literal"
 )
 
 type M map[T]T
diff --git a/test/convlit.go b/test/convlit.go
index de76054..1c66c89 100644
--- a/test/convlit.go
+++ b/test/convlit.go
@@ -21,9 +21,9 @@
 var x7 = float32(1e1000) // ERROR "overflow"
 
 // unsafe.Pointer can only convert to/from uintptr
-var _ = string(unsafe.Pointer(uintptr(65)))  // ERROR "convert"
-var _ = float64(unsafe.Pointer(uintptr(65))) // ERROR "convert"
-var _ = int(unsafe.Pointer(uintptr(65)))     // ERROR "convert"
+var _ = string(unsafe.Pointer(uintptr(65)))  // ERROR "convert|conversion"
+var _ = float64(unsafe.Pointer(uintptr(65))) // ERROR "convert|conversion"
+var _ = int(unsafe.Pointer(uintptr(65)))     // ERROR "convert|conversion"
 
 // implicit conversions merit scrutiny
 var s string
diff --git a/test/ddd1.go b/test/ddd1.go
index 9857814..01b9c0e 100644
--- a/test/ddd1.go
+++ b/test/ddd1.go
@@ -60,5 +60,5 @@
 	_ = [...]byte("foo") // ERROR "[.][.][.]"
 	_ = [...][...]int{{1,2,3},{4,5,6}}	// ERROR "[.][.][.]"
 
-	Foo(x...) // ERROR "invalid use of [.][.][.] in call"
+	Foo(x...) // ERROR "invalid use of .*[.][.][.]"
 }
diff --git a/test/fixedbugs/bug176.go b/test/fixedbugs/bug176.go
index ea3a909..7001dd0 100644
--- a/test/fixedbugs/bug176.go
+++ b/test/fixedbugs/bug176.go
@@ -9,6 +9,6 @@
 var x int
 
 var a = []int{ x: 1}	// ERROR "constant"
-var b = [...]int{x: 1}
+var b = [...]int{x: 1}	// GCCGO_ERROR "constant"
 var c = map[int]int{ x: 1}
 
diff --git a/test/fixedbugs/bug332.go b/test/fixedbugs/bug332.go
index d43c2dd..159c8b4 100644
--- a/test/fixedbugs/bug332.go
+++ b/test/fixedbugs/bug332.go
@@ -14,4 +14,4 @@
 
 // important: no newline on end of next line.
 // 6g used to print <epoch> instead of bug332.go:111
-func (t *T) F() {} // ERROR "undefined: T"
\ No newline at end of file
+func (t *T) F() {} // ERROR "undefined.*T"
\ No newline at end of file
diff --git a/test/fixedbugs/issue4232.go b/test/fixedbugs/issue4232.go
index 935f382..30d1326 100644
--- a/test/fixedbugs/issue4232.go
+++ b/test/fixedbugs/issue4232.go
@@ -19,7 +19,7 @@
 	_ = a[10:10]
 	_ = a[9:12]            // ERROR "invalid slice index 12|index out of bounds"
 	_ = a[11:12]           // ERROR "invalid slice index 11|index out of bounds"
-	_ = a[1<<100 : 1<<110] // ERROR "overflows int" "invalid slice index 1 << 100|index out of bounds"
+	_ = a[1<<100 : 1<<110] // ERROR "overflows int|integer constant overflow" "invalid slice index 1 << 100|index out of bounds"
 
 	var s []int
 	_ = s[-1]  // ERROR "invalid slice index -1|index out of bounds"
@@ -30,7 +30,7 @@
 	_ = s[10:10]
 	_ = s[9:12]
 	_ = s[11:12]
-	_ = s[1<<100 : 1<<110] // ERROR "overflows int" "invalid slice index 1 << 100|index out of bounds"
+	_ = s[1<<100 : 1<<110] // ERROR "overflows int|integer constant overflow" "invalid slice index 1 << 100|index out of bounds"
 
 	const c = "foofoofoof"
 	_ = c[-1]  // ERROR "invalid string index -1|index out of bounds"
@@ -41,7 +41,7 @@
 	_ = c[10:10]
 	_ = c[9:12]            // ERROR "invalid slice index 12|index out of bounds"
 	_ = c[11:12]           // ERROR "invalid slice index 11|index out of bounds"
-	_ = c[1<<100 : 1<<110] // ERROR "overflows int" "invalid slice index 1 << 100|index out of bounds"
+	_ = c[1<<100 : 1<<110] // ERROR "overflows int|integer constant overflow" "invalid slice index 1 << 100|index out of bounds"
 
 	var t string
 	_ = t[-1]  // ERROR "invalid string index -1|index out of bounds"
@@ -52,5 +52,5 @@
 	_ = t[10:10]
 	_ = t[9:12]
 	_ = t[11:12]
-	_ = t[1<<100 : 1<<110] // ERROR "overflows int" "invalid slice index 1 << 100|index out of bounds"
+	_ = t[1<<100 : 1<<110] // ERROR "overflows int|integer constant overflow" "invalid slice index 1 << 100|index out of bounds"
 }
diff --git a/test/fixedbugs/issue4458.go b/test/fixedbugs/issue4458.go
index 98ffea7..59cfa9f 100644
--- a/test/fixedbugs/issue4458.go
+++ b/test/fixedbugs/issue4458.go
@@ -16,5 +16,5 @@
 func main() {
 	av := T{}
 	pav := &av
-	(**T).foo(&pav) // ERROR "no method foo|requires named type or pointer to named"
+	(**T).foo(&pav) // ERROR "no method .*foo|requires named type or pointer to named"
 }
diff --git a/test/fixedbugs/issue5172.go b/test/fixedbugs/issue5172.go
index 0339935..ed92ac6 100644
--- a/test/fixedbugs/issue5172.go
+++ b/test/fixedbugs/issue5172.go
@@ -21,6 +21,6 @@
 	go f.bar()    // ERROR "undefined"
 	defer f.bar() // ERROR "undefined"
 
-	t := T{1} // ERROR "too many values"
+	t := T{1} // ERROR "too many"
 	go t.Bar()
 }
diff --git a/test/init.go b/test/init.go
index 317f247..5e18228 100644
--- a/test/init.go
+++ b/test/init.go
@@ -14,6 +14,6 @@
 
 func main() {
 	init()         // ERROR "undefined.*init"
-	runtime.init() // ERROR "undefined.*runtime\.init"
+	runtime.init() // ERROR "undefined.*runtime\.init|reference to undefined name"
 	var _ = init   // ERROR "undefined.*init"
 }
diff --git a/test/initializerr.go b/test/initializerr.go
index 990ab60..5e2e9a9 100644
--- a/test/initializerr.go
+++ b/test/initializerr.go
@@ -23,7 +23,7 @@
 var a3 = T { S{}, 2, 3, 4, 5, 6 }	// ERROR "convert|too many"
 var a4 = [5]byte{ 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 }	// ERROR "index|too many"
 var a5 = []byte { x: 2 }	// ERROR "index"
-var a6 = []byte{1: 1, 2: 2, 1: 3}	// ERROR "duplicate index"
+var a6 = []byte{1: 1, 2: 2, 1: 3}	// ERROR "duplicate"
 
 var ok1 = S { }	// should be ok
 var ok2 = T { S: ok1 }	// should be ok
diff --git a/test/interface/explicit.go b/test/interface/explicit.go
index 1fb3b6a..3f9451e 100644
--- a/test/interface/explicit.go
+++ b/test/interface/explicit.go
@@ -57,7 +57,7 @@
 
 	// cannot type-assert non-interfaces
 	f := 2.0
-	_ = f.(int) // ERROR "non-interface type"
+	_ = f.(int) // ERROR "non-interface type|only valid for interface types"
 
 }
 
diff --git a/test/label.go b/test/label.go
index 11716cc..7deead6 100644
--- a/test/label.go
+++ b/test/label.go
@@ -61,5 +61,5 @@
 
 	goto L10
 
-	goto go2 // ERROR "label go2 not defined"
+	goto go2 // ERROR "label go2 not defined|reference to undefined label .*go2"
 }
diff --git a/test/label1.go b/test/label1.go
index b2e0ef0..a8eaecb 100644
--- a/test/label1.go
+++ b/test/label1.go
@@ -15,11 +15,11 @@
 func f1() {
 	switch x {
 	case 1:
-		continue // ERROR "continue is not in a loop$"
+		continue // ERROR "continue is not in a loop$|continue statement not within for"
 	}
 	select {
 	default:
-		continue // ERROR "continue is not in a loop$"
+		continue // ERROR "continue is not in a loop$|continue statement not within for"
 	}
 
 }
@@ -103,14 +103,14 @@
 		}
 	}
 
-	continue // ERROR "continue is not in a loop$"
+	continue // ERROR "continue is not in a loop$|continue statement not within for"
 	for {
-		continue on // ERROR "continue label not defined: on"
+		continue on // ERROR "continue label not defined: on|invalid continue label .*on"
 	}
 
-	break // ERROR "break is not in a loop, switch, or select"
+	break // ERROR "break is not in a loop, switch, or select|break statement not within for or switch or select"
 	for {
-		break dance // ERROR "break label not defined: dance"
+		break dance // ERROR "break label not defined: dance|invalid break label .*dance"
 	}
 
 	for {
diff --git a/test/map1.go b/test/map1.go
index 498c2ec..b4aa707 100644
--- a/test/map1.go
+++ b/test/map1.go
@@ -61,8 +61,8 @@
 
 func main() {
 	m := make(map[int]int)
-	delete()        // ERROR "missing arguments"
-	delete(m)       // ERROR "missing second \(key\) argument"
+	delete()        // ERROR "missing arguments|not enough arguments"
+	delete(m)       // ERROR "missing second \(key\) argument|not enough arguments"
 	delete(m, 2, 3) // ERROR "too many arguments"
-	delete(1, m)    // ERROR "first argument to delete must be map"
-}
\ No newline at end of file
+	delete(1, m)    // ERROR "first argument to delete must be map|argument 1 must be a map"
+}
diff --git a/test/method2.go b/test/method2.go
index a45a943..7feb675 100644
--- a/test/method2.go
+++ b/test/method2.go
@@ -33,9 +33,9 @@
 var v Val
 var pv = &v
 
-var _ = pv.val() // ERROR "pv.val undefined"
-var _ = pv.val   // ERROR "pv.val undefined"
+var _ = pv.val() // ERROR "undefined"
+var _ = pv.val   // ERROR "undefined"
 
 func (t *T) g() int { return t.a }
 
-var _ = (T).g() // ERROR "needs pointer receiver|undefined"
+var _ = (T).g() // ERROR "needs pointer receiver|undefined|method requires pointer"
diff --git a/test/syntax/chan1.go b/test/syntax/chan1.go
index 56103d1..88a5b47 100644
--- a/test/syntax/chan1.go
+++ b/test/syntax/chan1.go
@@ -10,8 +10,8 @@
 var v int
 
 func main() {
-	if c <- v { // ERROR "cannot use c <- v as value"
+	if c <- v { // ERROR "cannot use c <- v as value|send statement used as value"
 	}
 }
 
-var _ = c <- v // ERROR "unexpected <-"
+var _ = c <- v // ERROR "unexpected <-|send statement used as value"