]> Cypherpunks repositories - gostls13.git/commitdiff
test: re-enable a bunch of tests with types2
authorDan Scales <danscales@google.com>
Sat, 27 Nov 2021 18:33:59 +0000 (10:33 -0800)
committerDan Scales <danscales@google.com>
Fri, 3 Dec 2021 16:24:32 +0000 (16:24 +0000)
Enable a bunch of types2-related error tests to run successfully, so
they no longer have to be disabled in run.go.

 - directive.go: split it into directive.go and directive2.go, since the
   possible errors are now split across the parser and noder2, so they
   can't all be reported in one file.

 - linkname2.go: similarly, split it into linkname2.go and linkname3.go
   for the same reason.

 - issue16428.go, issue17645.go, issue47201.dir/bo.go: handle slightly
   different wording by types2

 - issue5609.go: handle slight different error (array length must be
   integer vs. array bound too large).

 - float_lit3.go: handle slightly different wording (overflows
   float vs cannot convert to float)

I purposely didn't try to fix tests yet where there are extra or missing
errors on different lines, since that is not easy to make work for both
-G=3 and -G=0. In a later change, will flip to make the types2 version
match correctly, vs. the -G=0 version.

Change-Id: I6079ff258e3b90146335b9995764e3b1b56cda59
Reviewed-on: https://go-review.googlesource.com/c/go/+/368455
Trust: Dan Scales <danscales@google.com>
Run-TryBot: Dan Scales <danscales@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Matthew Dempsky <mdempsky@google.com>
13 files changed:
src/cmd/compile/internal/types2/stdlib_test.go
src/go/types/stdlib_test.go
test/directive.go
test/directive2.go [new file with mode: 0644]
test/fixedbugs/issue16428.go
test/fixedbugs/issue17645.go
test/fixedbugs/issue47201.dir/b.go
test/fixedbugs/issue5609.go
test/float_lit3.go
test/linkname2.go
test/linkname3.go [new file with mode: 0644]
test/run.go
test/shift1.go

index 5ac01ac25354ae55b9030831108c3a86e06b01a4..551611da552454ecf10757d9618d7da389976980 100644 (file)
@@ -165,9 +165,11 @@ func TestStdTest(t *testing.T) {
        testTestDir(t, filepath.Join(runtime.GOROOT(), "test"),
                "cmplxdivide.go", // also needs file cmplxdivide1.go - ignore
                "directive.go",   // tests compiler rejection of bad directive placement - ignore
+               "directive2.go",  // tests compiler rejection of bad directive placement - ignore
                "embedfunc.go",   // tests //go:embed
                "embedvers.go",   // tests //go:embed
                "linkname2.go",   // types2 doesn't check validity of //go:xxx directives
+               "linkname3.go",   // types2 doesn't check validity of //go:xxx directives
        )
 }
 
index c56e0ba42889473133f24c8cf161f96cda7d50d6..687b80540a438bb9062af025ecae3b6bb7806f65 100644 (file)
@@ -166,9 +166,11 @@ func TestStdTest(t *testing.T) {
        testTestDir(t, filepath.Join(runtime.GOROOT(), "test"),
                "cmplxdivide.go", // also needs file cmplxdivide1.go - ignore
                "directive.go",   // tests compiler rejection of bad directive placement - ignore
+               "directive2.go",  // tests compiler rejection of bad directive placement - ignore
                "embedfunc.go",   // tests //go:embed
                "embedvers.go",   // tests //go:embed
                "linkname2.go",   // go/types doesn't check validity of //go:xxx directives
+               "linkname3.go",   // go/types doesn't check validity of //go:xxx directives
        )
 }
 
index 37781c30d54e9d297159992be38ea6e8876a7c66..147e81db2c2377238d0d1b5e842de9f1a22553e0 100644 (file)
@@ -6,16 +6,11 @@
 
 // Verify that misplaced directives are diagnosed.
 
-// ok
-//go:build !ignore
-
 //go:noinline // ERROR "misplaced compiler directive"
 
 //go:noinline // ERROR "misplaced compiler directive"
 package main
 
-//go:build bad // ERROR "misplaced compiler directive"
-
 //go:nosplit
 func f1() {}
 
@@ -38,11 +33,10 @@ type T int
 //go:notinheap
 type T1 int
 
