Go testsuite: update new tests to version in source repo

This commit is contained in:
Ian Lance Taylor 2020-12-03 12:07:04 -08:00
parent 9f1a650199
commit 3089f5feef
23 changed files with 50 additions and 59 deletions

View File

@ -46,8 +46,8 @@ var _ A0 = T0{}
var _ T0 = A0{}
// But aliases and original types cannot be used with new types based on them.
var _ N0 = T0{} // ERROR "cannot use T0 literal \(type T0\) as type N0 in assignment|incompatible type"
var _ N0 = A0{} // ERROR "cannot use T0 literal \(type T0\) as type N0 in assignment|incompatible type"
var _ N0 = T0{} // ERROR "cannot use T0{} \(type T0\) as type N0 in assignment|incompatible type"
var _ N0 = A0{} // ERROR "cannot use T0{} \(type T0\) as type N0 in assignment|incompatible type"
var _ A5 = Value{}
@ -82,10 +82,10 @@ func _() {
var _ A0 = T0{}
var _ T0 = A0{}
var _ N0 = T0{} // ERROR "cannot use T0 literal \(type T0\) as type N0 in assignment|incompatible type"
var _ N0 = A0{} // ERROR "cannot use T0 literal \(type T0\) as type N0 in assignment|incompatible type"
var _ N0 = T0{} // ERROR "cannot use T0{} \(type T0\) as type N0 in assignment|incompatible type"
var _ N0 = A0{} // ERROR "cannot use T0{} \(type T0\) as type N0 in assignment|incompatible type"
var _ A5 = Value{} // ERROR "cannot use reflect\.Value literal \(type reflect.Value\) as type A5 in assignment|incompatible type"
var _ A5 = Value{} // ERROR "cannot use reflect\.Value{} \(type reflect.Value\) as type A5 in assignment|incompatible type"
}
// Invalid type alias declarations.

View File

@ -1,6 +1,6 @@
// errorcheck
// Copyright 2014 The Go Authors. All rights reserved.
// Copyright 2014 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.

View File

@ -1,4 +1,4 @@
// Copyright 2014 The Go Authors. All rights reserved.
// Copyright 2014 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.

View File

@ -1,4 +1,4 @@
// Copyright 2014 The Go Authors. All rights reserved.
// Copyright 2014 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.

View File

@ -1,6 +1,6 @@
// errorcheckdir
// Copyright 2014 The Go Authors. All rights reserved.
// Copyright 2014 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.

View File

@ -1,9 +0,0 @@
// Copyright 2014 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.
package a
import . "fmt"
var p1 = Print

View File

@ -1,9 +0,0 @@
// Copyright 2014 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.
package a
import "fmt"
var p2 = fmt.Printf

View File

@ -1,9 +0,0 @@
// Copyright 2014 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.
package a
import . "fmt"
var p3 = Println

View File

@ -1,12 +1,22 @@
// compiledir
// compile
// Copyright 2014 The Go Authors. All rights reserved.
// Copyright 2014 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.
// The gccgo compiler had a bug: if one file in a package did a dot
// import, then an earlier file in the package would incorrectly
// resolve to the imported names rather than reporting undefined
// errors.
// The gccgo compiler had a bug: mentioning a function type in an
// expression in a function literal messed up the list of variables
// referenced in enclosing functions.
package ignored
package main
func main() {
v1, v2 := 0, 0
f := func() {
a := v1
g := (func())(nil)
b := v2
_, _, _ = a, g, b
}
_, _, _ = v1, v2, f
}

View File

@ -4,7 +4,8 @@
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
// Gccgo used to miscompile this, because of the empty struct.
// Gccgo used to miscompile passing a global variable with a
// zero-sized type to a function.
package main

View File

@ -1,4 +1,4 @@
// Copyright 2017 The Go Authors. All rights reserved.
// Copyright 2018 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.

View File

@ -1,4 +1,4 @@
// Copyright 2017 The Go Authors. All rights reserved.
// Copyright 2018 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.

View File

@ -1,6 +1,6 @@
// rundir
// Copyright 2017 The Go Authors. All rights reserved.
// Copyright 2018 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.

View File

@ -1,4 +1,4 @@
// Copyright 2019 The Go Authors. All rights reserved.
// 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.

View File

@ -1,4 +1,4 @@
// Copyright 2019 The Go Authors. All rights reserved.
// 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.

View File

@ -1,4 +1,4 @@
// Copyright 2019 The Go Authors. All rights reserved.
// 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.

View File

@ -1,6 +1,6 @@
// compiledir
// Copyright 2019 The Go Authors. All rights reserved.
// 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.

View File

@ -1,3 +1,7 @@
// Copyright 2015 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.
package a
type T int

View File

@ -1,3 +1,7 @@
// Copyright 2015 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.
package b
import "./a"

View File

@ -9,7 +9,7 @@
package main
func main() {
arr := []int{1, 2}
arr := []int{1, 2}
// The spec says that in an assignment statement the operands
// of all index expressions and pointer indirections on the
@ -24,7 +24,7 @@ func main() {
// tmp3 := len(arr)
// arr = arr[:tmp3-1]
// tmp1[tmp2] = 3
arr, arr[len(arr)-1] = arr[:len(arr)-1], 3
arr, arr[len(arr)-1] = arr[:len(arr)-1], 3
if len(arr) != 1 || arr[0] != 1 || arr[:2][1] != 3 {
panic(arr)

View File

@ -5,7 +5,7 @@
// license that can be found in the LICENSE file.
// gccgo did not permit omitting the type of a composite literal
// element when the element type is a pointer type.
// element when one of the middle omitted types was a pointer type.
package p

View File

@ -10,7 +10,6 @@ func (e myError) Error() string { return string(e) }
const myErrorVal myError = "error"
func IsMyError(err error) bool {
return err == error(myErrorVal)
}

View File

@ -34,7 +34,7 @@ type U3 interface { M; m() }
type U4 interface { M; M; M }
type U5 interface { U1; U2; U3; U4 }
type U6 interface { m(); m() } // ERROR "duplicate method"
type U7 interface { M32; m() } // ERROR "duplicate method"
type U8 interface { m(); M32 } // ERROR "duplicate method"
type U9 interface { M32; M64 } // ERROR "duplicate method"
type U6 interface { m(); m() } // ERROR "duplicate method .*m"
type U7 interface { M32; m() } // ERROR "duplicate method .*m"
type U8 interface { m(); M32 } // ERROR "duplicate method .*m"
type U9 interface { M32; M64 } // ERROR "duplicate method .*m"