--- /dev/null
+// errorcheck
+
+// Copyright 2016 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.
+
+// Test basic restrictions on type aliases.
+
+package p
+
+import (
+ "reflect"
+ . "reflect"
+)
+
+type T0 struct{}
+
+// Valid type alias declarations.
+
+type _ = T0
+type _ = int
+type _ = struct{}
+type _ = reflect.Value
+type _ = Value
+
+type (
+ A0 = T0
+ A1 = int
+ A2 = struct{}
+ A3 = reflect.Value
+ A4 = Value
+ A5 = Value
+
+ N0 A0
+)
+
+// Methods can be declared on the original named type and the alias.
+func (T0) m1() {} // GCCGO_ERROR "previous"
+func (*T0) m1() {} // ERROR "method redeclared: T0\.m1|redefinition of .m1."
+func (A0) m1() {} // ERROR "T0\.m1 redeclared in this block|redefinition of .m1."
+func (A0) m1() {} // ERROR "T0\.m1 redeclared in this block|redefinition of .m1."
+func (A0) m2() {}
+
+// Type aliases and the original type name can be used interchangeably.
+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 _ A5 = Value{}
+
+var _ interface {
+ m1()
+ m2()
+} = T0{}
+
+var _ interface {
+ m1()
+ m2()
+} = A0{}
+
+func _() {
+ type _ = T0
+ type _ = int
+ type _ = struct{}
+ type _ = reflect.Value
+ type _ = Value
+
+ type (
+ A0 = T0
+ A1 = int
+ A2 = struct{}
+ A3 = reflect.Value
+ A4 = Value
+ A5 Value
+
+ N0 A0
+ )
+
+ 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 _ A5 = Value{} // ERROR "cannot use reflect\.Value literal \(type reflect.Value\) as type A5 in assignment|incompatible type"
+}
+
+// Invalid type alias declarations.
+
+type _ = reflect.ValueOf // ERROR "reflect.ValueOf is not a type|expected type"
+
+func (A1) m() {} // ERROR "cannot define new methods on non-local type int|may not define methods on non-local type"
+func (A2) m() {} // ERROR "invalid receiver type"
+func (A3) m() {} // ERROR "cannot define new methods on non-local type reflect.Value|may not define methods on non-local type"
+func (A4) m() {} // ERROR "cannot define new methods on non-local type reflect.Value|may not define methods on non-local type"
+
+type B1 = struct{}
+
+func (B1) m() {} // ERROR "invalid receiver type"
+
+// TODO(gri) expand
--- /dev/null
+// Copyright 2017 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 "go/build"
+
+type (
+ Float64 = float64
+ Rune = rune
+)
+
+type (
+ Int int
+ IntAlias = Int
+ IntAlias2 = IntAlias
+ S struct {
+ Int
+ IntAlias
+ IntAlias2
+ }
+)
+
+type (
+ Context = build.Context
+)
+
+type (
+ I1 interface {
+ M1(IntAlias2) Float64
+ M2() Context
+ }
+
+ I2 = interface {
+ M1(Int) float64
+ M2() build.Context
+ }
+)
+
+var i1 I1
+var i2 I2 = i1
--- /dev/null
+// Copyright 2017 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"
+ . "go/build"
+)
+
+func F(x float64) a.Float64 {
+ return x
+}
+
+type MyContext = Context // = build.Context
+
+var C a.Context = Default
+
+type S struct{}
+
+func (S) M1(x a.IntAlias) float64 { return a.Float64(x) }
+func (S) M2() Context { return Default }
+
+var _ a.I1 = S{}
+var _ a.I2 = S{}
--- /dev/null
+// Copyright 2017 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 main
+
+import (
+ "./a"
+ "./b"
+)
+
+func main() {
+ var _ float64 = b.F(0)
+ var _ a.Rune = int32(0)
+
+ // embedded types can have different names but the same types
+ var s a.S
+ s.Int = 1
+ s.IntAlias = s.Int
+ s.IntAlias2 = s.Int
+
+ // aliases denote identical types across packages
+ var c a.Context = b.C
+ var _ b.MyContext = c
+}
--- /dev/null
+// rundir
+
+// Copyright 2017 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 ignored
--- /dev/null
+// run
+
+// Copyright 2019 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.
+
+// Test break statements in a select.
+// Gccgo had a bug in handling this.
+// Test 1,2,3-case selects, so it covers both the general
+// code path and the specialized optimizations for one-
+// and two-case selects.
+
+package main
+
+var ch = make(chan int)
+
+func main() {
+ go func() {
+ for {
+ ch <- 5
+ }
+ }()
+
+ select {
+ case <-ch:
+ break
+ panic("unreachable")
+ }
+
+ select {
+ default:
+ break
+ panic("unreachable")
+ }
+
+ select {
+ case <-ch:
+ break
+ panic("unreachable")
+ default:
+ break
+ panic("unreachable")
+ }
+
+ select {
+ case <-ch:
+ break
+ panic("unreachable")
+ case ch <- 10:
+ panic("unreachable")
+ default:
+ break
+ panic("unreachable")
+ }
+}
--- /dev/null
+// errorcheck
+
+// 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 did not reliably report mismatches between the
+// number of function results and the number of expected results.
+
+package p
+
+func G() (int, int, int) {
+ return 0, 0, 0
+}
+
+func F() {
+ a, b := G() // ERROR "mismatch"
+ a, b = G() // ERROR "mismatch"
+ _, _ = a, b
+}
+
+func H() (int, int) {
+ return G() // ERROR "too many|mismatch"
+}
--- /dev/null
+// 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
+
+var p2 = Printf // ERROR "undefined"
--- /dev/null
+// 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
--- /dev/null
+// errorcheckdir
+
+// 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.
+
+package ignored
--- /dev/null
+// 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
--- /dev/null
+// 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
--- /dev/null
+// 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
--- /dev/null
+// compiledir
+
+// 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.
+
+package ignored
--- /dev/null
+// 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
+
+type s struct {
+ s string
+}
+
+func F1(s s) {
+}
+
+func F2() s {
+ return s{""}
+}
--- /dev/null
+// 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 main
+
+import "./a"
+
+func main() {
+ defer a.F1(a.F2())
+}
--- /dev/null
+// rundir
+
+// 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.
+
+// Test case that gccgo failed to link.
+
+package ignored
--- /dev/null
+// compile
+
+// 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.
+
+// Test case that gccgo failed to compile.
+
+package p
+
+func F() []string {
+ return []string{""}
+}
+
+var V = append(F())
--- /dev/null
+// run
+
+// 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.
+
+// Gccgo incorrectly executed functions multiple times when they
+// appeared in a composite literal that required a conversion between
+// different interface types.
+
+package main
+
+type MyInt int
+
+var c MyInt
+
+func (c *MyInt) S(i int) {
+ *c = MyInt(i)
+}
+
+func (c *MyInt) V() int {
+ return int(*c)
+}
+
+type i1 interface {
+ S(int)
+ V() int
+}
+
+type i2 interface {
+ V() int
+}
+
+type s struct {
+ i i2
+}
+
+func f() i1 {
+ c++
+ return &c
+}
+
+func main() {
+ p := &s{f()}
+ if v := p.i.V(); v != 1 {
+ panic(v)
+ }
+ if c != 1 {
+ panic(c)
+ }
+}
--- /dev/null
+// compile
+
+// 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.
+
+// Gccgo used to give an error:
+// <built-in>: error: redefinition of ‘s$F$hash’
+// <built-in>: note: previous definition of ‘s$F$hash’ was here
+// <built-in>: error: redefinition of ‘s$F$equal’
+// <built-in>: note: previous definition of ‘s$F$equal’ was here
+
+package p
+
+type T1 int
+
+func (t T1) F() {
+ type s struct {
+ f string
+ }
+}
+
+type T2 int
+
+func (t T2) F() {
+ type s struct {
+ f string
+ }
+}
--- /dev/null
+// run
+
+// 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.
+
+// Gccgo used to miscompile this, because of the empty struct.
+
+package main
+
+type T struct {
+ field s
+}
+
+type s struct{}
+
+var X T
+
+func F(_ T, c interface{}) int {
+ return len(c.(string))
+}
+
+func main() {
+ if v := F(X, "hi"); v != 2 {
+ panic(v)
+ }
+}
--- /dev/null
+// run
+
+// Copyright 2016 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.
+
+// Gccgo got confused when a type was used both for a map bucket type
+// and for a map key type.
+
+package main
+
+func main() {
+ _ = make(map[byte]byte)
+ _ = make(map[[8]byte]chan struct{})
+}
--- /dev/null
+// run
+
+// Copyright 2016 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.
+
+// Gccgo generated incorrect GC info when a global variable was
+// initialized to a slice of a value containing pointers. The initial
+// backing array for the slice was allocated in the .data section,
+// which is fine, but the backing array was not registered as a GC
+// root.
+
+package main
+
+import (
+ "runtime"
+)
+
+type s struct {
+ str string
+}
+
+var a = []struct {
+ str string
+}{
+ {""},
+}
+
+var b = "b"
+var c = "c"
+
+func init() {
+ a[0].str = b + c
+}
+
+func main() {
+ runtime.GC()
+ if a[0].str != b + c {
+ panic(a[0].str)
+ }
+}
--- /dev/null
+// run
+
+// Copyright 2016 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.
+
+// Gccgo got a compiler crash compiling the addition of more than five
+// strings with mixed constants and variables.
+
+package main
+
+func F(s string) (string, error) {
+ return s, nil
+}
+
+func G(a, b, c string) (string, error) {
+ return F("a" + a + "b" + b + "c" + c)
+}
+
+func main() {
+ if got, _ := G("x", "y", "z"); got != "axbycz" {
+ panic(got)
+ }
+}
--- /dev/null
+// build
+
+// Copyright 2017 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.
+
+// Linking this with gccgo got an undefined symbol reference,
+// because the private method in testing.TB led gccgo to assume that
+// the interface method table would be defined in the testing package.
+
+package main
+
+import "testing"
+
+type I interface {
+ testing.TB
+ Parallel()
+}
+
+func F(i I) {
+ i.Log("F")
+}
+
+var t testing.T
+
+func main() {
+ F(&t)
+}
--- /dev/null
+// compile
+
+// Copyright 2017 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.
+
+// gccgo crashed compiling this file, due to failing to correctly emit
+// the type descriptor for a named alias.
+
+package p
+
+type entry = struct {
+ a, b, c int
+}
+
+var V entry
--- /dev/null
+// Copyright 2017 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 MyInt = int
--- /dev/null
+// Copyright 2017 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"
+
+func F() a.MyInt {
+ return 0
+}
--- /dev/null
+// Copyright 2017 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 c
+
+import "./b"
+
+var V = b.F()
--- /dev/null
+// Copyright 2017 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 main
+
+import "./c"
+
+func main() {
+ println(c.V)
+}
--- /dev/null
+// compiledir
+
+// Copyright 2017 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.
+
+// Gccgo mishandled a reference to a type alias in a package that was
+// not directly imported.
+
+package ignored
--- /dev/null
+// compile
+
+// Copyright 2017 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.
+
+// gccgo crashed compiling this file with a failed conversion to the
+// alias type when constructing the composite literal.
+
+package p
+
+type I interface{ M() }
+type A = I
+type S struct {
+ f A
+}
+
+func F(i I) S {
+ return S{f: i}
+}
--- /dev/null
+// Copyright 2017 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 internal struct {
+ f1 string
+ f2 float64
+}
+
+type S struct {
+ F struct {
+ I internal
+ }
+}
--- /dev/null
+// Copyright 2017 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 main
+
+import (
+ "fmt"
+
+ "./a"
+)
+
+var v = a.S{}
+
+func main() {
+ want := "{{ 0}}"
+ if got := fmt.Sprint(v.F); got != want {
+ panic(got)
+ }
+}
--- /dev/null
+// rundir
+
+// Copyright 2017 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.
+
+// Gccgo caused an undefined symbol reference building hash functions
+// for an imported struct with unexported fields.
+
+package ignored
--- /dev/null
+// Copyright 2019 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 I interface {
+ M()
+}
+
+type S struct {
+ I I
+}
--- /dev/null
+// Copyright 2019 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"
+
+var V2 I
--- /dev/null
+// Copyright 2019 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"
+
+var V1 = a.S{I: nil}
--- /dev/null
+// compiledir
+
+// Copyright 2019 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.
+
+// Gccgo mishandled a combination of normal import and dot import.
+
+package ignored
--- /dev/null
+// compile
+
+// 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.
+
+// Gccgo mishandles composite literals of map with type bool.
+
+package p
+
+var M = map[bool]uint8{
+ false: 0,
+ true: 1,
+}
--- /dev/null
+// compile
+
+// 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.
+
+// Gccgo mishandles a couple of alias cases.
+
+package p
+
+type S struct{}
+
+func (*S) M() {}
+
+type I interface {
+ M()
+}
+
+type A = *S
+
+var V1 I
+var _ = V1.(*S)
+var _ = V1.(A)
+
+func F() {
+ var v I
+ v = (*S)(nil)
+ v = A(nil)
+ _ = v
+}
--- /dev/null
+package a
+
+type T int
+
+func (a *T) Foo() [1]string {
+ var r [1]string
+ return r
+}
--- /dev/null
+package b
+
+import "./a"
+
+func F() (interface{}) {
+ var v *a.T
+ return v.Foo()
+}
--- /dev/null
+// compiledir
+
+// 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.
+
+// https://gcc.gnu.org/PR67968
+
+// gccgo compiler crash building the equality and hash functions for a
+// type when a return statement requires a conversion to interface
+// type of a call of function defined in a different package that
+// returns an unnamed type.
+
+package ignored
--- /dev/null
+// compile
+
+// Copyright 2016 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 crashed while compiling this code.
+// https://gcc.gnu.org/PR78763.
+
+package p
+
+import "unsafe"
+
+func F() int {
+ if unsafe.Sizeof(0) == 8 {
+ return 8
+ }
+ return 0
+}
--- /dev/null
+// compile
+
+// Copyright 2017 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 crashed while compiling a function that returned
+// multiple zero-sized structs.
+// https://gcc.gnu.org/PR80226.
+
+package p
+
+type S struct{}
+
+func F() (S, S) {
+ return S{}, S{}
+}
--- /dev/null
+// compile
+
+// Copyright 2019 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.
+
+// https://gcc.gnu.org/PR89321
+// gccgo compiler crash building map literals with a zero-sized value type.
+
+package p
+
+type M map[byte]struct{}
+
+var (
+ M1 = M{1: {}, 2: {}, 3: {}}
+ M2 = M{1: {}, 2: {}}
+)
--- /dev/null
+// run
+
+// 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.
+
+// Issues 12576 and 12621: Negative untyped floating point constants
+// with small magnitude round to 0, not negative zero.
+
+package main
+
+import "math"
+
+var m = -1e-10000
+
+func main() {
+ if math.Signbit(m) {
+ panic(m)
+ }
+}
--- /dev/null
+// errorcheck
+
+// Copyright 2017 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 p
+
+func f(x int) {
+ switch x {
+ case 0:
+ fallthrough
+ ; // ok
+ case 1:
+ fallthrough // ERROR "fallthrough statement out of place"
+ {}
+ case 2:
+ fallthrough // ERROR "cannot fallthrough"
+ }
+}
--- /dev/null
+// run
+// +build amd64
+// +build linux darwin
+
+// Copyright 2016 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 main
+
+import (
+ "fmt"
+ "syscall"
+)
+
+// Use global variables so the compiler
+// doesn't know that they are constants.
+var p = syscall.Getpagesize()
+var zero = 0
+var one = 1
+
+func main() {
+ // Allocate 2 pages of memory.
+ b, err := syscall.Mmap(-1, 0, 2*p, syscall.PROT_READ|syscall.PROT_WRITE, syscall.MAP_ANON|syscall.MAP_PRIVATE)
+ if err != nil {
+ panic(err)
+ }
+ // Mark the second page as faulting.
+ err = syscall.Mprotect(b[p:], syscall.PROT_NONE)
+ if err != nil {
+ panic(err)
+ }
+ // Get a slice pointing to the last byte of the good page.
+ x := b[p-one : p]
+
+ test16(x)
+ test16i(x, 0)
+ test32(x)
+ test32i(x, 0)
+ test64(x)
+ test64i(x, 0)
+}
+
+func test16(x []byte) uint16 {
+ defer func() {
+ r := recover()
+ if r == nil {
+ panic("no fault or bounds check failure happened")
+ }
+ s := fmt.Sprintf("%s", r)
+ if s != "runtime error: index out of range [1] with length 1" {
+ panic("bad panic: " + s)
+ }
+ }()
+ // Try to read 2 bytes from x.
+ return uint16(x[0]) | uint16(x[1])<<8
+
+ // We expect to get an "index out of range" error from x[1].
+ // If we promote the first load to a 2-byte load, it will segfault, which we don't want.
+}
+
+func test16i(x []byte, i int) uint16 {
+ defer func() {
+ r := recover()
+ if r == nil {
+ panic("no fault or bounds check failure happened")
+ }
+ s := fmt.Sprintf("%s", r)
+ if s != "runtime error: index out of range [1] with length 1" {
+ panic("bad panic: " + s)
+ }
+ }()
+ return uint16(x[i]) | uint16(x[i+1])<<8
+}
+
+func test32(x []byte) uint32 {
+ defer func() {
+ r := recover()
+ if r == nil {
+ panic("no fault or bounds check failure happened")
+ }
+ s := fmt.Sprintf("%s", r)
+ if s != "runtime error: index out of range [1] with length 1" {
+ panic("bad panic: " + s)
+ }
+ }()
+ return uint32(x[0]) | uint32(x[1])<<8 | uint32(x[2])<<16 | uint32(x[3])<<24
+}
+
+func test32i(x []byte, i int) uint32 {
+ defer func() {
+ r := recover()
+ if r == nil {
+ panic("no fault or bounds check failure happened")
+ }
+ s := fmt.Sprintf("%s", r)
+ if s != "runtime error: index out of range [1] with length 1" {
+ panic("bad panic: " + s)
+ }
+ }()
+ return uint32(x[i]) | uint32(x[i+1])<<8 | uint32(x[i+2])<<16 | uint32(x[i+3])<<24
+}
+
+func test64(x []byte) uint64 {
+ defer func() {
+ r := recover()
+ if r == nil {
+ panic("no fault or bounds check failure happened")
+ }
+ s := fmt.Sprintf("%s", r)
+ if s != "runtime error: index out of range [1] with length 1" {
+ panic("bad panic: " + s)
+ }
+ }()
+ return uint64(x[0]) | uint64(x[1])<<8 | uint64(x[2])<<16 | uint64(x[3])<<24 |
+ uint64(x[4])<<32 | uint64(x[5])<<40 | uint64(x[6])<<48 | uint64(x[7])<<56
+}
+
+func test64i(x []byte, i int) uint64 {
+ defer func() {
+ r := recover()
+ if r == nil {
+ panic("no fault or bounds check failure happened")
+ }
+ s := fmt.Sprintf("%s", r)
+ if s != "runtime error: index out of range [1] with length 1" {
+ panic("bad panic: " + s)
+ }
+ }()
+ return uint64(x[i+0]) | uint64(x[i+1])<<8 | uint64(x[i+2])<<16 | uint64(x[i+3])<<24 |
+ uint64(x[i+4])<<32 | uint64(x[i+5])<<40 | uint64(x[i+6])<<48 | uint64(x[i+7])<<56
+}
--- /dev/null
+// errorcheck
+
+// Copyright 2016 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.
+
+// Ensure that typed non-integer len and cap make arguments are not accepted.
+
+package main
+
+var sink []byte
+
+func main() {
+ sink = make([]byte, 1.0)
+ sink = make([]byte, float32(1.0)) // ERROR "non-integer.*len"
+ sink = make([]byte, float64(1.0)) // ERROR "non-integer.*len"
+
+ sink = make([]byte, 0, 1.0)
+ sink = make([]byte, 0, float32(1.0)) // ERROR "non-integer.*cap"
+ sink = make([]byte, 0, float64(1.0)) // ERROR "non-integer.*cap"
+
+ sink = make([]byte, 1+0i)
+ sink = make([]byte, complex64(1+0i)) // ERROR "non-integer.*len"
+ sink = make([]byte, complex128(1+0i)) // ERROR "non-integer.*len"
+
+ sink = make([]byte, 0, 1+0i)
+ sink = make([]byte, 0, complex64(1+0i)) // ERROR "non-integer.*cap"
+ sink = make([]byte, 0, complex128(1+0i)) // ERROR "non-integer.*cap"
+
+}
--- /dev/null
+// run
+
+// Copyright 2019 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 main
+
+import "reflect"
+
+var tests = []interface{}{
+ func(x int, s int) int {
+ return x << s
+ },
+ func(x int, s int64) int {
+ return x << s
+ },
+ func(x int, s int32) int {
+ return x << s
+ },
+ func(x int, s int16) int {
+ return x << s
+ },
+ func(x int, s int8) int {
+ return x << s
+ },
+ func(x int, s int) int {
+ return x >> s
+ },
+ func(x int, s int64) int {
+ return x >> s
+ },
+ func(x int, s int32) int {
+ return x >> s
+ },
+ func(x int, s int16) int {
+ return x >> s
+ },
+ func(x int, s int8) int {
+ return x >> s
+ },
+ func(x uint, s int) uint {
+ return x << s
+ },
+ func(x uint, s int64) uint {
+ return x << s
+ },
+ func(x uint, s int32) uint {
+ return x << s
+ },
+ func(x uint, s int16) uint {
+ return x << s
+ },
+ func(x uint, s int8) uint {
+ return x << s
+ },
+ func(x uint, s int) uint {
+ return x >> s
+ },
+ func(x uint, s int64) uint {
+ return x >> s
+ },
+ func(x uint, s int32) uint {
+ return x >> s
+ },
+ func(x uint, s int16) uint {
+ return x >> s
+ },
+ func(x uint, s int8) uint {
+ return x >> s
+ },
+}
+
+func main() {
+ for _, t := range tests {
+ runTest(reflect.ValueOf(t))
+ }
+}
+
+func runTest(f reflect.Value) {
+ xt := f.Type().In(0)
+ st := f.Type().In(1)
+
+ for _, x := range []int{1, 0, -1} {
+ for _, s := range []int{-99, -64, -63, -32, -31, -16, -15, -8, -7, -1, 0, 1, 7, 8, 15, 16, 31, 32, 63, 64, 99} {
+ args := []reflect.Value{
+ reflect.ValueOf(x).Convert(xt),
+ reflect.ValueOf(s).Convert(st),
+ }
+ if s < 0 {
+ shouldPanic(func() {
+ f.Call(args)
+ })
+ } else {
+ f.Call(args) // should not panic
+ }
+ }
+ }
+}
+
+func shouldPanic(f func()) {
+ defer func() {
+ if recover() == nil {
+ panic("did not panic")
+ }
+ }()
+ f()
+}
--- /dev/null
+// compile
+
+// 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.
+
+// Issue 20923: gccgo failed to compile parenthesized select case expressions.
+
+package p
+
+func F(c chan bool) {
+ select {
+ case (<-c):
+ case _ = (<-c):
+ case _, _ = (<-c):
+ case (c) <- true:
+ default:
+ }
+}
--- /dev/null
+// compile
+
+// Copyright 2017 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.
+
+// Gccgo crashed compiling this code due to failing to finalize
+// interfaces in the right order.
+
+package p
+
+type s1 struct {
+ f m
+ I
+}
+
+type m interface {
+ Mm(*s2)
+}
+
+type s2 struct {
+ *s1
+}
+
+type I interface {
+ MI()
+}
--- /dev/null
+// compile
+
+// Copyright 2017 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.
+
+// Issue 22305: gccgo failed to compile this file.
+
+package main
+
+var F func() [0]func()
+var i = 2
+var B = F()[i]
+
+func main() {}
--- /dev/null
+// run
+
+// 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.
+
+// Test order of evaluation of index operations.
+
+package main
+
+func main() {
+ arr := []int{1, 2}
+
+ // The spec says that in an assignment statement the operands
+ // of all index expressions and pointer indirections on the
+ // left, and the expressions on the right, are evaluated in
+ // the usual order. The usual order means function calls and
+ // channel operations are done first. Then the assignments are
+ // carried out one at a time. The operands of an index
+ // expression include both the array and the index. So this
+ // evaluates as
+ // tmp1 := arr
+ // tmp2 := len(arr) - 1
+ // tmp3 := len(arr)
+ // arr = arr[:tmp3-1]
+ // tmp1[tmp2] = 3
+ arr, arr[len(arr)-1] = arr[:len(arr)-1], 3
+
+ if len(arr) != 1 || arr[0] != 1 || arr[:2][1] != 3 {
+ panic(arr)
+ }
+}
--- /dev/null
+// run
+
+// Copyright 2017 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.
+
+// Caused gccgo to issue a spurious compilation error.
+
+package main
+
+type T struct{}
+
+func (*T) Foo() {}
+
+type P = *T
+
+func main() {
+ var p P
+ p.Foo()
+}
--- /dev/null
+// compile
+
+// 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.
+
+// A couple of aliases cases that gccgo incorrectly gave errors for.
+
+package p
+
+func F1() {
+ type E = struct{}
+ type X struct{}
+ var x X
+ var y E = x
+ _ = y
+}
+
+func F2() {
+ type E = struct{}
+ type S []E
+ type T []struct{}
+ type X struct{}
+ var x X
+ s := S{E{}}
+ t := T{struct{}{}}
+ _ = append(s, x)
+ _ = append(s, t[0])
+ _ = append(s, t...)
+}
--- /dev/null
+// run
+
+// 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.
+
+// gccgo mishandled passing a struct with an empty field through
+// reflect.Value.Call.
+
+package main
+
+import (
+ "reflect"
+)
+
+type Empty struct {
+ f1, f2 *byte
+ empty struct{}
+}
+
+func F(e Empty, s []string) {
+ if len(s) != 1 || s[0] != "hi" {
+ panic("bad slice")
+ }
+}
+
+func main() {
+ reflect.ValueOf(F).Call([]reflect.Value{
+ reflect.ValueOf(Empty{}),
+ reflect.ValueOf([]string{"hi"}),
+ })
+}
--- /dev/null
+// compile
+
+// 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.
+
+// gccgo did not permit omitting the type of a composite literal
+// element when the element type is a pointer type.
+
+package p
+
+type S []T
+type T struct { x int }
+
+var _ = map[string]*S{
+ "a": {
+ { 1 },
+ },
+}
+
+var _ = [1]*S{ { {1}, } }
--- /dev/null
+// compile
+
+// 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.
+
+// Failed to compile with gccgo.
+
+package p
+
+import "unsafe"
+
+const w int = int(unsafe.Sizeof(0))
+
+var a [w]byte
--- /dev/null
+// run
+
+// Copyright 2019 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.
+
+// This test makes sure the text output for bounds check failures is as expected.
+
+package main
+
+import (
+ "fmt"
+ "os"
+ "runtime"
+ "text/tabwriter"
+)
+
+// Testing with length 3 slices, arrays, and strings.
+// Large (>1<<32) values are included to test 32-bit platforms.
+var indexes = []int64{-9876543210, -1, 0, 2, 3, 9876543210}
+var slices = []int64{-9876543210, -1, 0, 3, 4, 9876543210}
+
+var w *tabwriter.Writer
+
+func main() {
+ w = tabwriter.NewWriter(os.Stdout, 0, 0, 1, ' ', tabwriter.AlignRight)
+ defer w.Flush()
+ doIndex()
+ doSlice()
+ doSlice3()
+}
+func doIndex() {
+ a := []int{1, 2, 3}
+ for _, i := range indexes {
+ printPanic(fmt.Sprintf("slice[%d]", i), func() {
+ _ = a[i]
+ })
+ }
+ b := [3]int{1, 2, 3}
+ for _, i := range indexes {
+ printPanic(fmt.Sprintf("array[%d]", i), func() {
+ _ = b[i]
+ })
+ }
+ c := "123"
+ for _, i := range indexes {
+ printPanic(fmt.Sprintf("string[%d]", i), func() {
+ _ = c[i]
+ })
+ }
+}
+
+func doSlice() {
+ a := []int{1, 2, 3}
+ for _, i := range slices {
+ for _, j := range slices {
+ printPanic(fmt.Sprintf("slice[%d:%d]", i, j), func() {
+ _ = a[i:j]
+ })
+ }
+ }
+ b := [3]int{1, 2, 3}
+ for _, i := range slices {
+ for _, j := range slices {
+ printPanic(fmt.Sprintf("array[%d:%d]", i, j), func() {
+ _ = b[i:j]
+ })
+ }
+ }
+ c := "123"
+ for _, i := range slices {
+ for _, j := range slices {
+ printPanic(fmt.Sprintf("string[%d:%d]", i, j), func() {
+ _ = c[i:j]
+ })
+ }
+ }
+}
+
+func doSlice3() {
+ a := []int{1, 2, 3}
+ for _, i := range slices {
+ for _, j := range slices {
+ for _, k := range slices {
+ printPanic(fmt.Sprintf("slice[%d:%d:%d]", i, j, k), func() {
+ _ = a[i:j:k]
+ })
+ }
+ }
+ }
+ b := [3]int{1, 2, 3}
+ for _, i := range slices {
+ for _, j := range slices {
+ for _, k := range slices {
+ printPanic(fmt.Sprintf("array[%d:%d:%d]", i, j, k), func() {
+ _ = b[i:j:k]
+ })
+ }
+ }
+ }
+}
+
+func printPanic(msg string, f func()) {
+ defer func() {
+ res := "no panic"
+ if e := recover(); e != nil {
+ res = e.(runtime.Error).Error()
+ }
+ fmt.Fprintf(w, "%s\t %s\n", msg, res)
+ }()
+ f()
+}
--- /dev/null
+ slice[-9876543210] runtime error: index out of range [-9876543210]
+ slice[-1] runtime error: index out of range [-1]
+ slice[0] no panic
+ slice[2] no panic
+ slice[3] runtime error: index out of range [3] with length 3
+ slice[9876543210] runtime error: index out of range [9876543210] with length 3
+ array[-9876543210] runtime error: index out of range [-9876543210]
+ array[-1] runtime error: index out of range [-1]
+ array[0] no panic
+ array[2] no panic
+ array[3] runtime error: index out of range [3] with length 3
+ array[9876543210] runtime error: index out of range [9876543210] with length 3
+ string[-9876543210] runtime error: index out of range [-9876543210]
+ string[-1] runtime error: index out of range [-1]
+ string[0] no panic
+ string[2] no panic
+ string[3] runtime error: index out of range [3] with length 3
+ string[9876543210] runtime error: index out of range [9876543210] with length 3
+ slice[-9876543210:-9876543210] runtime error: slice bounds out of range [:-9876543210]
+ slice[-9876543210:-1] runtime error: slice bounds out of range [:-1]
+ slice[-9876543210:0] runtime error: slice bounds out of range [-9876543210:]
+ slice[-9876543210:3] runtime error: slice bounds out of range [-9876543210:]
+ slice[-9876543210:4] runtime error: slice bounds out of range [:4] with capacity 3
+ slice[-9876543210:9876543210] runtime error: slice bounds out of range [:9876543210] with capacity 3
+ slice[-1:-9876543210] runtime error: slice bounds out of range [:-9876543210]
+ slice[-1:-1] runtime error: slice bounds out of range [:-1]
+ slice[-1:0] runtime error: slice bounds out of range [-1:]
+ slice[-1:3] runtime error: slice bounds out of range [-1:]
+ slice[-1:4] runtime error: slice bounds out of range [:4] with capacity 3
+ slice[-1:9876543210] runtime error: slice bounds out of range [:9876543210] with capacity 3
+ slice[0:-9876543210] runtime error: slice bounds out of range [:-9876543210]
+ slice[0:-1] runtime error: slice bounds out of range [:-1]
+ slice[0:0] no panic
+ slice[0:3] no panic
+ slice[0:4] runtime error: slice bounds out of range [:4] with capacity 3
+ slice[0:9876543210] runtime error: slice bounds out of range [:9876543210] with capacity 3
+ slice[3:-9876543210] runtime error: slice bounds out of range [:-9876543210]
+ slice[3:-1] runtime error: slice bounds out of range [:-1]
+ slice[3:0] runtime error: slice bounds out of range [3:0]
+ slice[3:3] no panic
+ slice[3:4] runtime error: slice bounds out of range [:4] with capacity 3
+ slice[3:9876543210] runtime error: slice bounds out of range [:9876543210] with capacity 3
+ slice[4:-9876543210] runtime error: slice bounds out of range [:-9876543210]
+ slice[4:-1] runtime error: slice bounds out of range [:-1]
+ slice[4:0] runtime error: slice bounds out of range [4:0]
+ slice[4:3] runtime error: slice bounds out of range [4:3]
+ slice[4:4] runtime error: slice bounds out of range [:4] with capacity 3
+ slice[4:9876543210] runtime error: slice bounds out of range [:9876543210] with capacity 3
+ slice[9876543210:-9876543210] runtime error: slice bounds out of range [:-9876543210]
+ slice[9876543210:-1] runtime error: slice bounds out of range [:-1]
+ slice[9876543210:0] runtime error: slice bounds out of range [9876543210:0]
+ slice[9876543210:3] runtime error: slice bounds out of range [9876543210:3]
+ slice[9876543210:4] runtime error: slice bounds out of range [:4] with capacity 3
+ slice[9876543210:9876543210] runtime error: slice bounds out of range [:9876543210] with capacity 3
+ array[-9876543210:-9876543210] runtime error: slice bounds out of range [:-9876543210]
+ array[-9876543210:-1] runtime error: slice bounds out of range [:-1]
+ array[-9876543210:0] runtime error: slice bounds out of range [-9876543210:]
+ array[-9876543210:3] runtime error: slice bounds out of range [-9876543210:]
+ array[-9876543210:4] runtime error: slice bounds out of range [:4] with length 3
+ array[-9876543210:9876543210] runtime error: slice bounds out of range [:9876543210] with length 3
+ array[-1:-9876543210] runtime error: slice bounds out of range [:-9876543210]
+ array[-1:-1] runtime error: slice bounds out of range [:-1]
+ array[-1:0] runtime error: slice bounds out of range [-1:]
+ array[-1:3] runtime error: slice bounds out of range [-1:]
+ array[-1:4] runtime error: slice bounds out of range [:4] with length 3
+ array[-1:9876543210] runtime error: slice bounds out of range [:9876543210] with length 3
+ array[0:-9876543210] runtime error: slice bounds out of range [:-9876543210]
+ array[0:-1] runtime error: slice bounds out of range [:-1]
+ array[0:0] no panic
+ array[0:3] no panic
+ array[0:4] runtime error: slice bounds out of range [:4] with length 3
+ array[0:9876543210] runtime error: slice bounds out of range [:9876543210] with length 3
+ array[3:-9876543210] runtime error: slice bounds out of range [:-9876543210]
+ array[3:-1] runtime error: slice bounds out of range [:-1]
+ array[3:0] runtime error: slice bounds out of range [3:0]
+ array[3:3] no panic
+ array[3:4] runtime error: slice bounds out of range [:4] with length 3
+ array[3:9876543210] runtime error: slice bounds out of range [:9876543210] with length 3
+ array[4:-9876543210] runtime error: slice bounds out of range [:-9876543210]
+ array[4:-1] runtime error: slice bounds out of range [:-1]
+ array[4:0] runtime error: slice bounds out of range [4:0]
+ array[4:3] runtime error: slice bounds out of range [4:3]
+ array[4:4] runtime error: slice bounds out of range [:4] with length 3
+ array[4:9876543210] runtime error: slice bounds out of range [:9876543210] with length 3
+ array[9876543210:-9876543210] runtime error: slice bounds out of range [:-9876543210]
+ array[9876543210:-1] runtime error: slice bounds out of range [:-1]
+ array[9876543210:0] runtime error: slice bounds out of range [9876543210:0]
+ array[9876543210:3] runtime error: slice bounds out of range [9876543210:3]
+ array[9876543210:4] runtime error: slice bounds out of range [:4] with length 3
+ array[9876543210:9876543210] runtime error: slice bounds out of range [:9876543210] with length 3
+ string[-9876543210:-9876543210] runtime error: slice bounds out of range [:-9876543210]
+ string[-9876543210:-1] runtime error: slice bounds out of range [:-1]
+ string[-9876543210:0] runtime error: slice bounds out of range [-9876543210:]
+ string[-9876543210:3] runtime error: slice bounds out of range [-9876543210:]
+ string[-9876543210:4] runtime error: slice bounds out of range [:4] with length 3
+ string[-9876543210:9876543210] runtime error: slice bounds out of range [:9876543210] with length 3
+ string[-1:-9876543210] runtime error: slice bounds out of range [:-9876543210]
+ string[-1:-1] runtime error: slice bounds out of range [:-1]
+ string[-1:0] runtime error: slice bounds out of range [-1:]
+ string[-1:3] runtime error: slice bounds out of range [-1:]
+ string[-1:4] runtime error: slice bounds out of range [:4] with length 3
+ string[-1:9876543210] runtime error: slice bounds out of range [:9876543210] with length 3
+ string[0:-9876543210] runtime error: slice bounds out of range [:-9876543210]
+ string[0:-1] runtime error: slice bounds out of range [:-1]
+ string[0:0] no panic
+ string[0:3] no panic
+ string[0:4] runtime error: slice bounds out of range [:4] with length 3
+ string[0:9876543210] runtime error: slice bounds out of range [:9876543210] with length 3
+ string[3:-9876543210] runtime error: slice bounds out of range [:-9876543210]
+ string[3:-1] runtime error: slice bounds out of range [:-1]
+ string[3:0] runtime error: slice bounds out of range [3:0]
+ string[3:3] no panic
+ string[3:4] runtime error: slice bounds out of range [:4] with length 3
+ string[3:9876543210] runtime error: slice bounds out of range [:9876543210] with length 3
+ string[4:-9876543210] runtime error: slice bounds out of range [:-9876543210]
+ string[4:-1] runtime error: slice bounds out of range [:-1]
+ string[4:0] runtime error: slice bounds out of range [4:0]
+ string[4:3] runtime error: slice bounds out of range [4:3]
+ string[4:4] runtime error: slice bounds out of range [:4] with length 3
+ string[4:9876543210] runtime error: slice bounds out of range [:9876543210] with length 3
+ string[9876543210:-9876543210] runtime error: slice bounds out of range [:-9876543210]
+ string[9876543210:-1] runtime error: slice bounds out of range [:-1]
+ string[9876543210:0] runtime error: slice bounds out of range [9876543210:0]
+ string[9876543210:3] runtime error: slice bounds out of range [9876543210:3]
+ string[9876543210:4] runtime error: slice bounds out of range [:4] with length 3
+ string[9876543210:9876543210] runtime error: slice bounds out of range [:9876543210] with length 3
+ slice[-9876543210:-9876543210:-9876543210] runtime error: slice bounds out of range [::-9876543210]
+ slice[-9876543210:-9876543210:-1] runtime error: slice bounds out of range [::-1]
+ slice[-9876543210:-9876543210:0] runtime error: slice bounds out of range [:-9876543210:]
+ slice[-9876543210:-9876543210:3] runtime error: slice bounds out of range [:-9876543210:]
+ slice[-9876543210:-9876543210:4] runtime error: slice bounds out of range [::4] with capacity 3
+ slice[-9876543210:-9876543210:9876543210] runtime error: slice bounds out of range [::9876543210] with capacity 3
+ slice[-9876543210:-1:-9876543210] runtime error: slice bounds out of range [::-9876543210]
+ slice[-9876543210:-1:-1] runtime error: slice bounds out of range [::-1]
+ slice[-9876543210:-1:0] runtime error: slice bounds out of range [:-1:]
+ slice[-9876543210:-1:3] runtime error: slice bounds out of range [:-1:]
+ slice[-9876543210:-1:4] runtime error: slice bounds out of range [::4] with capacity 3
+ slice[-9876543210:-1:9876543210] runtime error: slice bounds out of range [::9876543210] with capacity 3
+ slice[-9876543210:0:-9876543210] runtime error: slice bounds out of range [::-9876543210]
+ slice[-9876543210:0:-1] runtime error: slice bounds out of range [::-1]
+ slice[-9876543210:0:0] runtime error: slice bounds out of range [-9876543210::]
+ slice[-9876543210:0:3] runtime error: slice bounds out of range [-9876543210::]
+ slice[-9876543210:0:4] runtime error: slice bounds out of range [::4] with capacity 3
+ slice[-9876543210:0:9876543210] runtime error: slice bounds out of range [::9876543210] with capacity 3
+ slice[-9876543210:3:-9876543210] runtime error: slice bounds out of range [::-9876543210]
+ slice[-9876543210:3:-1] runtime error: slice bounds out of range [::-1]
+ slice[-9876543210:3:0] runtime error: slice bounds out of range [:3:0]
+ slice[-9876543210:3:3] runtime error: slice bounds out of range [-9876543210::]
+ slice[-9876543210:3:4] runtime error: slice bounds out of range [::4] with capacity 3
+ slice[-9876543210:3:9876543210] runtime error: slice bounds out of range [::9876543210] with capacity 3
+ slice[-9876543210:4:-9876543210] runtime error: slice bounds out of range [::-9876543210]
+ slice[-9876543210:4:-1] runtime error: slice bounds out of range [::-1]
+ slice[-9876543210:4:0] runtime error: slice bounds out of range [:4:0]
+ slice[-9876543210:4:3] runtime error: slice bounds out of range [:4:3]
+ slice[-9876543210:4:4] runtime error: slice bounds out of range [::4] with capacity 3
+ slice[-9876543210:4:9876543210] runtime error: slice bounds out of range [::9876543210] with capacity 3
+ slice[-9876543210:9876543210:-9876543210] runtime error: slice bounds out of range [::-9876543210]
+ slice[-9876543210:9876543210:-1] runtime error: slice bounds out of range [::-1]
+ slice[-9876543210:9876543210:0] runtime error: slice bounds out of range [:9876543210:0]
+ slice[-9876543210:9876543210:3] runtime error: slice bounds out of range [:9876543210:3]
+ slice[-9876543210:9876543210:4] runtime error: slice bounds out of range [::4] with capacity 3
+ slice[-9876543210:9876543210:9876543210] runtime error: slice bounds out of range [::9876543210] with capacity 3
+ slice[-1:-9876543210:-9876543210] runtime error: slice bounds out of range [::-9876543210]
+ slice[-1:-9876543210:-1] runtime error: slice bounds out of range [::-1]
+ slice[-1:-9876543210:0] runtime error: slice bounds out of range [:-9876543210:]
+ slice[-1:-9876543210:3] runtime error: slice bounds out of range [:-9876543210:]
+ slice[-1:-9876543210:4] runtime error: slice bounds out of range [::4] with capacity 3
+ slice[-1:-9876543210:9876543210] runtime error: slice bounds out of range [::9876543210] with capacity 3
+ slice[-1:-1:-9876543210] runtime error: slice bounds out of range [::-9876543210]
+ slice[-1:-1:-1] runtime error: slice bounds out of range [::-1]
+ slice[-1:-1:0] runtime error: slice bounds out of range [:-1:]
+ slice[-1:-1:3] runtime error: slice bounds out of range [:-1:]
+ slice[-1:-1:4] runtime error: slice bounds out of range [::4] with capacity 3
+ slice[-1:-1:9876543210] runtime error: slice bounds out of range [::9876543210] with capacity 3
+ slice[-1:0:-9876543210] runtime error: slice bounds out of range [::-9876543210]
+ slice[-1:0:-1] runtime error: slice bounds out of range [::-1]
+ slice[-1:0:0] runtime error: slice bounds out of range [-1::]
+ slice[-1:0:3] runtime error: slice bounds out of range [-1::]
+ slice[-1:0:4] runtime error: slice bounds out of range [::4] with capacity 3
+ slice[-1:0:9876543210] runtime error: slice bounds out of range [::9876543210] with capacity 3
+ slice[-1:3:-9876543210] runtime error: slice bounds out of range [::-9876543210]
+ slice[-1:3:-1] runtime error: slice bounds out of range [::-1]
+ slice[-1:3:0] runtime error: slice bounds out of range [:3:0]
+ slice[-1:3:3] runtime error: slice bounds out of range [-1::]
+ slice[-1:3:4] runtime error: slice bounds out of range [::4] with capacity 3
+ slice[-1:3:9876543210] runtime error: slice bounds out of range [::9876543210] with capacity 3
+ slice[-1:4:-9876543210] runtime error: slice bounds out of range [::-9876543210]
+ slice[-1:4:-1] runtime error: slice bounds out of range [::-1]
+ slice[-1:4:0] runtime error: slice bounds out of range [:4:0]
+ slice[-1:4:3] runtime error: slice bounds out of range [:4:3]
+ slice[-1:4:4] runtime error: slice bounds out of range [::4] with capacity 3
+ slice[-1:4:9876543210] runtime error: slice bounds out of range [::9876543210] with capacity 3
+ slice[-1:9876543210:-9876543210] runtime error: slice bounds out of range [::-9876543210]
+ slice[-1:9876543210:-1] runtime error: slice bounds out of range [::-1]
+ slice[-1:9876543210:0] runtime error: slice bounds out of range [:9876543210:0]
+ slice[-1:9876543210:3] runtime error: slice bounds out of range [:9876543210:3]
+ slice[-1:9876543210:4] runtime error: slice bounds out of range [::4] with capacity 3
+ slice[-1:9876543210:9876543210] runtime error: slice bounds out of range [::9876543210] with capacity 3
+ slice[0:-9876543210:-9876543210] runtime error: slice bounds out of range [::-9876543210]
+ slice[0:-9876543210:-1] runtime error: slice bounds out of range [::-1]
+ slice[0:-9876543210:0] runtime error: slice bounds out of range [:-9876543210:]
+ slice[0:-9876543210:3] runtime error: slice bounds out of range [:-9876543210:]
+ slice[0:-9876543210:4] runtime error: slice bounds out of range [::4] with capacity 3
+ slice[0:-9876543210:9876543210] runtime error: slice bounds out of range [::9876543210] with capacity 3
+ slice[0:-1:-9876543210] runtime error: slice bounds out of range [::-9876543210]
+ slice[0:-1:-1] runtime error: slice bounds out of range [::-1]
+ slice[0:-1:0] runtime error: slice bounds out of range [:-1:]
+ slice[0:-1:3] runtime error: slice bounds out of range [:-1:]
+ slice[0:-1:4] runtime error: slice bounds out of range [::4] with capacity 3
+ slice[0:-1:9876543210] runtime error: slice bounds out of range [::9876543210] with capacity 3
+ slice[0:0:-9876543210] runtime error: slice bounds out of range [::-9876543210]
+ slice[0:0:-1] runtime error: slice bounds out of range [::-1]
+ slice[0:0:0] no panic
+ slice[0:0:3] no panic
+ slice[0:0:4] runtime error: slice bounds out of range [::4] with capacity 3
+ slice[0:0:9876543210] runtime error: slice bounds out of range [::9876543210] with capacity 3
+ slice[0:3:-9876543210] runtime error: slice bounds out of range [::-9876543210]
+ slice[0:3:-1] runtime error: slice bounds out of range [::-1]
+ slice[0:3:0] runtime error: slice bounds out of range [:3:0]
+ slice[0:3:3] no panic
+ slice[0:3:4] runtime error: slice bounds out of range [::4] with capacity 3
+ slice[0:3:9876543210] runtime error: slice bounds out of range [::9876543210] with capacity 3
+ slice[0:4:-9876543210] runtime error: slice bounds out of range [::-9876543210]
+ slice[0:4:-1] runtime error: slice bounds out of range [::-1]
+ slice[0:4:0] runtime error: slice bounds out of range [:4:0]
+ slice[0:4:3] runtime error: slice bounds out of range [:4:3]
+ slice[0:4:4] runtime error: slice bounds out of range [::4] with capacity 3
+ slice[0:4:9876543210] runtime error: slice bounds out of range [::9876543210] with capacity 3
+ slice[0:9876543210:-9876543210] runtime error: slice bounds out of range [::-9876543210]
+ slice[0:9876543210:-1] runtime error: slice bounds out of range [::-1]
+ slice[0:9876543210:0] runtime error: slice bounds out of range [:9876543210:0]
+ slice[0:9876543210:3] runtime error: slice bounds out of range [:9876543210:3]
+ slice[0:9876543210:4] runtime error: slice bounds out of range [::4] with capacity 3
+ slice[0:9876543210:9876543210] runtime error: slice bounds out of range [::9876543210] with capacity 3
+ slice[3:-9876543210:-9876543210] runtime error: slice bounds out of range [::-9876543210]
+ slice[3:-9876543210:-1] runtime error: slice bounds out of range [::-1]
+ slice[3:-9876543210:0] runtime error: slice bounds out of range [:-9876543210:]
+ slice[3:-9876543210:3] runtime error: slice bounds out of range [:-9876543210:]
+ slice[3:-9876543210:4] runtime error: slice bounds out of range [::4] with capacity 3
+ slice[3:-9876543210:9876543210] runtime error: slice bounds out of range [::9876543210] with capacity 3
+ slice[3:-1:-9876543210] runtime error: slice bounds out of range [::-9876543210]
+ slice[3:-1:-1] runtime error: slice bounds out of range [::-1]
+ slice[3:-1:0] runtime error: slice bounds out of range [:-1:]
+ slice[3:-1:3] runtime error: slice bounds out of range [:-1:]
+ slice[3:-1:4] runtime error: slice bounds out of range [::4] with capacity 3
+ slice[3:-1:9876543210] runtime error: slice bounds out of range [::9876543210] with capacity 3
+ slice[3:0:-9876543210] runtime error: slice bounds out of range [::-9876543210]
+ slice[3:0:-1] runtime error: slice bounds out of range [::-1]
+ slice[3:0:0] runtime error: slice bounds out of range [3:0:]
+ slice[3:0:3] runtime error: slice bounds out of range [3:0:]
+ slice[3:0:4] runtime error: slice bounds out of range [::4] with capacity 3
+ slice[3:0:9876543210] runtime error: slice bounds out of range [::9876543210] with capacity 3
+ slice[3:3:-9876543210] runtime error: slice bounds out of range [::-9876543210]
+ slice[3:3:-1] runtime error: slice bounds out of range [::-1]
+ slice[3:3:0] runtime error: slice bounds out of range [:3:0]
+ slice[3:3:3] no panic
+ slice[3:3:4] runtime error: slice bounds out of range [::4] with capacity 3
+ slice[3:3:9876543210] runtime error: slice bounds out of range [::9876543210] with capacity 3
+ slice[3:4:-9876543210] runtime error: slice bounds out of range [::-9876543210]
+ slice[3:4:-1] runtime error: slice bounds out of range [::-1]
+ slice[3:4:0] runtime error: slice bounds out of range [:4:0]
+ slice[3:4:3] runtime error: slice bounds out of range [:4:3]
+ slice[3:4:4] runtime error: slice bounds out of range [::4] with capacity 3
+ slice[3:4:9876543210] runtime error: slice bounds out of range [::9876543210] with capacity 3
+ slice[3:9876543210:-9876543210] runtime error: slice bounds out of range [::-9876543210]
+ slice[3:9876543210:-1] runtime error: slice bounds out of range [::-1]
+ slice[3:9876543210:0] runtime error: slice bounds out of range [:9876543210:0]
+ slice[3:9876543210:3] runtime error: slice bounds out of range [:9876543210:3]
+ slice[3:9876543210:4] runtime error: slice bounds out of range [::4] with capacity 3
+ slice[3:9876543210:9876543210] runtime error: slice bounds out of range [::9876543210] with capacity 3
+ slice[4:-9876543210:-9876543210] runtime error: slice bounds out of range [::-9876543210]
+ slice[4:-9876543210:-1] runtime error: slice bounds out of range [::-1]
+ slice[4:-9876543210:0] runtime error: slice bounds out of range [:-9876543210:]
+ slice[4:-9876543210:3] runtime error: slice bounds out of range [:-9876543210:]
+ slice[4:-9876543210:4] runtime error: slice bounds out of range [::4] with capacity 3
+ slice[4:-9876543210:9876543210] runtime error: slice bounds out of range [::9876543210] with capacity 3
+ slice[4:-1:-9876543210] runtime error: slice bounds out of range [::-9876543210]
+ slice[4:-1:-1] runtime error: slice bounds out of range [::-1]
+ slice[4:-1:0] runtime error: slice bounds out of range [:-1:]
+ slice[4:-1:3] runtime error: slice bounds out of range [:-1:]
+ slice[4:-1:4] runtime error: slice bounds out of range [::4] with capacity 3
+ slice[4:-1:9876543210] runtime error: slice bounds out of range [::9876543210] with capacity 3
+ slice[4:0:-9876543210] runtime error: slice bounds out of range [::-9876543210]
+ slice[4:0:-1] runtime error: slice bounds out of range [::-1]
+ slice[4:0:0] runtime error: slice bounds out of range [4:0:]
+ slice[4:0:3] runtime error: slice bounds out of range [4:0:]
+ slice[4:0:4] runtime error: slice bounds out of range [::4] with capacity 3
+ slice[4:0:9876543210] runtime error: slice bounds out of range [::9876543210] with capacity 3
+ slice[4:3:-9876543210] runtime error: slice bounds out of range [::-9876543210]
+ slice[4:3:-1] runtime error: slice bounds out of range [::-1]
+ slice[4:3:0] runtime error: slice bounds out of range [:3:0]
+ slice[4:3:3] runtime error: slice bounds out of range [4:3:]
+ slice[4:3:4] runtime error: slice bounds out of range [::4] with capacity 3
+ slice[4:3:9876543210] runtime error: slice bounds out of range [::9876543210] with capacity 3
+ slice[4:4:-9876543210] runtime error: slice bounds out of range [::-9876543210]
+ slice[4:4:-1] runtime error: slice bounds out of range [::-1]
+ slice[4:4:0] runtime error: slice bounds out of range [:4:0]
+ slice[4:4:3] runtime error: slice bounds out of range [:4:3]
+ slice[4:4:4] runtime error: slice bounds out of range [::4] with capacity 3
+ slice[4:4:9876543210] runtime error: slice bounds out of range [::9876543210] with capacity 3
+ slice[4:9876543210:-9876543210] runtime error: slice bounds out of range [::-9876543210]
+ slice[4:9876543210:-1] runtime error: slice bounds out of range [::-1]
+ slice[4:9876543210:0] runtime error: slice bounds out of range [:9876543210:0]
+ slice[4:9876543210:3] runtime error: slice bounds out of range [:9876543210:3]
+ slice[4:9876543210:4] runtime error: slice bounds out of range [::4] with capacity 3
+ slice[4:9876543210:9876543210] runtime error: slice bounds out of range [::9876543210] with capacity 3
+ slice[9876543210:-9876543210:-9876543210] runtime error: slice bounds out of range [::-9876543210]
+ slice[9876543210:-9876543210:-1] runtime error: slice bounds out of range [::-1]
+ slice[9876543210:-9876543210:0] runtime error: slice bounds out of range [:-9876543210:]
+ slice[9876543210:-9876543210:3] runtime error: slice bounds out of range [:-9876543210:]
+ slice[9876543210:-9876543210:4] runtime error: slice bounds out of range [::4] with capacity 3
+ slice[9876543210:-9876543210:9876543210] runtime error: slice bounds out of range [::9876543210] with capacity 3
+ slice[9876543210:-1:-9876543210] runtime error: slice bounds out of range [::-9876543210]
+ slice[9876543210:-1:-1] runtime error: slice bounds out of range [::-1]
+ slice[9876543210:-1:0] runtime error: slice bounds out of range [:-1:]
+ slice[9876543210:-1:3] runtime error: slice bounds out of range [:-1:]
+ slice[9876543210:-1:4] runtime error: slice bounds out of range [::4] with capacity 3
+ slice[9876543210:-1:9876543210] runtime error: slice bounds out of range [::9876543210] with capacity 3
+ slice[9876543210:0:-9876543210] runtime error: slice bounds out of range [::-9876543210]
+ slice[9876543210:0:-1] runtime error: slice bounds out of range [::-1]
+ slice[9876543210:0:0] runtime error: slice bounds out of range [9876543210:0:]
+ slice[9876543210:0:3] runtime error: slice bounds out of range [9876543210:0:]
+ slice[9876543210:0:4] runtime error: slice bounds out of range [::4] with capacity 3
+ slice[9876543210:0:9876543210] runtime error: slice bounds out of range [::9876543210] with capacity 3
+ slice[9876543210:3:-9876543210] runtime error: slice bounds out of range [::-9876543210]
+ slice[9876543210:3:-1] runtime error: slice bounds out of range [::-1]
+ slice[9876543210:3:0] runtime error: slice bounds out of range [:3:0]
+ slice[9876543210:3:3] runtime error: slice bounds out of range [9876543210:3:]
+ slice[9876543210:3:4] runtime error: slice bounds out of range [::4] with capacity 3
+ slice[9876543210:3:9876543210] runtime error: slice bounds out of range [::9876543210] with capacity 3
+ slice[9876543210:4:-9876543210] runtime error: slice bounds out of range [::-9876543210]
+ slice[9876543210:4:-1] runtime error: slice bounds out of range [::-1]
+ slice[9876543210:4:0] runtime error: slice bounds out of range [:4:0]
+ slice[9876543210:4:3] runtime error: slice bounds out of range [:4:3]
+ slice[9876543210:4:4] runtime error: slice bounds out of range [::4] with capacity 3
+ slice[9876543210:4:9876543210] runtime error: slice bounds out of range [::9876543210] with capacity 3
+ slice[9876543210:9876543210:-9876543210] runtime error: slice bounds out of range [::-9876543210]
+ slice[9876543210:9876543210:-1] runtime error: slice bounds out of range [::-1]
+ slice[9876543210:9876543210:0] runtime error: slice bounds out of range [:9876543210:0]
+ slice[9876543210:9876543210:3] runtime error: slice bounds out of range [:9876543210:3]
+ slice[9876543210:9876543210:4] runtime error: slice bounds out of range [::4] with capacity 3
+ slice[9876543210:9876543210:9876543210] runtime error: slice bounds out of range [::9876543210] with capacity 3
+ array[-9876543210:-9876543210:-9876543210] runtime error: slice bounds out of range [::-9876543210]
+ array[-9876543210:-9876543210:-1] runtime error: slice bounds out of range [::-1]
+ array[-9876543210:-9876543210:0] runtime error: slice bounds out of range [:-9876543210:]
+ array[-9876543210:-9876543210:3] runtime error: slice bounds out of range [:-9876543210:]
+ array[-9876543210:-9876543210:4] runtime error: slice bounds out of range [::4] with length 3
+ array[-9876543210:-9876543210:9876543210] runtime error: slice bounds out of range [::9876543210] with length 3
+ array[-9876543210:-1:-9876543210] runtime error: slice bounds out of range [::-9876543210]
+ array[-9876543210:-1:-1] runtime error: slice bounds out of range [::-1]
+ array[-9876543210:-1:0] runtime error: slice bounds out of range [:-1:]
+ array[-9876543210:-1:3] runtime error: slice bounds out of range [:-1:]
+ array[-9876543210:-1:4] runtime error: slice bounds out of range [::4] with length 3
+ array[-9876543210:-1:9876543210] runtime error: slice bounds out of range [::9876543210] with length 3
+ array[-9876543210:0:-9876543210] runtime error: slice bounds out of range [::-9876543210]
+ array[-9876543210:0:-1] runtime error: slice bounds out of range [::-1]
+ array[-9876543210:0:0] runtime error: slice bounds out of range [-9876543210::]
+ array[-9876543210:0:3] runtime error: slice bounds out of range [-9876543210::]
+ array[-9876543210:0:4] runtime error: slice bounds out of range [::4] with length 3
+ array[-9876543210:0:9876543210] runtime error: slice bounds out of range [::9876543210] with length 3
+ array[-9876543210:3:-9876543210] runtime error: slice bounds out of range [::-9876543210]
+ array[-9876543210:3:-1] runtime error: slice bounds out of range [::-1]
+ array[-9876543210:3:0] runtime error: slice bounds out of range [:3:0]
+ array[-9876543210:3:3] runtime error: slice bounds out of range [-9876543210::]
+ array[-9876543210:3:4] runtime error: slice bounds out of range [::4] with length 3
+ array[-9876543210:3:9876543210] runtime error: slice bounds out of range [::9876543210] with length 3
+ array[-9876543210:4:-9876543210] runtime error: slice bounds out of range [::-9876543210]
+ array[-9876543210:4:-1] runtime error: slice bounds out of range [::-1]
+ array[-9876543210:4:0] runtime error: slice bounds out of range [:4:0]
+ array[-9876543210:4:3] runtime error: slice bounds out of range [:4:3]
+ array[-9876543210:4:4] runtime error: slice bounds out of range [::4] with length 3
+ array[-9876543210:4:9876543210] runtime error: slice bounds out of range [::9876543210] with length 3
+ array[-9876543210:9876543210:-9876543210] runtime error: slice bounds out of range [::-9876543210]
+ array[-9876543210:9876543210:-1] runtime error: slice bounds out of range [::-1]
+ array[-9876543210:9876543210:0] runtime error: slice bounds out of range [:9876543210:0]
+ array[-9876543210:9876543210:3] runtime error: slice bounds out of range [:9876543210:3]
+ array[-9876543210:9876543210:4] runtime error: slice bounds out of range [::4] with length 3
+ array[-9876543210:9876543210:9876543210] runtime error: slice bounds out of range [::9876543210] with length 3
+ array[-1:-9876543210:-9876543210] runtime error: slice bounds out of range [::-9876543210]
+ array[-1:-9876543210:-1] runtime error: slice bounds out of range [::-1]
+ array[-1:-9876543210:0] runtime error: slice bounds out of range [:-9876543210:]
+ array[-1:-9876543210:3] runtime error: slice bounds out of range [:-9876543210:]
+ array[-1:-9876543210:4] runtime error: slice bounds out of range [::4] with length 3
+ array[-1:-9876543210:9876543210] runtime error: slice bounds out of range [::9876543210] with length 3
+ array[-1:-1:-9876543210] runtime error: slice bounds out of range [::-9876543210]
+ array[-1:-1:-1] runtime error: slice bounds out of range [::-1]
+ array[-1:-1:0] runtime error: slice bounds out of range [:-1:]
+ array[-1:-1:3] runtime error: slice bounds out of range [:-1:]
+ array[-1:-1:4] runtime error: slice bounds out of range [::4] with length 3
+ array[-1:-1:9876543210] runtime error: slice bounds out of range [::9876543210] with length 3
+ array[-1:0:-9876543210] runtime error: slice bounds out of range [::-9876543210]
+ array[-1:0:-1] runtime error: slice bounds out of range [::-1]
+ array[-1:0:0] runtime error: slice bounds out of range [-1::]
+ array[-1:0:3] runtime error: slice bounds out of range [-1::]
+ array[-1:0:4] runtime error: slice bounds out of range [::4] with length 3
+ array[-1:0:9876543210] runtime error: slice bounds out of range [::9876543210] with length 3
+ array[-1:3:-9876543210] runtime error: slice bounds out of range [::-9876543210]
+ array[-1:3:-1] runtime error: slice bounds out of range [::-1]
+ array[-1:3:0] runtime error: slice bounds out of range [:3:0]
+ array[-1:3:3] runtime error: slice bounds out of range [-1::]
+ array[-1:3:4] runtime error: slice bounds out of range [::4] with length 3
+ array[-1:3:9876543210] runtime error: slice bounds out of range [::9876543210] with length 3
+ array[-1:4:-9876543210] runtime error: slice bounds out of range [::-9876543210]
+ array[-1:4:-1] runtime error: slice bounds out of range [::-1]
+ array[-1:4:0] runtime error: slice bounds out of range [:4:0]
+ array[-1:4:3] runtime error: slice bounds out of range [:4:3]
+ array[-1:4:4] runtime error: slice bounds out of range [::4] with length 3
+ array[-1:4:9876543210] runtime error: slice bounds out of range [::9876543210] with length 3
+ array[-1:9876543210:-9876543210] runtime error: slice bounds out of range [::-9876543210]
+ array[-1:9876543210:-1] runtime error: slice bounds out of range [::-1]
+ array[-1:9876543210:0] runtime error: slice bounds out of range [:9876543210:0]
+ array[-1:9876543210:3] runtime error: slice bounds out of range [:9876543210:3]
+ array[-1:9876543210:4] runtime error: slice bounds out of range [::4] with length 3
+ array[-1:9876543210:9876543210] runtime error: slice bounds out of range [::9876543210] with length 3
+ array[0:-9876543210:-9876543210] runtime error: slice bounds out of range [::-9876543210]
+ array[0:-9876543210:-1] runtime error: slice bounds out of range [::-1]
+ array[0:-9876543210:0] runtime error: slice bounds out of range [:-9876543210:]
+ array[0:-9876543210:3] runtime error: slice bounds out of range [:-9876543210:]
+ array[0:-9876543210:4] runtime error: slice bounds out of range [::4] with length 3
+ array[0:-9876543210:9876543210] runtime error: slice bounds out of range [::9876543210] with length 3
+ array[0:-1:-9876543210] runtime error: slice bounds out of range [::-9876543210]
+ array[0:-1:-1] runtime error: slice bounds out of range [::-1]
+ array[0:-1:0] runtime error: slice bounds out of range [:-1:]
+ array[0:-1:3] runtime error: slice bounds out of range [:-1:]
+ array[0:-1:4] runtime error: slice bounds out of range [::4] with length 3
+ array[0:-1:9876543210] runtime error: slice bounds out of range [::9876543210] with length 3
+ array[0:0:-9876543210] runtime error: slice bounds out of range [::-9876543210]
+ array[0:0:-1] runtime error: slice bounds out of range [::-1]
+ array[0:0:0] no panic
+ array[0:0:3] no panic
+ array[0:0:4] runtime error: slice bounds out of range [::4] with length 3
+ array[0:0:9876543210] runtime error: slice bounds out of range [::9876543210] with length 3
+ array[0:3:-9876543210] runtime error: slice bounds out of range [::-9876543210]
+ array[0:3:-1] runtime error: slice bounds out of range [::-1]
+ array[0:3:0] runtime error: slice bounds out of range [:3:0]
+ array[0:3:3] no panic
+ array[0:3:4] runtime error: slice bounds out of range [::4] with length 3
+ array[0:3:9876543210] runtime error: slice bounds out of range [::9876543210] with length 3
+ array[0:4:-9876543210] runtime error: slice bounds out of range [::-9876543210]
+ array[0:4:-1] runtime error: slice bounds out of range [::-1]
+ array[0:4:0] runtime error: slice bounds out of range [:4:0]
+ array[0:4:3] runtime error: slice bounds out of range [:4:3]
+ array[0:4:4] runtime error: slice bounds out of range [::4] with length 3
+ array[0:4:9876543210] runtime error: slice bounds out of range [::9876543210] with length 3
+ array[0:9876543210:-9876543210] runtime error: slice bounds out of range [::-9876543210]
+ array[0:9876543210:-1] runtime error: slice bounds out of range [::-1]
+ array[0:9876543210:0] runtime error: slice bounds out of range [:9876543210:0]
+ array[0:9876543210:3] runtime error: slice bounds out of range [:9876543210:3]
+ array[0:9876543210:4] runtime error: slice bounds out of range [::4] with length 3
+ array[0:9876543210:9876543210] runtime error: slice bounds out of range [::9876543210] with length 3
+ array[3:-9876543210:-9876543210] runtime error: slice bounds out of range [::-9876543210]
+ array[3:-9876543210:-1] runtime error: slice bounds out of range [::-1]
+ array[3:-9876543210:0] runtime error: slice bounds out of range [:-9876543210:]
+ array[3:-9876543210:3] runtime error: slice bounds out of range [:-9876543210:]
+ array[3:-9876543210:4] runtime error: slice bounds out of range [::4] with length 3
+ array[3:-9876543210:9876543210] runtime error: slice bounds out of range [::9876543210] with length 3
+ array[3:-1:-9876543210] runtime error: slice bounds out of range [::-9876543210]
+ array[3:-1:-1] runtime error: slice bounds out of range [::-1]
+ array[3:-1:0] runtime error: slice bounds out of range [:-1:]
+ array[3:-1:3] runtime error: slice bounds out of range [:-1:]
+ array[3:-1:4] runtime error: slice bounds out of range [::4] with length 3
+ array[3:-1:9876543210] runtime error: slice bounds out of range [::9876543210] with length 3
+ array[3:0:-9876543210] runtime error: slice bounds out of range [::-9876543210]
+ array[3:0:-1] runtime error: slice bounds out of range [::-1]
+ array[3:0:0] runtime error: slice bounds out of range [3:0:]
+ array[3:0:3] runtime error: slice bounds out of range [3:0:]
+ array[3:0:4] runtime error: slice bounds out of range [::4] with length 3
+ array[3:0:9876543210] runtime error: slice bounds out of range [::9876543210] with length 3
+ array[3:3:-9876543210] runtime error: slice bounds out of range [::-9876543210]
+ array[3:3:-1] runtime error: slice bounds out of range [::-1]
+ array[3:3:0] runtime error: slice bounds out of range [:3:0]
+ array[3:3:3] no panic
+ array[3:3:4] runtime error: slice bounds out of range [::4] with length 3
+ array[3:3:9876543210] runtime error: slice bounds out of range [::9876543210] with length 3
+ array[3:4:-9876543210] runtime error: slice bounds out of range [::-9876543210]
+ array[3:4:-1] runtime error: slice bounds out of range [::-1]
+ array[3:4:0] runtime error: slice bounds out of range [:4:0]
+ array[3:4:3] runtime error: slice bounds out of range [:4:3]
+ array[3:4:4] runtime error: slice bounds out of range [::4] with length 3
+ array[3:4:9876543210] runtime error: slice bounds out of range [::9876543210] with length 3
+ array[3:9876543210:-9876543210] runtime error: slice bounds out of range [::-9876543210]
+ array[3:9876543210:-1] runtime error: slice bounds out of range [::-1]
+ array[3:9876543210:0] runtime error: slice bounds out of range [:9876543210:0]
+ array[3:9876543210:3] runtime error: slice bounds out of range [:9876543210:3]
+ array[3:9876543210:4] runtime error: slice bounds out of range [::4] with length 3
+ array[3:9876543210:9876543210] runtime error: slice bounds out of range [::9876543210] with length 3
+ array[4:-9876543210:-9876543210] runtime error: slice bounds out of range [::-9876543210]
+ array[4:-9876543210:-1] runtime error: slice bounds out of range [::-1]
+ array[4:-9876543210:0] runtime error: slice bounds out of range [:-9876543210:]
+ array[4:-9876543210:3] runtime error: slice bounds out of range [:-9876543210:]
+ array[4:-9876543210:4] runtime error: slice bounds out of range [::4] with length 3
+ array[4:-9876543210:9876543210] runtime error: slice bounds out of range [::9876543210] with length 3
+ array[4:-1:-9876543210] runtime error: slice bounds out of range [::-9876543210]
+ array[4:-1:-1] runtime error: slice bounds out of range [::-1]
+ array[4:-1:0] runtime error: slice bounds out of range [:-1:]
+ array[4:-1:3] runtime error: slice bounds out of range [:-1:]
+ array[4:-1:4] runtime error: slice bounds out of range [::4] with length 3
+ array[4:-1:9876543210] runtime error: slice bounds out of range [::9876543210] with length 3
+ array[4:0:-9876543210] runtime error: slice bounds out of range [::-9876543210]
+ array[4:0:-1] runtime error: slice bounds out of range [::-1]
+ array[4:0:0] runtime error: slice bounds out of range [4:0:]
+ array[4:0:3] runtime error: slice bounds out of range [4:0:]
+ array[4:0:4] runtime error: slice bounds out of range [::4] with length 3
+ array[4:0:9876543210] runtime error: slice bounds out of range [::9876543210] with length 3
+ array[4:3:-9876543210] runtime error: slice bounds out of range [::-9876543210]
+ array[4:3:-1] runtime error: slice bounds out of range [::-1]
+ array[4:3:0] runtime error: slice bounds out of range [:3:0]
+ array[4:3:3] runtime error: slice bounds out of range [4:3:]
+ array[4:3:4] runtime error: slice bounds out of range [::4] with length 3
+ array[4:3:9876543210] runtime error: slice bounds out of range [::9876543210] with length 3
+ array[4:4:-9876543210] runtime error: slice bounds out of range [::-9876543210]
+ array[4:4:-1] runtime error: slice bounds out of range [::-1]
+ array[4:4:0] runtime error: slice bounds out of range [:4:0]
+ array[4:4:3] runtime error: slice bounds out of range [:4:3]
+ array[4:4:4] runtime error: slice bounds out of range [::4] with length 3
+ array[4:4:9876543210] runtime error: slice bounds out of range [::9876543210] with length 3
+ array[4:9876543210:-9876543210] runtime error: slice bounds out of range [::-9876543210]
+ array[4:9876543210:-1] runtime error: slice bounds out of range [::-1]
+ array[4:9876543210:0] runtime error: slice bounds out of range [:9876543210:0]
+ array[4:9876543210:3] runtime error: slice bounds out of range [:9876543210:3]
+ array[4:9876543210:4] runtime error: slice bounds out of range [::4] with length 3
+ array[4:9876543210:9876543210] runtime error: slice bounds out of range [::9876543210] with length 3
+ array[9876543210:-9876543210:-9876543210] runtime error: slice bounds out of range [::-9876543210]
+ array[9876543210:-9876543210:-1] runtime error: slice bounds out of range [::-1]
+ array[9876543210:-9876543210:0] runtime error: slice bounds out of range [:-9876543210:]
+ array[9876543210:-9876543210:3] runtime error: slice bounds out of range [:-9876543210:]
+ array[9876543210:-9876543210:4] runtime error: slice bounds out of range [::4] with length 3
+ array[9876543210:-9876543210:9876543210] runtime error: slice bounds out of range [::9876543210] with length 3
+ array[9876543210:-1:-9876543210] runtime error: slice bounds out of range [::-9876543210]
+ array[9876543210:-1:-1] runtime error: slice bounds out of range [::-1]
+ array[9876543210:-1:0] runtime error: slice bounds out of range [:-1:]
+ array[9876543210:-1:3] runtime error: slice bounds out of range [:-1:]
+ array[9876543210:-1:4] runtime error: slice bounds out of range [::4] with length 3
+ array[9876543210:-1:9876543210] runtime error: slice bounds out of range [::9876543210] with length 3
+ array[9876543210:0:-9876543210] runtime error: slice bounds out of range [::-9876543210]
+ array[9876543210:0:-1] runtime error: slice bounds out of range [::-1]
+ array[9876543210:0:0] runtime error: slice bounds out of range [9876543210:0:]
+ array[9876543210:0:3] runtime error: slice bounds out of range [9876543210:0:]
+ array[9876543210:0:4] runtime error: slice bounds out of range [::4] with length 3
+ array[9876543210:0:9876543210] runtime error: slice bounds out of range [::9876543210] with length 3
+ array[9876543210:3:-9876543210] runtime error: slice bounds out of range [::-9876543210]
+ array[9876543210:3:-1] runtime error: slice bounds out of range [::-1]
+ array[9876543210:3:0] runtime error: slice bounds out of range [:3:0]
+ array[9876543210:3:3] runtime error: slice bounds out of range [9876543210:3:]
+ array[9876543210:3:4] runtime error: slice bounds out of range [::4] with length 3
+ array[9876543210:3:9876543210] runtime error: slice bounds out of range [::9876543210] with length 3
+ array[9876543210:4:-9876543210] runtime error: slice bounds out of range [::-9876543210]
+ array[9876543210:4:-1] runtime error: slice bounds out of range [::-1]
+ array[9876543210:4:0] runtime error: slice bounds out of range [:4:0]
+ array[9876543210:4:3] runtime error: slice bounds out of range [:4:3]
+ array[9876543210:4:4] runtime error: slice bounds out of range [::4] with length 3
+ array[9876543210:4:9876543210] runtime error: slice bounds out of range [::9876543210] with length 3
+ array[9876543210:9876543210:-9876543210] runtime error: slice bounds out of range [::-9876543210]
+ array[9876543210:9876543210:-1] runtime error: slice bounds out of range [::-1]
+ array[9876543210:9876543210:0] runtime error: slice bounds out of range [:9876543210:0]
+ array[9876543210:9876543210:3] runtime error: slice bounds out of range [:9876543210:3]
+ array[9876543210:9876543210:4] runtime error: slice bounds out of range [::4] with length 3
+ array[9876543210:9876543210:9876543210] runtime error: slice bounds out of range [::9876543210] with length 3
--- /dev/null
+// run
+
+// Copyright 2019 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.
+
+// This test makes sure the text output for bounds check failures is as expected.
+
+package main
+
+import (
+ "fmt"
+ "os"
+ "runtime"
+ "text/tabwriter"
+)
+
+// Testing with length 3 slices, arrays, and strings.
+// A large (>1<<32) value is included to test 32-bit platforms.
+var indexes = []uint64{0, 2, 3, 1<<32 - 1, 1<<64 - 1}
+var slices = []uint64{0, 3, 4, 1<<32 - 1, 1<<64 - 1}
+
+var w *tabwriter.Writer
+
+func main() {
+ w = tabwriter.NewWriter(os.Stdout, 0, 0, 1, ' ', tabwriter.AlignRight)
+ defer w.Flush()
+ doIndex()
+ doSlice()
+ doSlice3()
+}
+func doIndex() {
+ a := []int{1, 2, 3}
+ for _, i := range indexes {
+ printPanic(fmt.Sprintf("slice[%d]", i), func() {
+ _ = a[i]
+ })
+ }
+ b := [3]int{1, 2, 3}
+ for _, i := range indexes {
+ printPanic(fmt.Sprintf("array[%d]", i), func() {
+ _ = b[i]
+ })
+ }
+ c := "123"
+ for _, i := range indexes {
+ printPanic(fmt.Sprintf("string[%d]", i), func() {
+ _ = c[i]
+ })
+ }
+}
+
+func doSlice() {
+ a := []int{1, 2, 3}
+ for _, i := range slices {
+ for _, j := range slices {
+ printPanic(fmt.Sprintf("slice[%d:%d]", i, j), func() {
+ _ = a[i:j]
+ })
+ }
+ }
+ b := [3]int{1, 2, 3}
+ for _, i := range slices {
+ for _, j := range slices {
+ printPanic(fmt.Sprintf("array[%d:%d]", i, j), func() {
+ _ = b[i:j]
+ })
+ }
+ }
+ c := "123"
+ for _, i := range slices {
+ for _, j := range slices {
+ printPanic(fmt.Sprintf("string[%d:%d]", i, j), func() {
+ _ = c[i:j]
+ })
+ }
+ }
+}
+
+func doSlice3() {
+ a := []int{1, 2, 3}
+ for _, i := range slices {
+ for _, j := range slices {
+ for _, k := range slices {
+ printPanic(fmt.Sprintf("slice[%d:%d:%d]", i, j, k), func() {
+ _ = a[i:j:k]
+ })
+ }
+ }
+ }
+ b := [3]int{1, 2, 3}
+ for _, i := range slices {
+ for _, j := range slices {
+ for _, k := range slices {
+ printPanic(fmt.Sprintf("array[%d:%d:%d]", i, j, k), func() {
+ _ = b[i:j:k]
+ })
+ }
+ }
+ }
+}
+
+func printPanic(msg string, f func()) {
+ defer func() {
+ res := "no panic"
+ if e := recover(); e != nil {
+ res = e.(runtime.Error).Error()
+ }
+ fmt.Fprintf(w, "%s\t %s\n", msg, res)
+ }()
+ f()
+}
--- /dev/null
+ slice[0] no panic
+ slice[2] no panic
+ slice[3] runtime error: index out of range [3] with length 3
+ slice[4294967295] runtime error: index out of range [4294967295] with length 3
+ slice[18446744073709551615] runtime error: index out of range [18446744073709551615] with length 3
+ array[0] no panic
+ array[2] no panic
+ array[3] runtime error: index out of range [3] with length 3
+ array[4294967295] runtime error: index out of range [4294967295] with length 3
+ array[18446744073709551615] runtime error: index out of range [18446744073709551615] with length 3
+ string[0] no panic
+ string[2] no panic
+ string[3] runtime error: index out of range [3] with length 3
+ string[4294967295] runtime error: index out of range [4294967295] with length 3
+ string[18446744073709551615] runtime error: index out of range [18446744073709551615] with length 3
+ slice[0:0] no panic
+ slice[0:3] no panic
+ slice[0:4] runtime error: slice bounds out of range [:4] with capacity 3
+ slice[0:4294967295] runtime error: slice bounds out of range [:4294967295] with capacity 3
+ slice[0:18446744073709551615] runtime error: slice bounds out of range [:18446744073709551615] with capacity 3
+ slice[3:0] runtime error: slice bounds out of range [3:0]
+ slice[3:3] no panic
+ slice[3:4] runtime error: slice bounds out of range [:4] with capacity 3
+ slice[3:4294967295] runtime error: slice bounds out of range [:4294967295] with capacity 3
+ slice[3:18446744073709551615] runtime error: slice bounds out of range [:18446744073709551615] with capacity 3
+ slice[4:0] runtime error: slice bounds out of range [4:0]
+ slice[4:3] runtime error: slice bounds out of range [4:3]
+ slice[4:4] runtime error: slice bounds out of range [:4] with capacity 3
+ slice[4:4294967295] runtime error: slice bounds out of range [:4294967295] with capacity 3
+ slice[4:18446744073709551615] runtime error: slice bounds out of range [:18446744073709551615] with capacity 3
+ slice[4294967295:0] runtime error: slice bounds out of range [4294967295:0]
+ slice[4294967295:3] runtime error: slice bounds out of range [4294967295:3]
+ slice[4294967295:4] runtime error: slice bounds out of range [:4] with capacity 3
+ slice[4294967295:4294967295] runtime error: slice bounds out of range [:4294967295] with capacity 3
+ slice[4294967295:18446744073709551615] runtime error: slice bounds out of range [:18446744073709551615] with capacity 3
+ slice[18446744073709551615:0] runtime error: slice bounds out of range [18446744073709551615:0]
+ slice[18446744073709551615:3] runtime error: slice bounds out of range [18446744073709551615:3]
+ slice[18446744073709551615:4] runtime error: slice bounds out of range [:4] with capacity 3
+ slice[18446744073709551615:4294967295] runtime error: slice bounds out of range [:4294967295] with capacity 3
+ slice[18446744073709551615:18446744073709551615] runtime error: slice bounds out of range [:18446744073709551615] with capacity 3
+ array[0:0] no panic
+ array[0:3] no panic
+ array[0:4] runtime error: slice bounds out of range [:4] with length 3
+ array[0:4294967295] runtime error: slice bounds out of range [:4294967295] with length 3
+ array[0:18446744073709551615] runtime error: slice bounds out of range [:18446744073709551615] with length 3
+ array[3:0] runtime error: slice bounds out of range [3:0]
+ array[3:3] no panic
+ array[3:4] runtime error: slice bounds out of range [:4] with length 3
+ array[3:4294967295] runtime error: slice bounds out of range [:4294967295] with length 3
+ array[3:18446744073709551615] runtime error: slice bounds out of range [:18446744073709551615] with length 3
+ array[4:0] runtime error: slice bounds out of range [4:0]
+ array[4:3] runtime error: slice bounds out of range [4:3]
+ array[4:4] runtime error: slice bounds out of range [:4] with length 3
+ array[4:4294967295] runtime error: slice bounds out of range [:4294967295] with length 3
+ array[4:18446744073709551615] runtime error: slice bounds out of range [:18446744073709551615] with length 3
+ array[4294967295:0] runtime error: slice bounds out of range [4294967295:0]
+ array[4294967295:3] runtime error: slice bounds out of range [4294967295:3]
+ array[4294967295:4] runtime error: slice bounds out of range [:4] with length 3
+ array[4294967295:4294967295] runtime error: slice bounds out of range [:4294967295] with length 3
+ array[4294967295:18446744073709551615] runtime error: slice bounds out of range [:18446744073709551615] with length 3
+ array[18446744073709551615:0] runtime error: slice bounds out of range [18446744073709551615:0]
+ array[18446744073709551615:3] runtime error: slice bounds out of range [18446744073709551615:3]
+ array[18446744073709551615:4] runtime error: slice bounds out of range [:4] with length 3
+ array[18446744073709551615:4294967295] runtime error: slice bounds out of range [:4294967295] with length 3
+ array[18446744073709551615:18446744073709551615] runtime error: slice bounds out of range [:18446744073709551615] with length 3
+ string[0:0] no panic
+ string[0:3] no panic
+ string[0:4] runtime error: slice bounds out of range [:4] with length 3
+ string[0:4294967295] runtime error: slice bounds out of range [:4294967295] with length 3
+ string[0:18446744073709551615] runtime error: slice bounds out of range [:18446744073709551615] with length 3
+ string[3:0] runtime error: slice bounds out of range [3:0]
+ string[3:3] no panic
+ string[3:4] runtime error: slice bounds out of range [:4] with length 3
+ string[3:4294967295] runtime error: slice bounds out of range [:4294967295] with length 3
+ string[3:18446744073709551615] runtime error: slice bounds out of range [:18446744073709551615] with length 3
+ string[4:0] runtime error: slice bounds out of range [4:0]
+ string[4:3] runtime error: slice bounds out of range [4:3]
+ string[4:4] runtime error: slice bounds out of range [:4] with length 3
+ string[4:4294967295] runtime error: slice bounds out of range [:4294967295] with length 3
+ string[4:18446744073709551615] runtime error: slice bounds out of range [:18446744073709551615] with length 3
+ string[4294967295:0] runtime error: slice bounds out of range [4294967295:0]
+ string[4294967295:3] runtime error: slice bounds out of range [4294967295:3]
+ string[4294967295:4] runtime error: slice bounds out of range [:4] with length 3
+ string[4294967295:4294967295] runtime error: slice bounds out of range [:4294967295] with length 3
+ string[4294967295:18446744073709551615] runtime error: slice bounds out of range [:18446744073709551615] with length 3
+ string[18446744073709551615:0] runtime error: slice bounds out of range [18446744073709551615:0]
+ string[18446744073709551615:3] runtime error: slice bounds out of range [18446744073709551615:3]
+ string[18446744073709551615:4] runtime error: slice bounds out of range [:4] with length 3
+ string[18446744073709551615:4294967295] runtime error: slice bounds out of range [:4294967295] with length 3
+ string[18446744073709551615:18446744073709551615] runtime error: slice bounds out of range [:18446744073709551615] with length 3
+ slice[0:0:0] no panic
+ slice[0:0:3] no panic
+ slice[0:0:4] runtime error: slice bounds out of range [::4] with capacity 3
+ slice[0:0:4294967295] runtime error: slice bounds out of range [::4294967295] with capacity 3
+ slice[0:0:18446744073709551615] runtime error: slice bounds out of range [::18446744073709551615] with capacity 3
+ slice[0:3:0] runtime error: slice bounds out of range [:3:0]
+ slice[0:3:3] no panic
+ slice[0:3:4] runtime error: slice bounds out of range [::4] with capacity 3
+ slice[0:3:4294967295] runtime error: slice bounds out of range [::4294967295] with capacity 3
+ slice[0:3:18446744073709551615] runtime error: slice bounds out of range [::18446744073709551615] with capacity 3
+ slice[0:4:0] runtime error: slice bounds out of range [:4:0]
+ slice[0:4:3] runtime error: slice bounds out of range [:4:3]
+ slice[0:4:4] runtime error: slice bounds out of range [::4] with capacity 3
+ slice[0:4:4294967295] runtime error: slice bounds out of range [::4294967295] with capacity 3
+ slice[0:4:18446744073709551615] runtime error: slice bounds out of range [::18446744073709551615] with capacity 3
+ slice[0:4294967295:0] runtime error: slice bounds out of range [:4294967295:0]
+ slice[0:4294967295:3] runtime error: slice bounds out of range [:4294967295:3]
+ slice[0:4294967295:4] runtime error: slice bounds out of range [::4] with capacity 3
+ slice[0:4294967295:4294967295] runtime error: slice bounds out of range [::4294967295] with capacity 3
+ slice[0:4294967295:18446744073709551615] runtime error: slice bounds out of range [::18446744073709551615] with capacity 3
+ slice[0:18446744073709551615:0] runtime error: slice bounds out of range [:18446744073709551615:0]
+ slice[0:18446744073709551615:3] runtime error: slice bounds out of range [:18446744073709551615:3]
+ slice[0:18446744073709551615:4] runtime error: slice bounds out of range [::4] with capacity 3
+ slice[0:18446744073709551615:4294967295] runtime error: slice bounds out of range [::4294967295] with capacity 3
+ slice[0:18446744073709551615:18446744073709551615] runtime error: slice bounds out of range [::18446744073709551615] with capacity 3
+ slice[3:0:0] runtime error: slice bounds out of range [3:0:]
+ slice[3:0:3] runtime error: slice bounds out of range [3:0:]
+ slice[3:0:4] runtime error: slice bounds out of range [::4] with capacity 3
+ slice[3:0:4294967295] runtime error: slice bounds out of range [::4294967295] with capacity 3
+ slice[3:0:18446744073709551615] runtime error: slice bounds out of range [::18446744073709551615] with capacity 3
+ slice[3:3:0] runtime error: slice bounds out of range [:3:0]
+ slice[3:3:3] no panic
+ slice[3:3:4] runtime error: slice bounds out of range [::4] with capacity 3
+ slice[3:3:4294967295] runtime error: slice bounds out of range [::4294967295] with capacity 3
+ slice[3:3:18446744073709551615] runtime error: slice bounds out of range [::18446744073709551615] with capacity 3
+ slice[3:4:0] runtime error: slice bounds out of range [:4:0]
+ slice[3:4:3] runtime error: slice bounds out of range [:4:3]
+ slice[3:4:4] runtime error: slice bounds out of range [::4] with capacity 3
+ slice[3:4:4294967295] runtime error: slice bounds out of range [::4294967295] with capacity 3
+ slice[3:4:18446744073709551615] runtime error: slice bounds out of range [::18446744073709551615] with capacity 3
+ slice[3:4294967295:0] runtime error: slice bounds out of range [:4294967295:0]
+ slice[3:4294967295:3] runtime error: slice bounds out of range [:4294967295:3]
+ slice[3:4294967295:4] runtime error: slice bounds out of range [::4] with capacity 3
+ slice[3:4294967295:4294967295] runtime error: slice bounds out of range [::4294967295] with capacity 3
+ slice[3:4294967295:18446744073709551615] runtime error: slice bounds out of range [::18446744073709551615] with capacity 3
+ slice[3:18446744073709551615:0] runtime error: slice bounds out of range [:18446744073709551615:0]
+ slice[3:18446744073709551615:3] runtime error: slice bounds out of range [:18446744073709551615:3]
+ slice[3:18446744073709551615:4] runtime error: slice bounds out of range [::4] with capacity 3
+ slice[3:18446744073709551615:4294967295] runtime error: slice bounds out of range [::4294967295] with capacity 3
+ slice[3:18446744073709551615:18446744073709551615] runtime error: slice bounds out of range [::18446744073709551615] with capacity 3
+ slice[4:0:0] runtime error: slice bounds out of range [4:0:]
+ slice[4:0:3] runtime error: slice bounds out of range [4:0:]
+ slice[4:0:4] runtime error: slice bounds out of range [::4] with capacity 3
+ slice[4:0:4294967295] runtime error: slice bounds out of range [::4294967295] with capacity 3
+ slice[4:0:18446744073709551615] runtime error: slice bounds out of range [::18446744073709551615] with capacity 3
+ slice[4:3:0] runtime error: slice bounds out of range [:3:0]
+ slice[4:3:3] runtime error: slice bounds out of range [4:3:]
+ slice[4:3:4] runtime error: slice bounds out of range [::4] with capacity 3
+ slice[4:3:4294967295] runtime error: slice bounds out of range [::4294967295] with capacity 3
+ slice[4:3:18446744073709551615] runtime error: slice bounds out of range [::18446744073709551615] with capacity 3
+ slice[4:4:0] runtime error: slice bounds out of range [:4:0]
+ slice[4:4:3] runtime error: slice bounds out of range [:4:3]
+ slice[4:4:4] runtime error: slice bounds out of range [::4] with capacity 3
+ slice[4:4:4294967295] runtime error: slice bounds out of range [::4294967295] with capacity 3
+ slice[4:4:18446744073709551615] runtime error: slice bounds out of range [::18446744073709551615] with capacity 3
+ slice[4:4294967295:0] runtime error: slice bounds out of range [:4294967295:0]
+ slice[4:4294967295:3] runtime error: slice bounds out of range [:4294967295:3]
+ slice[4:4294967295:4] runtime error: slice bounds out of range [::4] with capacity 3
+ slice[4:4294967295:4294967295] runtime error: slice bounds out of range [::4294967295] with capacity 3
+ slice[4:4294967295:18446744073709551615] runtime error: slice bounds out of range [::18446744073709551615] with capacity 3
+ slice[4:18446744073709551615:0] runtime error: slice bounds out of range [:18446744073709551615:0]
+ slice[4:18446744073709551615:3] runtime error: slice bounds out of range [:18446744073709551615:3]
+ slice[4:18446744073709551615:4] runtime error: slice bounds out of range [::4] with capacity 3
+ slice[4:18446744073709551615:4294967295] runtime error: slice bounds out of range [::4294967295] with capacity 3
+ slice[4:18446744073709551615:18446744073709551615] runtime error: slice bounds out of range [::18446744073709551615] with capacity 3
+ slice[4294967295:0:0] runtime error: slice bounds out of range [4294967295:0:]
+ slice[4294967295:0:3] runtime error: slice bounds out of range [4294967295:0:]
+ slice[4294967295:0:4] runtime error: slice bounds out of range [::4] with capacity 3
+ slice[4294967295:0:4294967295] runtime error: slice bounds out of range [::4294967295] with capacity 3
+ slice[4294967295:0:18446744073709551615] runtime error: slice bounds out of range [::18446744073709551615] with capacity 3
+ slice[4294967295:3:0] runtime error: slice bounds out of range [:3:0]
+ slice[4294967295:3:3] runtime error: slice bounds out of range [4294967295:3:]
+ slice[4294967295:3:4] runtime error: slice bounds out of range [::4] with capacity 3
+ slice[4294967295:3:4294967295] runtime error: slice bounds out of range [::4294967295] with capacity 3
+ slice[4294967295:3:18446744073709551615] runtime error: slice bounds out of range [::18446744073709551615] with capacity 3
+ slice[4294967295:4:0] runtime error: slice bounds out of range [:4:0]
+ slice[4294967295:4:3] runtime error: slice bounds out of range [:4:3]
+ slice[4294967295:4:4] runtime error: slice bounds out of range [::4] with capacity 3
+ slice[4294967295:4:4294967295] runtime error: slice bounds out of range [::4294967295] with capacity 3
+ slice[4294967295:4:18446744073709551615] runtime error: slice bounds out of range [::18446744073709551615] with capacity 3
+ slice[4294967295:4294967295:0] runtime error: slice bounds out of range [:4294967295:0]
+ slice[4294967295:4294967295:3] runtime error: slice bounds out of range [:4294967295:3]
+ slice[4294967295:4294967295:4] runtime error: slice bounds out of range [::4] with capacity 3
+ slice[4294967295:4294967295:4294967295] runtime error: slice bounds out of range [::4294967295] with capacity 3
+ slice[4294967295:4294967295:18446744073709551615] runtime error: slice bounds out of range [::18446744073709551615] with capacity 3
+ slice[4294967295:18446744073709551615:0] runtime error: slice bounds out of range [:18446744073709551615:0]
+ slice[4294967295:18446744073709551615:3] runtime error: slice bounds out of range [:18446744073709551615:3]
+ slice[4294967295:18446744073709551615:4] runtime error: slice bounds out of range [::4] with capacity 3
+ slice[4294967295:18446744073709551615:4294967295] runtime error: slice bounds out of range [::4294967295] with capacity 3
+ slice[4294967295:18446744073709551615:18446744073709551615] runtime error: slice bounds out of range [::18446744073709551615] with capacity 3
+ slice[18446744073709551615:0:0] runtime error: slice bounds out of range [18446744073709551615:0:]
+ slice[18446744073709551615:0:3] runtime error: slice bounds out of range [18446744073709551615:0:]
+ slice[18446744073709551615:0:4] runtime error: slice bounds out of range [::4] with capacity 3
+ slice[18446744073709551615:0:4294967295] runtime error: slice bounds out of range [::4294967295] with capacity 3
+ slice[18446744073709551615:0:18446744073709551615] runtime error: slice bounds out of range [::18446744073709551615] with capacity 3
+ slice[18446744073709551615:3:0] runtime error: slice bounds out of range [:3:0]
+ slice[18446744073709551615:3:3] runtime error: slice bounds out of range [18446744073709551615:3:]
+ slice[18446744073709551615:3:4] runtime error: slice bounds out of range [::4] with capacity 3
+ slice[18446744073709551615:3:4294967295] runtime error: slice bounds out of range [::4294967295] with capacity 3
+ slice[18446744073709551615:3:18446744073709551615] runtime error: slice bounds out of range [::18446744073709551615] with capacity 3
+ slice[18446744073709551615:4:0] runtime error: slice bounds out of range [:4:0]
+ slice[18446744073709551615:4:3] runtime error: slice bounds out of range [:4:3]
+ slice[18446744073709551615:4:4] runtime error: slice bounds out of range [::4] with capacity 3
+ slice[18446744073709551615:4:4294967295] runtime error: slice bounds out of range [::4294967295] with capacity 3
+ slice[18446744073709551615:4:18446744073709551615] runtime error: slice bounds out of range [::18446744073709551615] with capacity 3
+ slice[18446744073709551615:4294967295:0] runtime error: slice bounds out of range [:4294967295:0]
+ slice[18446744073709551615:4294967295:3] runtime error: slice bounds out of range [:4294967295:3]
+ slice[18446744073709551615:4294967295:4] runtime error: slice bounds out of range [::4] with capacity 3
+ slice[18446744073709551615:4294967295:4294967295] runtime error: slice bounds out of range [::4294967295] with capacity 3
+ slice[18446744073709551615:4294967295:18446744073709551615] runtime error: slice bounds out of range [::18446744073709551615] with capacity 3
+ slice[18446744073709551615:18446744073709551615:0] runtime error: slice bounds out of range [:18446744073709551615:0]
+ slice[18446744073709551615:18446744073709551615:3] runtime error: slice bounds out of range [:18446744073709551615:3]
+ slice[18446744073709551615:18446744073709551615:4] runtime error: slice bounds out of range [::4] with capacity 3
+ slice[18446744073709551615:18446744073709551615:4294967295] runtime error: slice bounds out of range [::4294967295] with capacity 3
+ slice[18446744073709551615:18446744073709551615:18446744073709551615] runtime error: slice bounds out of range [::18446744073709551615] with capacity 3
+ array[0:0:0] no panic
+ array[0:0:3] no panic
+ array[0:0:4] runtime error: slice bounds out of range [::4] with length 3
+ array[0:0:4294967295] runtime error: slice bounds out of range [::4294967295] with length 3
+ array[0:0:18446744073709551615] runtime error: slice bounds out of range [::18446744073709551615] with length 3
+ array[0:3:0] runtime error: slice bounds out of range [:3:0]
+ array[0:3:3] no panic
+ array[0:3:4] runtime error: slice bounds out of range [::4] with length 3
+ array[0:3:4294967295] runtime error: slice bounds out of range [::4294967295] with length 3
+ array[0:3:18446744073709551615] runtime error: slice bounds out of range [::18446744073709551615] with length 3
+ array[0:4:0] runtime error: slice bounds out of range [:4:0]
+ array[0:4:3] runtime error: slice bounds out of range [:4:3]
+ array[0:4:4] runtime error: slice bounds out of range [::4] with length 3
+ array[0:4:4294967295] runtime error: slice bounds out of range [::4294967295] with length 3
+ array[0:4:18446744073709551615] runtime error: slice bounds out of range [::18446744073709551615] with length 3
+ array[0:4294967295:0] runtime error: slice bounds out of range [:4294967295:0]
+ array[0:4294967295:3] runtime error: slice bounds out of range [:4294967295:3]
+ array[0:4294967295:4] runtime error: slice bounds out of range [::4] with length 3
+ array[0:4294967295:4294967295] runtime error: slice bounds out of range [::4294967295] with length 3
+ array[0:4294967295:18446744073709551615] runtime error: slice bounds out of range [::18446744073709551615] with length 3
+ array[0:18446744073709551615:0] runtime error: slice bounds out of range [:18446744073709551615:0]
+ array[0:18446744073709551615:3] runtime error: slice bounds out of range [:18446744073709551615:3]
+ array[0:18446744073709551615:4] runtime error: slice bounds out of range [::4] with length 3
+ array[0:18446744073709551615:4294967295] runtime error: slice bounds out of range [::4294967295] with length 3
+ array[0:18446744073709551615:18446744073709551615] runtime error: slice bounds out of range [::18446744073709551615] with length 3
+ array[3:0:0] runtime error: slice bounds out of range [3:0:]
+ array[3:0:3] runtime error: slice bounds out of range [3:0:]
+ array[3:0:4] runtime error: slice bounds out of range [::4] with length 3
+ array[3:0:4294967295] runtime error: slice bounds out of range [::4294967295] with length 3
+ array[3:0:18446744073709551615] runtime error: slice bounds out of range [::18446744073709551615] with length 3
+ array[3:3:0] runtime error: slice bounds out of range [:3:0]
+ array[3:3:3] no panic
+ array[3:3:4] runtime error: slice bounds out of range [::4] with length 3
+ array[3:3:4294967295] runtime error: slice bounds out of range [::4294967295] with length 3
+ array[3:3:18446744073709551615] runtime error: slice bounds out of range [::18446744073709551615] with length 3
+ array[3:4:0] runtime error: slice bounds out of range [:4:0]
+ array[3:4:3] runtime error: slice bounds out of range [:4:3]
+ array[3:4:4] runtime error: slice bounds out of range [::4] with length 3
+ array[3:4:4294967295] runtime error: slice bounds out of range [::4294967295] with length 3
+ array[3:4:18446744073709551615] runtime error: slice bounds out of range [::18446744073709551615] with length 3
+ array[3:4294967295:0] runtime error: slice bounds out of range [:4294967295:0]
+ array[3:4294967295:3] runtime error: slice bounds out of range [:4294967295:3]
+ array[3:4294967295:4] runtime error: slice bounds out of range [::4] with length 3
+ array[3:4294967295:4294967295] runtime error: slice bounds out of range [::4294967295] with length 3
+ array[3:4294967295:18446744073709551615] runtime error: slice bounds out of range [::18446744073709551615] with length 3
+ array[3:18446744073709551615:0] runtime error: slice bounds out of range [:18446744073709551615:0]
+ array[3:18446744073709551615:3] runtime error: slice bounds out of range [:18446744073709551615:3]
+ array[3:18446744073709551615:4] runtime error: slice bounds out of range [::4] with length 3
+ array[3:18446744073709551615:4294967295] runtime error: slice bounds out of range [::4294967295] with length 3
+ array[3:18446744073709551615:18446744073709551615] runtime error: slice bounds out of range [::18446744073709551615] with length 3
+ array[4:0:0] runtime error: slice bounds out of range [4:0:]
+ array[4:0:3] runtime error: slice bounds out of range [4:0:]
+ array[4:0:4] runtime error: slice bounds out of range [::4] with length 3
+ array[4:0:4294967295] runtime error: slice bounds out of range [::4294967295] with length 3
+ array[4:0:18446744073709551615] runtime error: slice bounds out of range [::18446744073709551615] with length 3
+ array[4:3:0] runtime error: slice bounds out of range [:3:0]
+ array[4:3:3] runtime error: slice bounds out of range [4:3:]
+ array[4:3:4] runtime error: slice bounds out of range [::4] with length 3
+ array[4:3:4294967295] runtime error: slice bounds out of range [::4294967295] with length 3
+ array[4:3:18446744073709551615] runtime error: slice bounds out of range [::18446744073709551615] with length 3
+ array[4:4:0] runtime error: slice bounds out of range [:4:0]
+ array[4:4:3] runtime error: slice bounds out of range [:4:3]
+ array[4:4:4] runtime error: slice bounds out of range [::4] with length 3
+ array[4:4:4294967295] runtime error: slice bounds out of range [::4294967295] with length 3
+ array[4:4:18446744073709551615] runtime error: slice bounds out of range [::18446744073709551615] with length 3
+ array[4:4294967295:0] runtime error: slice bounds out of range [:4294967295:0]
+ array[4:4294967295:3] runtime error: slice bounds out of range [:4294967295:3]
+ array[4:4294967295:4] runtime error: slice bounds out of range [::4] with length 3
+ array[4:4294967295:4294967295] runtime error: slice bounds out of range [::4294967295] with length 3
+ array[4:4294967295:18446744073709551615] runtime error: slice bounds out of range [::18446744073709551615] with length 3
+ array[4:18446744073709551615:0] runtime error: slice bounds out of range [:18446744073709551615:0]
+ array[4:18446744073709551615:3] runtime error: slice bounds out of range [:18446744073709551615:3]
+ array[4:18446744073709551615:4] runtime error: slice bounds out of range [::4] with length 3
+ array[4:18446744073709551615:4294967295] runtime error: slice bounds out of range [::4294967295] with length 3
+ array[4:18446744073709551615:18446744073709551615] runtime error: slice bounds out of range [::18446744073709551615] with length 3
+ array[4294967295:0:0] runtime error: slice bounds out of range [4294967295:0:]
+ array[4294967295:0:3] runtime error: slice bounds out of range [4294967295:0:]
+ array[4294967295:0:4] runtime error: slice bounds out of range [::4] with length 3
+ array[4294967295:0:4294967295] runtime error: slice bounds out of range [::4294967295] with length 3
+ array[4294967295:0:18446744073709551615] runtime error: slice bounds out of range [::18446744073709551615] with length 3
+ array[4294967295:3:0] runtime error: slice bounds out of range [:3:0]
+ array[4294967295:3:3] runtime error: slice bounds out of range [4294967295:3:]
+ array[4294967295:3:4] runtime error: slice bounds out of range [::4] with length 3
+ array[4294967295:3:4294967295] runtime error: slice bounds out of range [::4294967295] with length 3
+ array[4294967295:3:18446744073709551615] runtime error: slice bounds out of range [::18446744073709551615] with length 3
+ array[4294967295:4:0] runtime error: slice bounds out of range [:4:0]
+ array[4294967295:4:3] runtime error: slice bounds out of range [:4:3]
+ array[4294967295:4:4] runtime error: slice bounds out of range [::4] with length 3
+ array[4294967295:4:4294967295] runtime error: slice bounds out of range [::4294967295] with length 3
+ array[4294967295:4:18446744073709551615] runtime error: slice bounds out of range [::18446744073709551615] with length 3
+ array[4294967295:4294967295:0] runtime error: slice bounds out of range [:4294967295:0]
+ array[4294967295:4294967295:3] runtime error: slice bounds out of range [:4294967295:3]
+ array[4294967295:4294967295:4] runtime error: slice bounds out of range [::4] with length 3
+ array[4294967295:4294967295:4294967295] runtime error: slice bounds out of range [::4294967295] with length 3
+ array[4294967295:4294967295:18446744073709551615] runtime error: slice bounds out of range [::18446744073709551615] with length 3
+ array[4294967295:18446744073709551615:0] runtime error: slice bounds out of range [:18446744073709551615:0]
+ array[4294967295:18446744073709551615:3] runtime error: slice bounds out of range [:18446744073709551615:3]
+ array[4294967295:18446744073709551615:4] runtime error: slice bounds out of range [::4] with length 3
+ array[4294967295:18446744073709551615:4294967295] runtime error: slice bounds out of range [::4294967295] with length 3
+ array[4294967295:18446744073709551615:18446744073709551615] runtime error: slice bounds out of range [::18446744073709551615] with length 3
+ array[18446744073709551615:0:0] runtime error: slice bounds out of range [18446744073709551615:0:]
+ array[18446744073709551615:0:3] runtime error: slice bounds out of range [18446744073709551615:0:]
+ array[18446744073709551615:0:4] runtime error: slice bounds out of range [::4] with length 3
+ array[18446744073709551615:0:4294967295] runtime error: slice bounds out of range [::4294967295] with length 3
+ array[18446744073709551615:0:18446744073709551615] runtime error: slice bounds out of range [::18446744073709551615] with length 3
+ array[18446744073709551615:3:0] runtime error: slice bounds out of range [:3:0]
+ array[18446744073709551615:3:3] runtime error: slice bounds out of range [18446744073709551615:3:]
+ array[18446744073709551615:3:4] runtime error: slice bounds out of range [::4] with length 3
+ array[18446744073709551615:3:4294967295] runtime error: slice bounds out of range [::4294967295] with length 3
+ array[18446744073709551615:3:18446744073709551615] runtime error: slice bounds out of range [::18446744073709551615] with length 3
+ array[18446744073709551615:4:0] runtime error: slice bounds out of range [:4:0]
+ array[18446744073709551615:4:3] runtime error: slice bounds out of range [:4:3]
+ array[18446744073709551615:4:4] runtime error: slice bounds out of range [::4] with length 3
+ array[18446744073709551615:4:4294967295] runtime error: slice bounds out of range [::4294967295] with length 3
+ array[18446744073709551615:4:18446744073709551615] runtime error: slice bounds out of range [::18446744073709551615] with length 3
+ array[18446744073709551615:4294967295:0] runtime error: slice bounds out of range [:4294967295:0]
+ array[18446744073709551615:4294967295:3] runtime error: slice bounds out of range [:4294967295:3]
+ array[18446744073709551615:4294967295:4] runtime error: slice bounds out of range [::4] with length 3
+ array[18446744073709551615:4294967295:4294967295] runtime error: slice bounds out of range [::4294967295] with length 3
+ array[18446744073709551615:4294967295:18446744073709551615] runtime error: slice bounds out of range [::18446744073709551615] with length 3
+ array[18446744073709551615:18446744073709551615:0] runtime error: slice bounds out of range [:18446744073709551615:0]
+ array[18446744073709551615:18446744073709551615:3] runtime error: slice bounds out of range [:18446744073709551615:3]
+ array[18446744073709551615:18446744073709551615:4] runtime error: slice bounds out of range [::4] with length 3
+ array[18446744073709551615:18446744073709551615:4294967295] runtime error: slice bounds out of range [::4294967295] with length 3
+ array[18446744073709551615:18446744073709551615:18446744073709551615] runtime error: slice bounds out of range [::18446744073709551615] with length 3
--- /dev/null
+// Copyright 2019 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 I interface {
+ I2
+}
+type I2 interface {
+ M()
+}
+type S struct{}
+
+func (*S) M() {}
+
+func New() I {
+ return &S{}
+}
--- /dev/null
+// Copyright 2019 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"
+)
+
+func B(p1 a.I, p2 a.I2) int {
+ return 42
+}
--- /dev/null
+// compiledir
+
+// Copyright 2019 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 ignored
--- /dev/null
+// Copyright 2019 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 struct { x int }
+
+func F() interface{} {
+ return [2]T{}
+}
+
+func P() interface{} {
+ return &[2]T{}
+}
--- /dev/null
+// Copyright 2019 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"
+
+func F() interface{} {
+ return a.F()
+}
+
+func P() interface{} {
+ return a.P()
+}
--- /dev/null
+// Copyright 2019 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 c
+
+import "./b"
+
+func F() interface{} {
+ go func(){}() // make it non-inlineable
+ return b.F()
+}
+
+func P() interface{} {
+ go func(){}() // make it non-inlineable
+ return b.P()
+}
--- /dev/null
+// Copyright 2019 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 main
+
+import "./c"
+import "reflect"
+
+func main() {
+ x := c.F()
+ p := c.P()
+ t := reflect.PtrTo(reflect.TypeOf(x))
+ tp := reflect.TypeOf(p)
+ if t != tp {
+ panic("FAIL")
+ }
+}
--- /dev/null
+// rundir
+
+// Copyright 2019 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.
+
+// Issue 32901: type descriptor equality bug in gccgo.
+
+package ignored
--- /dev/null
+// Copyright 2019 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
+
+func A() int {
+ return p("count")
+}
+
+func p(which string, args ...string) int {
+ switch which {
+ case "count", "something":
+ return 1
+ default:
+ return 2
+ }
+}
--- /dev/null
+// Copyright 2019 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"
+
+func B() int {
+ return 99 + a.A()
+}
--- /dev/null
+// compiledir
+
+// Copyright 2019 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.
+
+// This directory contains a pair of packages that triggers a compiler
+// error in gccgo (problem with the way inlinable call expressions are
+// imported). See issue 32922 for details.
+
+package ignored
--- /dev/null
+// Copyright 2019 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 G interface {
+ UsesEmpty(p interface{}) int
+}
--- /dev/null
+// Copyright 2019 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"
+
+type Service uint64
+type ServiceDesc struct {
+ X int
+ uc
+}
+
+type uc interface {
+ f() a.G
+}
+
+var q int
+
+func RS(svcd *ServiceDesc, server interface{}, qq uint8) *Service {
+ defer func() { q += int(qq) }()
+ return nil
+}
--- /dev/null
+// Copyright 2019 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 c
+
+import (
+ "a"
+ "b"
+)
+
+type BI interface {
+ Something(s int64) int64
+ Another(pxp a.G) int32
+}
+
+func BRS(sd *b.ServiceDesc, server BI, xyz int) *b.Service {
+ return b.RS(sd, server, 7)
+}
--- /dev/null
+// Copyright 2019 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 d
+
+import (
+ "b"
+ "c"
+)
+
+var GA b.Service
+
+func C() {
+ c.BRS(nil, nil, 22)
+}
--- /dev/null
+// compiledir
+
+// Copyright 2019 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.
+
+// Issue 33013: gccgo compiler error with inlinable function
+
+package ignored
--- /dev/null
+// Copyright 2019 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
+
+var G1 int
+var G2 int
+var G3 int
+var G4 int
+var G5 int
+var G6 int
+var G7 int
+var G8 int
+var G9 int
+var G10 int
--- /dev/null
+// Copyright 2019 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"
+
+var N n
+
+type n struct{}
+
+func (r n) M1() int { return a.G1 }
+func (r n) M2() int { return a.G2 }
+func (r n) M3() int { return a.G3 }
+func (r n) M4() int { return a.G4 }
+func (r n) M5() int { return a.G5 }
+func (r n) M6() int { return a.G6 }
+func (r n) M7() int { return a.G7 }
+func (r n) M8() int { return a.G8 }
+func (r n) M9() int { return a.G9 }
+func (r n) M10() int { return a.G10 }
--- /dev/null
+// compiledir
+
+// Copyright 2019 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.
+
+// Issue 33020: gccgo undefined behavior with inlinable function
+
+package ignored
--- /dev/null
+// run
+
+// Copyright 2019 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.
+
+// Issue 33062: gccgo generates incorrect type equality
+// functions.
+
+package main
+
+type simpleStruct struct {
+ int
+ string
+}
+
+type complexStruct struct {
+ int
+ simpleStruct
+}
+
+func main() {
+ x := complexStruct{1, simpleStruct{2, "xxx"}}
+ ix := interface{}(x)
+ y := complexStruct{1, simpleStruct{2, "yyy"}}
+ iy := interface{}(y)
+ if ix != ix {
+ panic("FAIL")
+ }
+ if ix == iy {
+ panic("FAIL")
+ }
+}
--- /dev/null
+// Copyright 2019 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
+
+var GS string
+
+func M() string {
+ if s := getname("Fred"); s != "" {
+ return s
+ }
+ if s := getname("Joe"); s != "" {
+ return s
+ }
+
+ return string("Alex")
+}
+
+// getname can be any function returning a string, just has to be non-inlinable.
+
+//go:noinline
+func getname(s string) string {
+ return s + "foo"
+}
--- /dev/null
+// Copyright 2019 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"
+
+func B() string {
+ return a.M()
+}
--- /dev/null
+// compiledir
+
+// Copyright 2019 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.
+
+// Issue 33158: gccgo duplicate def error from importing inlinable function
+
+package ignored
--- /dev/null
+// Copyright 2019 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 A interface {
+ M(i interface{}) interface{}
+}
+
+var a1 A
+var a2 A
+
+func V(p A, k, v interface{}) A {
+ defer func() { a1, a2 = a2, a1 }()
+ return a1
+}
--- /dev/null
+// Copyright 2019 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"
+
+type Service uint64
+
+var q *Service
+var r *Service
+
+type f struct{}
+
+var fk f
+
+func No(s a.A, qq uint8) *Service {
+ defer func() { q, r = r, q }()
+ return q
+}
+
+func Yes(s a.A, p *uint64) a.A {
+ return a.V(s, fk, p)
+}
--- /dev/null
+// Copyright 2019 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 c
+
+import (
+ "a"
+ "b"
+)
+
+type BI interface {
+ Another(pxp a.A) int32
+}
+
+//go:noinline
+func BRS(sd a.A, xyz int) *b.Service {
+ x := b.Yes(sd, nil)
+ return b.No(x, 1)
+}
--- /dev/null
+// compiledir
+
+// Copyright 2019 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.
+
+// Issue 33219: gccgo assert in "implements_interface()"
+
+package ignored
--- /dev/null
+// Copyright 2019 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
+
+func F() func() {
+ return f
+}
+
+func f() {}
--- /dev/null
+// Copyright 2019 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 main
+
+import "a"
+
+func main() {
+ a.F()()
+}
--- /dev/null
+// rundir
+
+// Copyright 2019 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.
+
+// Issue 33739: gccgo undefined symbol with cross-package inlining
+
+package ignored
--- /dev/null
+// Copyright 2019 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 "unsafe"
+
+type HookFunc func(x uint64)
+
+var HookV unsafe.Pointer
+
+func Hook(x uint64) {
+ (*(*HookFunc)(HookV))(x)
+}
--- /dev/null
+// Copyright 2019 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"
+
+func Bfunc() {
+ a.Hook(101)
+}
--- /dev/null
+// compiledir
+
+// Copyright 2019 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.
+
+// Issue 34503: gccgo compiler error importing inlinable function
+
+package ignored
--- /dev/null
+// Copyright 2019 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 A struct {
+ x int
+}
+
+type AI interface {
+ bar()
+}
+
+type AC int
+
+func (ab AC) bar() {
+}
+
+const (
+ ACC = AC(101)
+)
+
+//go:noinline
+func W(a A, k, v interface{}) A {
+ return A{3}
+}
--- /dev/null
+// Copyright 2019 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"
+
+type B struct {
+ s string
+}
+
+func (b B) Func(x a.A) a.A {
+ return a.W(x, k, b)
+}
+
+type ktype int
+
+const k ktype = 0
+
+func Func2() a.AI {
+ return a.ACC
+}
--- /dev/null
+// compiledir
+
+// Copyright 2019 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.
+
+// Issue 34577: gccgo compiler error emitting export data
+
+package ignored
--- /dev/null
+// 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.
+
+package a
+
+type myError string
+
+func (e myError) Error() string { return string(e) }
+
+const myErrorVal myError = "error"
+
+
+func IsMyError(err error) bool {
+ return err == error(myErrorVal)
+}
--- /dev/null
+// 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.
+
+package b
+
+import "./a"
+
+func F(err error) bool {
+ return a.IsMyError(err)
+}
--- /dev/null
+// compiledir
+
+// 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.
+
+// Issue 35739: gccgo inlining error with constant with method.
+
+package ignored
--- /dev/null
+// compile
+
+// 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.
+
+// gccgo mishandled embedded methods of type aliases.
+
+package p
+
+type I int
+
+func (I) M() {}
+
+type T = struct {
+ I
+}
+
+func F() {
+ _ = T.M
+ _ = struct { I }.M
+}
--- /dev/null
+// run
+
+// 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.
+
+// Gccgo mishandles converting an untyped boolean to an interface type.
+
+package main
+
+func t(args ...interface{}) bool {
+ x := true
+ return x == args[0]
+}
+
+func main() {
+ r := t("x" == "x" && "y" == "y")
+ if !r {
+ panic(r)
+ }
+}
--- /dev/null
+// 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.
+
+package a
+
+type I interface {
+ Func()
+}
+
+func Call() {
+ f := I.Func
+ f(nil)
+}
--- /dev/null
+// 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.
+
+package main
+
+import "./a"
+
+func main() {
+ defer func() {
+ if recover() == nil {
+ panic("expected nil pointer dereference")
+ }
+ }()
+ a.Call()
+}
--- /dev/null
+// rundir
+
+// 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.
+
+// gccgo got an undefined symbol reference when inlining a method expression.
+package ignored
--- /dev/null
+// compile
+
+// 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.
+
+package p
+
+const _ = -uint(len(string(1<<32)) - len("\uFFFD"))
--- /dev/null
+// errorcheck
+
+// Copyright 2019 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 p
+
+import "io"
+
+// Alan's initial report.
+
+type I interface { f(); String() string }
+type J interface { g(); String() string }
+
+type IJ1 = interface { I; J }
+type IJ2 = interface { f(); g(); String() string }
+
+var _ = (*IJ1)(nil) == (*IJ2)(nil) // static assert that IJ1 and IJ2 are identical types
+
+// The canonical example.
+
+type ReadWriteCloser interface { io.ReadCloser; io.WriteCloser }
+
+// Some more cases.
+
+type M interface { m() }
+type M32 interface { m() int32 }
+type M64 interface { m() int64 }
+
+type U1 interface { m() }
+type U2 interface { m(); M }
+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"
--- /dev/null
+// compile
+
+// Copyright 2017 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 gotos across non-variable declarations
+// are accepted.
+
+package p
+
+func _() {
+ goto L1
+ const x = 0
+L1:
+ goto L2
+ type T int
+L2:
+}
+
+func _() {
+ {
+ goto L1
+ }
+ const x = 0
+L1:
+ {
+ goto L2
+ }
+ type T int
+L2:
+}
+
+func _(d int) {
+ if d > 0 {
+ goto L1
+ } else {
+ goto L2
+ }
+ const x = 0
+L1:
+ switch d {
+ case 1:
+ goto L3
+ case 2:
+ default:
+ goto L4
+ }
+ type T1 int
+L2:
+ const y = 1
+L3:
+ for d > 0 {
+ if d < 10 {
+ goto L4
+ }
+ }
+ type T2 int
+L4:
+ select {
+ default:
+ goto L5
+ }
+ type T3 int
+L5:
+}