-//go:notinheap // ERROR "misplaced compiler directive"
 type (
        //go:notinheap
        //go:noinline // ERROR "misplaced compiler directive"
-       T2  int //go:notinheap // ERROR "misplaced compiler directive"
+       T2  int
        T2b int
        //go:notinheap
        T2c int
@@ -50,40 +44,20 @@ type (
        T3 int
 )
 
-//go:notinheap // ERROR "misplaced compiler directive"
-type (
-       //go:notinheap
-       T4 int
-)
-
-//go:notinheap // ERROR "misplaced compiler directive"
-type ()
-
-type T5 int
-
-func g() {} //go:noinline // ERROR "misplaced compiler directive"
-
-// ok: attached to f (duplicated yes, but ok)
-//go:noinline
-
 //go:noinline
 func f() {
-       //go:noinline // ERROR "misplaced compiler directive"
        x := 1
 
-       //go:noinline // ERROR "misplaced compiler directive"
        {
-               _ = x //go:noinline // ERROR "misplaced compiler directive"
+               _ = x
        }
        //go:noinline // ERROR "misplaced compiler directive"
-       var y int //go:noinline // ERROR "misplaced compiler directive"
-       //go:noinline // ERROR "misplaced compiler directive"
+       var y int
        _ = y
 
        //go:noinline // ERROR "misplaced compiler directive"
        const c = 1
 
-       //go:noinline // ERROR "misplaced compiler directive"
        _ = func() {}
 
        //go:noinline // ERROR "misplaced compiler directive"
@@ -95,8 +69,3 @@ func f() {
 // someday there might be a directive that can apply to type aliases, but go:notinheap doesn't.
 //go:notinheap // ERROR "misplaced compiler directive"
 type T6 = int
-
-// EOF
-//go:noinline // ERROR "misplaced compiler directive"
-
-//go:build bad // ERROR "misplaced compiler directive"
diff --git a/test/directive2.go b/test/directive2.go
new file mode 100644 (file)
index 0000000..e73e112
--- /dev/null
@@ -0,0 +1,63 @@
+// errorcheck
+
+// Copyright 2020 The Go Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+// Verify that misplaced directives are diagnosed.
+
+// ok
+//go:build !ignore
+
+package main
+
+//go:build bad // ERROR "misplaced compiler directive"
+
+//go:notinheap // ERROR "misplaced compiler directive"
+type (
+       T2  int //go:notinheap // ERROR "misplaced compiler directive"
+       T2b int
+       T2c int
+       T3  int
+)
+
+//go:notinheap // ERROR "misplaced compiler directive"
+type (
+       //go:notinheap
+       T4 int
+)
+
+//go:notinheap // ERROR "misplaced compiler directive"
+type ()
+
+type T5 int
+
+func g() {} //go:noinline // ERROR "misplaced compiler directive"
+
+// ok: attached to f (duplicated yes, but ok)
+//go:noinline
+
+//go:noinline
+func f() {
+       //go:noinline // ERROR "misplaced compiler directive"
+       x := 1
+
+       //go:noinline // ERROR "misplaced compiler directive"
+       {
+               _ = x //go:noinline // ERROR "misplaced compiler directive"
+       }
+       var y int //go:noinline // ERROR "misplaced compiler directive"
+       //go:noinline // ERROR "misplaced compiler directive"
+       _ = y
+
+       const c = 1
+
+       _ = func() {}
+
+       // ok:
+       //go:notinheap
+       type T int
+}
+
+// EOF
+//go:noinline // ERROR "misplaced compiler directive"
index 5696d186c77d081391294b2fa8ffce2d1a313505..91e1079959a0a3d79521b7fa23c784fd53cf5c98 100644 (file)
@@ -7,6 +7,6 @@
 package p
 
 var (
-       b = [...]byte("abc") // ERROR "outside of array literal"
+       b = [...]byte("abc") // ERROR "outside of array literal|outside a composite literal"
        s = len(b)
 )
index bb34e4ee97a3bfd5db2cad3439ce3ef375c4a257..111fa81e136368c190ee3955267baa8a12829ce1 100644 (file)
@@ -12,5 +12,5 @@ type Foo struct {
 
 func main() {
        var s []int
-       var _ string = append(s, Foo{""}) // ERROR "cannot use .. \(type untyped string\) as type int in field value|incompatible type" "cannot use Foo{...} \(type Foo\) as type int in append" "cannot use append\(s\, Foo{...}\) \(type \[\]int\) as type string in assignment"
+       var _ string = append(s, Foo{""}) // ERROR "cannot use .. \(.*untyped string.*\) as .*int.*|incompatible type" "cannot use Foo{.*} \(.*type Foo\) as type int in .*append" "cannot use append\(s\, Foo{.*}\) \(.*type \[\]int\) as type string in (assignment|variable declaration)"
 }
index 5fd0635af2e11dd86e97bc0a480c0acfccc72490..ae3ff3f2b8143d280da4958a17a5a21852ffb978 100644 (file)
@@ -4,6 +4,6 @@
 
 package main
 
-func Println() {} // ERROR "Println redeclared in this block"
+func Println() {} // ERROR "Println redeclared in this block|Println already declared"
 
 func main() {}
index ea770b4865417d94c8326259f6fc2fc53dcfb61b..a39d3fb0c66e5683e818d53793005195b60995f9 100644 (file)
@@ -10,4 +10,4 @@ package pkg
 
 const Large uint64 = 18446744073709551615
 
-var foo [Large]uint64 // ERROR "array bound is too large|array bound overflows"
+var foo [Large]uint64 // ERROR "array bound is too large|array bound overflows|array length.*must be integer"
index 850d02c9c7f97366ae3d5db35ec9e78b5417290e..37a1289fb9dd21a22e1b10961e8e94d815e9cbb4 100644 (file)
@@ -29,19 +29,19 @@ const (
 var x = []interface{}{
        float32(max32 + ulp32/2 - 1),             // ok
        float32(max32 + ulp32/2 - two128/two256), // ok
-       float32(max32 + ulp32/2),                 // ERROR "constant 3\.40282e\+38 overflows float32"
+       float32(max32 + ulp32/2),                 // ERROR "constant 3\.40282e\+38 overflows float32|cannot convert.*to type float32"
 
        float32(-max32 - ulp32/2 + 1),             // ok
        float32(-max32 - ulp32/2 + two128/two256), // ok
-       float32(-max32 - ulp32/2),                 // ERROR "constant -3\.40282e\+38 overflows float32"
+       float32(-max32 - ulp32/2),                 // ERROR "constant -3\.40282e\+38 overflows float32|cannot convert.*to type float32"
 
        // If the compiler's internal floating point representation
        // is shorter than 1024 bits, it cannot distinguish max64+ulp64/2-1 and max64+ulp64/2.
        float64(max64 + ulp64/2 - two1024/two256), // ok
        float64(max64 + ulp64/2 - 1),              // ok
-       float64(max64 + ulp64/2),                  // ERROR "constant 1\.79769e\+308 overflows float64"
+       float64(max64 + ulp64/2),                  // ERROR "constant 1\.79769e\+308 overflows float64|cannot convert.*to type float64"
 
        float64(-max64 - ulp64/2 + two1024/two256), // ok
        float64(-max64 - ulp64/2 + 1),              // ok
-       float64(-max64 - ulp64/2),                  // ERROR "constant -1\.79769e\+308 overflows float64"
+       float64(-max64 - ulp64/2),                  // ERROR "constant -1\.79769e\+308 overflows float64|cannot convert.*to type float64"
 }
index cb7f9be3452a04a247391c5fc6c54a1b4e68f183..5eb250f9c4bcb787eda256e4aa2d9a35518bb9aa 100644 (file)
@@ -16,12 +16,6 @@ var x, y int
 //go:linkname x ok
 
 // ERROR "//go:linkname requires linkname argument or -p compiler flag"
-// ERROR "//go:linkname must refer to declared function or variable"
-// ERROR "//go:linkname must refer to declared function or variable"
-// ERROR "duplicate //go:linkname for x"
 
 //line linkname2.go:18
 //go:linkname y
-//go:linkname nonexist nonexist
-//go:linkname t notvarfunc
-//go:linkname x duplicate
diff --git a/test/linkname3.go b/test/linkname3.go
new file mode 100644 (file)
index 0000000..df110cd
--- /dev/null
@@ -0,0 +1,25 @@
+// errorcheck
+
+// Copyright 2020 The Go Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+// Tests that errors are reported for misuse of linkname.
+package p
+
+import _ "unsafe"
+
+type t int
+
+var x, y int
+
+//go:linkname x ok
+
+// ERROR "//go:linkname must refer to declared function or variable"
+// ERROR "//go:linkname must refer to declared function or variable"
+// ERROR "duplicate //go:linkname for x"
+
+//line linkname3.go:18
+//go:linkname nonexist nonexist
+//go:linkname t notvarfunc
+//go:linkname x duplicate
index c6e82891da10895203a2ed303993c889b48ba355..e17d9729bce4b3b654eda2dd729ba06220d19421 100644 (file)
@@ -2115,14 +2115,11 @@ func overlayDir(dstRoot, srcRoot string) error {
 // List of files that the compiler cannot errorcheck with the new typechecker (compiler -G option).
 // Temporary scaffolding until we pass all the tests at which point this map can be removed.
 var types2Failures = setOf(
-       "directive.go",    // misplaced compiler directive checks
-       "float_lit3.go",   // types2 reports extra errors
        "import1.go",      // types2 reports extra errors
        "import6.go",      // issue #43109
        "initializerr.go", // types2 reports extra errors
-       "linkname2.go",    // error reported by noder (not running for types2 errorcheck test)
        "notinheap.go",    // types2 doesn't report errors about conversions that are invalid due to //go:notinheap
-       "shift1.go",       // issue #42989
+       "shift1.go",       // mostly just different wording, but reports two new errors.
        "typecheck.go",    // invalid function is not causing errors when called
 
        "fixedbugs/bug176.go", // types2 reports all errors (pref: types2)
@@ -2138,11 +2135,9 @@ var types2Failures = setOf(
        "fixedbugs/issue11610.go",  // types2 not run after syntax errors
        "fixedbugs/issue11614.go",  // types2 reports an extra error
        "fixedbugs/issue14520.go",  // missing import path error by types2
-       "fixedbugs/issue16428.go",  // types2 reports two instead of one error
        "fixedbugs/issue17038.go",  // types2 doesn't report a follow-on error (pref: types2)
-       "fixedbugs/issue17645.go",  // multiple errors on same line
        "fixedbugs/issue18331.go",  // missing error about misuse of //go:noescape (irgen needs code from noder)
-       "fixedbugs/issue18419.go",  // types2 reports
+       "fixedbugs/issue18419.go",  // types2 reports no field or method member, but should say unexported
        "fixedbugs/issue19012.go",  // multiple errors on same line
        "fixedbugs/issue20233.go",  // types2 reports two instead of one error (pref: compiler)
        "fixedbugs/issue20245.go",  // types2 reports two instead of one error (pref: compiler)
@@ -2156,8 +2151,6 @@ var types2Failures = setOf(
        "fixedbugs/issue4232.go",   // types2 reports (correct) extra errors
        "fixedbugs/issue4452.go",   // types2 reports (correct) extra errors
        "fixedbugs/issue4510.go",   // types2 reports different (but ok) line numbers
-       "fixedbugs/issue47201.go",  // types2 spells the error message differently
-       "fixedbugs/issue5609.go",   // types2 needs a better error message
        "fixedbugs/issue7525b.go",  // types2 reports init cycle error on different line - ok otherwise
        "fixedbugs/issue7525c.go",  // types2 reports init cycle error on different line - ok otherwise
        "fixedbugs/issue7525d.go",  // types2 reports init cycle error on different line - ok otherwise
@@ -2176,9 +2169,10 @@ var g3Failures = setOf(
 )
 
 var unifiedFailures = setOf(
-       "closure3.go", // unified IR numbers closures differently than -d=inlfuncswithclosures
-       "escape4.go",  // unified IR can inline f5 and f6; test doesn't expect this
-       "inline.go",   // unified IR reports function literal diagnostics on different lines than -d=inlfuncswithclosures
+       "closure3.go",  // unified IR numbers closures differently than -d=inlfuncswithclosures
+       "escape4.go",   // unified IR can inline f5 and f6; test doesn't expect this
+       "inline.go",    // unified IR reports function literal diagnostics on different lines than -d=inlfuncswithclosures
+       "linkname3.go", // unified IR is missing some linkname errors
 
        "fixedbugs/issue42284.go",  // prints "T(0) does not escape", but test expects "a.I(a.T(0)) does not escape"
        "fixedbugs/issue7921.go",   // prints "… escapes to heap", but test expects "string(…) escapes to heap"
index d6a6c38839f56076a9445e160192570d8bb997fb..0dae49a74dc590a0a40c9007688be4d20908b2c6 100644 (file)
@@ -25,7 +25,7 @@ var (
 var (
        e1       = g(2.0 << s) // ERROR "invalid|shift of non-integer operand"
        f1       = h(2 << s)   // ERROR "invalid"
-       g1 int64 = 1.1 << s    // ERROR "truncated"
+       g1 int64 = 1.1 << s    // ERROR "truncated|must be integer"
 )
 
 // constant shift expressions
@@ -44,7 +44,7 @@ var (
        b3 = 1<<s + 1 + 1.0 // ERROR "invalid|shift of non-integer operand"
        // issue 5014
        c3     = complex(1<<s, 0) // ERROR "invalid|shift of type float64"
-       d3 int = complex(1<<s, 3) // ERROR "non-integer|cannot use.*as type int" "shift of type float64"
+       d3 int = complex(1<<s, 3) // ERROR "non-integer|cannot use.*as type int" "shift of type float64|must be integer"
        e3     = real(1 << s)     // ERROR "invalid"
        f3     = imag(1 << s)     // ERROR "invalid"
 )
@@ -73,8 +73,8 @@ func _() {
        // non constants arguments trigger a different path
        f2 := 1.2
        s2 := "hi"
-       _ = f2 << 2 // ERROR "shift of type float64|non-integer"
-       _ = s2 << 2 // ERROR "shift of type string|non-integer"
+       _ = f2 << 2 // ERROR "shift of type float64|non-integer|must be integer"
+       _ = s2 << 2 // ERROR "shift of type string|non-integer|must be integer"
 }
 
 // shifts in comparisons w/ untyped operands
@@ -130,7 +130,7 @@ var (
        x int
        _ = 1<<s == x
        _ = 1.<<s == x
-       _ = 1.1<<s == x // ERROR "truncated"
+       _ = 1.1<<s == x // ERROR "truncated|must be integer"
 
        _ = 1<<s+x == 1
        _ = 1<<s+x == 1.
@@ -138,13 +138,13 @@ var (
        _ = 1.<<s+x == 1
        _ = 1.<<s+x == 1.
        _ = 1.<<s+x == 1.1  // ERROR "truncated"
-       _ = 1.1<<s+x == 1   // ERROR "truncated"
-       _ = 1.1<<s+x == 1.  // ERROR "truncated"
-       _ = 1.1<<s+x == 1.1 // ERROR "truncated"
+       _ = 1.1<<s+x == 1   // ERROR "truncated|must be integer"
+       _ = 1.1<<s+x == 1.  // ERROR "truncated|must be integer"
+       _ = 1.1<<s+x == 1.1 // ERROR "truncated|must be integer"
 
        _ = 1<<s == x<<s
        _ = 1.<<s == x<<s
-       _ = 1.1<<s == x<<s // ERROR "truncated"
+       _ = 1.1<<s == x<<s // ERROR "truncated|must be integer"
 )
 
 // shifts as operands in non-arithmetic operations and as arguments
@@ -159,37 +159,37 @@ func _() {
        _ = make([]int, 1)
        _ = make([]int, 1.)
        _ = make([]int, 1.<<s)
-       _ = make([]int, 1.1<<s) // ERROR "non-integer|truncated"
+       _ = make([]int, 1.1<<s) // ERROR "non-integer|truncated|must be integer"
 
        _ = float32(1)
-       _ = float32(1 << s) // ERROR "non-integer|shift of type float32"
+       _ = float32(1 << s) // ERROR "non-integer|shift of type float32|must be integer"
        _ = float32(1.)
-       _ = float32(1. << s)  // ERROR "non-integer|shift of type float32"
-       _ = float32(1.1 << s) // ERROR "non-integer|shift of type float32"
+       _ = float32(1. << s)  // ERROR "non-integer|shift of type float32|must be integer"
+       _ = float32(1.1 << s) // ERROR "non-integer|shift of type float32|must be integer"
 
        _ = append(a, 1<<s)
        _ = append(a, 1.<<s)
-       _ = append(a, 1.1<<s) // ERROR "truncated"
+       _ = append(a, 1.1<<s) // ERROR "truncated|must be integer"
 
        var b []float32
        _ = append(b, 1<<s)   // ERROR "non-integer|type float32"
        _ = append(b, 1.<<s)  // ERROR "non-integer|type float32"
-       _ = append(b, 1.1<<s) // ERROR "non-integer|type float32"
+       _ = append(b, 1.1<<s) // ERROR "non-integer|type float32|must be integer"
 
-       _ = complex(1.<<s, 0)  // ERROR "non-integer|shift of type float64"
-       _ = complex(1.1<<s, 0) // ERROR "non-integer|shift of type float64"
-       _ = complex(0, 1.<<s)  // ERROR "non-integer|shift of type float64"
-       _ = complex(0, 1.1<<s) // ERROR "non-integer|shift of type float64"
+       _ = complex(1.<<s, 0)  // ERROR "non-integer|shift of type float64|must be integer"
+       _ = complex(1.1<<s, 0) // ERROR "non-integer|shift of type float64|must be integer"
+       _ = complex(0, 1.<<s)  // ERROR "non-integer|shift of type float64|must be integer"
+       _ = complex(0, 1.1<<s) // ERROR "non-integer|shift of type float64|must be integer"
 
        var a4 float64
        var b4 int
-       _ = complex(1<<s, a4) // ERROR "non-integer|shift of type float64"
+       _ = complex(1<<s, a4) // ERROR "non-integer|shift of type float64|must be integer"
        _ = complex(1<<s, b4) // ERROR "invalid|non-integer|"
 
        var m1 map[int]string
        delete(m1, 1<<s)
        delete(m1, 1.<<s)
-       delete(m1, 1.1<<s) // ERROR "truncated|shift of type float64"
+       delete(m1, 1.1<<s) // ERROR "truncated|shift of type float64|must be integer"
 
        var m2 map[float32]string
        delete(m2, 1<<s)   // ERROR "invalid|cannot use 1 << s as type float32"
@@ -202,32 +202,32 @@ func _() {
        var s uint
        _ = 1 << (1 << s)
        _ = 1 << (1. << s)
-       _ = 1 << (1.1 << s)   // ERROR "non-integer|truncated"
-       _ = 1. << (1 << s)    // ERROR "non-integer|shift of type float64"
-       _ = 1. << (1. << s)   // ERROR "non-integer|shift of type float64"
+       _ = 1 << (1.1 << s)   // ERROR "non-integer|truncated|must be integer"
+       _ = 1. << (1 << s)    // ERROR "non-integer|shift of type float64|must be integer"
+       _ = 1. << (1. << s)   // ERROR "non-integer|shift of type float64|must be integer"
        _ = 1.1 << (1.1 << s) // ERROR "invalid|non-integer|truncated"
 
        _ = (1 << s) << (1 << s)
        _ = (1 << s) << (1. << s)
-       _ = (1 << s) << (1.1 << s)   // ERROR "truncated"
-       _ = (1. << s) << (1 << s)    // ERROR "non-integer|shift of type float64"
-       _ = (1. << s) << (1. << s)   // ERROR "non-integer|shift of type float64"
+       _ = (1 << s) << (1.1 << s)   // ERROR "truncated|must be integer"
+       _ = (1. << s) << (1 << s)    // ERROR "non-integer|shift of type float64|must be integer"
+       _ = (1. << s) << (1. << s)   // ERROR "non-integer|shift of type float64|must be integer"
        _ = (1.1 << s) << (1.1 << s) // ERROR "invalid|non-integer|truncated"
 
        var x int
        x = 1 << (1 << s)
        x = 1 << (1. << s)
-       x = 1 << (1.1 << s) // ERROR "truncated"
+       x = 1 << (1.1 << s) // ERROR "truncated|must be integer"
        x = 1. << (1 << s)
        x = 1. << (1. << s)
-       x = 1.1 << (1.1 << s) // ERROR "truncated"
+       x = 1.1 << (1.1 << s) // ERROR "truncated|must be integer"
 
        x = (1 << s) << (1 << s)
        x = (1 << s) << (1. << s)
-       x = (1 << s) << (1.1 << s) // ERROR "truncated"
+       x = (1 << s) << (1.1 << s) // ERROR "truncated|must be integer"
        x = (1. << s) << (1 << s)
        x = (1. << s) << (1. << s)
-       x = (1.1 << s) << (1.1 << s) // ERROR "truncated"
+       x = (1.1 << s) << (1.1 << s) // ERROR "truncated|must be integer"
 
        var y float32
        y = 1 << (1 << s)     // ERROR "non-integer|type float32"
@@ -241,8 +241,8 @@ func _() {
        z = (1 << s) << (1 << s)     // ERROR "non-integer|type complex128"
        z = (1 << s) << (1. << s)    // ERROR "non-integer|type complex128"
        z = (1 << s) << (1.1 << s)   // ERROR "invalid|truncated|complex128"
-       z = (1. << s) << (1 << s)    // ERROR "non-integer|type complex128"
-       z = (1. << s) << (1. << s)   // ERROR "non-integer|type complex128"
+       z = (1. << s) << (1 << s)    // ERROR "non-integer|type complex128|must be integer"
+       z = (1. << s) << (1. << s)   // ERROR "non-integer|type complex128|must be integer"
        z = (1.1 << s) << (1.1 << s) // ERROR "invalid|truncated|complex128"
 
        _, _, _ = x, y, z