Add files using upload-large-folder tool
Browse filesThis view is limited to 50 files because it contains too many changes.
See raw diff
- platform/dbops/binaries/go/go/test/fixedbugs/bug304.go +18 -0
- platform/dbops/binaries/go/go/test/fixedbugs/bug305.go +24 -0
- platform/dbops/binaries/go/go/test/fixedbugs/bug306.go +7 -0
- platform/dbops/binaries/go/go/test/fixedbugs/bug307.go +15 -0
- platform/dbops/binaries/go/go/test/fixedbugs/bug308.go +19 -0
- platform/dbops/binaries/go/go/test/fixedbugs/bug309.go +21 -0
- platform/dbops/binaries/go/go/test/fixedbugs/bug311.go +20 -0
- platform/dbops/binaries/go/go/test/fixedbugs/bug312.go +22 -0
- platform/dbops/binaries/go/go/test/fixedbugs/bug313.go +19 -0
- platform/dbops/binaries/go/go/test/fixedbugs/bug314.go +31 -0
- platform/dbops/binaries/go/go/test/fixedbugs/bug315.go +18 -0
- platform/dbops/binaries/go/go/test/fixedbugs/bug316.go +17 -0
- platform/dbops/binaries/go/go/test/fixedbugs/bug317.go +16 -0
- platform/dbops/binaries/go/go/test/fixedbugs/bug318.go +12 -0
- platform/dbops/binaries/go/go/test/fixedbugs/bug319.go +22 -0
- platform/dbops/binaries/go/go/test/fixedbugs/bug320.go +45 -0
- platform/dbops/binaries/go/go/test/fixedbugs/bug321.go +30 -0
- platform/dbops/binaries/go/go/test/fixedbugs/bug322.go +8 -0
- platform/dbops/binaries/go/go/test/fixedbugs/bug323.go +20 -0
- platform/dbops/binaries/go/go/test/fixedbugs/bug324.go +10 -0
- platform/dbops/binaries/go/go/test/fixedbugs/bug325.go +15 -0
- platform/dbops/binaries/go/go/test/fixedbugs/bug326.go +39 -0
- platform/dbops/binaries/go/go/test/fixedbugs/bug327.go +24 -0
- platform/dbops/binaries/go/go/test/fixedbugs/bug328.go +14 -0
- platform/dbops/binaries/go/go/test/fixedbugs/bug328.out +1 -0
- platform/dbops/binaries/go/go/test/fixedbugs/bug329.go +46 -0
- platform/dbops/binaries/go/go/test/fixedbugs/bug330.go +13 -0
- platform/dbops/binaries/go/go/test/fixedbugs/bug331.go +36 -0
- platform/dbops/binaries/go/go/test/fixedbugs/bug332.go +17 -0
- platform/dbops/binaries/go/go/test/fixedbugs/bug333.go +19 -0
- platform/dbops/binaries/go/go/test/fixedbugs/bug334.go +31 -0
- platform/dbops/binaries/go/go/test/fixedbugs/bug335.go +9 -0
- platform/dbops/binaries/go/go/test/fixedbugs/bug336.go +86 -0
- platform/dbops/binaries/go/go/test/fixedbugs/bug337.go +19 -0
- platform/dbops/binaries/go/go/test/fixedbugs/bug338.go +22 -0
- platform/dbops/binaries/go/go/test/fixedbugs/bug339.go +20 -0
- platform/dbops/binaries/go/go/test/fixedbugs/bug340.go +18 -0
- platform/dbops/binaries/go/go/test/fixedbugs/bug341.go +22 -0
- platform/dbops/binaries/go/go/test/fixedbugs/bug342.go +20 -0
- platform/dbops/binaries/go/go/test/fixedbugs/bug343.go +33 -0
- platform/dbops/binaries/go/go/test/fixedbugs/bug344.go +24 -0
- platform/dbops/binaries/go/go/test/fixedbugs/bug345.go +7 -0
- platform/dbops/binaries/go/go/test/fixedbugs/bug346.go +36 -0
- platform/dbops/binaries/go/go/test/fixedbugs/bug347.go +49 -0
- platform/dbops/binaries/go/go/test/fixedbugs/bug348.go +46 -0
- platform/dbops/binaries/go/go/test/fixedbugs/bug349.go +13 -0
- platform/dbops/binaries/go/go/test/fixedbugs/bug350.go +15 -0
- platform/dbops/binaries/go/go/test/fixedbugs/bug351.go +13 -0
- platform/dbops/binaries/go/go/test/fixedbugs/bug352.go +19 -0
- platform/dbops/binaries/go/go/test/fixedbugs/bug353.go +30 -0
platform/dbops/binaries/go/go/test/fixedbugs/bug304.go
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
// compile
|
| 2 |
+
|
| 3 |
+
// Copyright 2010 The Go Authors. All rights reserved.
|
| 4 |
+
// Use of this source code is governed by a BSD-style
|
| 5 |
+
// license that can be found in the LICENSE file.
|
| 6 |
+
|
| 7 |
+
// Caused a gccgo crash on compilation.
|
| 8 |
+
// bug304.go: In function ‘p.f’:
|
| 9 |
+
// bug304.go:15:2: internal compiler error: in copy_tree_r, at tree-inline.c:4114
|
| 10 |
+
|
| 11 |
+
package p
|
| 12 |
+
type S struct {
|
| 13 |
+
v interface{}
|
| 14 |
+
}
|
| 15 |
+
func g(e interface{}) { }
|
| 16 |
+
func f(s S) {
|
| 17 |
+
g(s.v.(*int))
|
| 18 |
+
}
|
platform/dbops/binaries/go/go/test/fixedbugs/bug305.go
ADDED
|
@@ -0,0 +1,24 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
// errorcheck
|
| 2 |
+
|
| 3 |
+
// Copyright 2010 The Go Authors. All rights reserved.
|
| 4 |
+
// Use of this source code is governed by a BSD-style
|
| 5 |
+
// license that can be found in the LICENSE file.
|
| 6 |
+
|
| 7 |
+
// Use //line to set the line number of the next line to 20.
|
| 8 |
+
//line fixedbugs/bug305.go:20
|
| 9 |
+
|
| 10 |
+
package p
|
| 11 |
+
|
| 12 |
+
// Introduce an error which should be reported on line 24.
|
| 13 |
+
var a int = "bogus"
|
| 14 |
+
|
| 15 |
+
// Line 15 of file.
|
| 16 |
+
// 16
|
| 17 |
+
// 17
|
| 18 |
+
// 18
|
| 19 |
+
// 19
|
| 20 |
+
// 20
|
| 21 |
+
// 21
|
| 22 |
+
// 22
|
| 23 |
+
// 23
|
| 24 |
+
// ERROR "cannot|incompatible"
|
platform/dbops/binaries/go/go/test/fixedbugs/bug306.go
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
// compiledir
|
| 2 |
+
|
| 3 |
+
// Copyright 2010 The Go Authors. All rights reserved.
|
| 4 |
+
// Use of this source code is governed by a BSD-style
|
| 5 |
+
// license that can be found in the LICENSE file.
|
| 6 |
+
|
| 7 |
+
ignored
|
platform/dbops/binaries/go/go/test/fixedbugs/bug307.go
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
// compile
|
| 2 |
+
|
| 3 |
+
// Copyright 2010 The Go Authors. All rights reserved.
|
| 4 |
+
// Use of this source code is governed by a BSD-style
|
| 5 |
+
// license that can be found in the LICENSE file.
|
| 6 |
+
|
| 7 |
+
// Valid program, gccgo reported an error.
|
| 8 |
+
// bug307.go:14:6: error: complex arguments must have identical types
|
| 9 |
+
|
| 10 |
+
package main
|
| 11 |
+
|
| 12 |
+
func main() {
|
| 13 |
+
var f float64
|
| 14 |
+
_ = complex(1/f, 0)
|
| 15 |
+
}
|
platform/dbops/binaries/go/go/test/fixedbugs/bug308.go
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
// compile
|
| 2 |
+
|
| 3 |
+
// Copyright 2010 The Go Authors. All rights reserved.
|
| 4 |
+
// Use of this source code is governed by a BSD-style
|
| 5 |
+
// license that can be found in the LICENSE file.
|
| 6 |
+
|
| 7 |
+
// issue 1136
|
| 8 |
+
|
| 9 |
+
package main
|
| 10 |
+
|
| 11 |
+
import "fmt"
|
| 12 |
+
|
| 13 |
+
func log1(f string, argv ...interface{}) {
|
| 14 |
+
fmt.Printf("log: %s\n", fmt.Sprintf(f, argv...))
|
| 15 |
+
}
|
| 16 |
+
|
| 17 |
+
func main() {
|
| 18 |
+
log1("%d", 42)
|
| 19 |
+
}
|
platform/dbops/binaries/go/go/test/fixedbugs/bug309.go
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
// compile
|
| 2 |
+
|
| 3 |
+
// Copyright 2010 The Go Authors. All rights reserved.
|
| 4 |
+
// Use of this source code is governed by a BSD-style
|
| 5 |
+
// license that can be found in the LICENSE file.
|
| 6 |
+
|
| 7 |
+
// issue 1016
|
| 8 |
+
|
| 9 |
+
package bug309
|
| 10 |
+
|
| 11 |
+
func foo(t interface{}, c chan int) {
|
| 12 |
+
switch v := t.(type) {
|
| 13 |
+
case int:
|
| 14 |
+
select {
|
| 15 |
+
case <-c:
|
| 16 |
+
// bug was: internal compiler error: var without type, init: v
|
| 17 |
+
}
|
| 18 |
+
default:
|
| 19 |
+
_ = v
|
| 20 |
+
}
|
| 21 |
+
}
|
platform/dbops/binaries/go/go/test/fixedbugs/bug311.go
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
// run
|
| 2 |
+
|
| 3 |
+
// Copyright 2010 The Go Authors. All rights reserved.
|
| 4 |
+
// Use of this source code is governed by a BSD-style
|
| 5 |
+
// license that can be found in the LICENSE file.
|
| 6 |
+
|
| 7 |
+
package main
|
| 8 |
+
|
| 9 |
+
func main() {
|
| 10 |
+
m := make(map[string][1000]byte)
|
| 11 |
+
m["hi"] = [1000]byte{1}
|
| 12 |
+
|
| 13 |
+
v := m["hi"]
|
| 14 |
+
|
| 15 |
+
for k, vv := range m {
|
| 16 |
+
if k != "hi" || string(v[:]) != string(vv[:]) {
|
| 17 |
+
panic("bad iter")
|
| 18 |
+
}
|
| 19 |
+
}
|
| 20 |
+
}
|
platform/dbops/binaries/go/go/test/fixedbugs/bug312.go
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
// run
|
| 2 |
+
|
| 3 |
+
// Copyright 2010 The Go Authors. All rights reserved.
|
| 4 |
+
// Use of this source code is governed by a BSD-style
|
| 5 |
+
// license that can be found in the LICENSE file.
|
| 6 |
+
|
| 7 |
+
// issue 1172
|
| 8 |
+
|
| 9 |
+
package main
|
| 10 |
+
|
| 11 |
+
func main() {
|
| 12 |
+
var i interface{}
|
| 13 |
+
c := make(chan int, 1)
|
| 14 |
+
c <- 1
|
| 15 |
+
select {
|
| 16 |
+
case i = <-c: // error on this line
|
| 17 |
+
}
|
| 18 |
+
if i != 1 {
|
| 19 |
+
println("bad i", i)
|
| 20 |
+
panic("BUG")
|
| 21 |
+
}
|
| 22 |
+
}
|
platform/dbops/binaries/go/go/test/fixedbugs/bug313.go
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
// errorcheckdir
|
| 2 |
+
|
| 3 |
+
// Copyright 2010 The Go Authors. All rights reserved.
|
| 4 |
+
// Use of this source code is governed by a BSD-style
|
| 5 |
+
// license that can be found in the LICENSE file.
|
| 6 |
+
|
| 7 |
+
// Issue 1284
|
| 8 |
+
|
| 9 |
+
package bug313
|
| 10 |
+
|
| 11 |
+
/*
|
| 12 |
+
6g bug313.dir/[ab].go
|
| 13 |
+
|
| 14 |
+
Before:
|
| 15 |
+
bug313.dir/b.go:7: internal compiler error: fault
|
| 16 |
+
|
| 17 |
+
Now:
|
| 18 |
+
bug313.dir/a.go:10: undefined: fmt.DoesNotExist
|
| 19 |
+
*/
|
platform/dbops/binaries/go/go/test/fixedbugs/bug314.go
ADDED
|
@@ -0,0 +1,31 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
// run
|
| 2 |
+
|
| 3 |
+
// Copyright 2010 The Go Authors. All rights reserved.
|
| 4 |
+
// Use of this source code is governed by a BSD-style
|
| 5 |
+
// license that can be found in the LICENSE file.
|
| 6 |
+
|
| 7 |
+
// Used to call wrong methods; issue 1290.
|
| 8 |
+
|
| 9 |
+
package main
|
| 10 |
+
|
| 11 |
+
type S struct {
|
| 12 |
+
}
|
| 13 |
+
func (S) a() int{
|
| 14 |
+
return 0
|
| 15 |
+
}
|
| 16 |
+
func (S) b() int{
|
| 17 |
+
return 1
|
| 18 |
+
}
|
| 19 |
+
|
| 20 |
+
func main() {
|
| 21 |
+
var i interface {
|
| 22 |
+
b() int
|
| 23 |
+
a() int
|
| 24 |
+
} = S{}
|
| 25 |
+
if i.a() != 0 {
|
| 26 |
+
panic("wrong method called")
|
| 27 |
+
}
|
| 28 |
+
if i.b() != 1 {
|
| 29 |
+
panic("wrong method called")
|
| 30 |
+
}
|
| 31 |
+
}
|
platform/dbops/binaries/go/go/test/fixedbugs/bug315.go
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
// compile
|
| 2 |
+
|
| 3 |
+
// Copyright 2010 The Go Authors. All rights reserved.
|
| 4 |
+
// Use of this source code is governed by a BSD-style
|
| 5 |
+
// license that can be found in the LICENSE file.
|
| 6 |
+
|
| 7 |
+
// Issue 1368.
|
| 8 |
+
|
| 9 |
+
package main
|
| 10 |
+
|
| 11 |
+
func main() {
|
| 12 |
+
a := complex(2, 2)
|
| 13 |
+
a /= 2
|
| 14 |
+
}
|
| 15 |
+
|
| 16 |
+
/*
|
| 17 |
+
bug315.go:13: internal compiler error: optoas: no entry DIV-complex
|
| 18 |
+
*/
|
platform/dbops/binaries/go/go/test/fixedbugs/bug316.go
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
// compile
|
| 2 |
+
|
| 3 |
+
// Copyright 2010 The Go Authors. All rights reserved.
|
| 4 |
+
// Use of this source code is governed by a BSD-style
|
| 5 |
+
// license that can be found in the LICENSE file.
|
| 6 |
+
|
| 7 |
+
// Issue 1369.
|
| 8 |
+
|
| 9 |
+
package main
|
| 10 |
+
|
| 11 |
+
const (
|
| 12 |
+
c = complex(1, 2)
|
| 13 |
+
r = real(c) // was: const initializer must be constant
|
| 14 |
+
i = imag(c) // was: const initializer must be constant
|
| 15 |
+
)
|
| 16 |
+
|
| 17 |
+
func main() {}
|
platform/dbops/binaries/go/go/test/fixedbugs/bug317.go
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
// run
|
| 2 |
+
|
| 3 |
+
// Copyright 2011 The Go Authors. All rights reserved.
|
| 4 |
+
// Use of this source code is governed by a BSD-style
|
| 5 |
+
// license that can be found in the LICENSE file.
|
| 6 |
+
|
| 7 |
+
package main
|
| 8 |
+
|
| 9 |
+
func main() {
|
| 10 |
+
x := []uint{0}
|
| 11 |
+
x[0] &^= f()
|
| 12 |
+
}
|
| 13 |
+
|
| 14 |
+
func f() uint {
|
| 15 |
+
return 1<<31 // doesn't panic with 1<<31 - 1
|
| 16 |
+
}
|
platform/dbops/binaries/go/go/test/fixedbugs/bug318.go
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
// errorcheck
|
| 2 |
+
|
| 3 |
+
// Copyright 2011 The Go Authors. All rights reserved.
|
| 4 |
+
// Use of this source code is governed by a BSD-style
|
| 5 |
+
// license that can be found in the LICENSE file.
|
| 6 |
+
|
| 7 |
+
// Issue 1411.
|
| 8 |
+
|
| 9 |
+
package main
|
| 10 |
+
|
| 11 |
+
const ui uint = 0
|
| 12 |
+
const i int = ui // ERROR "type"
|
platform/dbops/binaries/go/go/test/fixedbugs/bug319.go
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
// compile
|
| 2 |
+
|
| 3 |
+
// Copyright 2011 The Go Authors. All rights reserved.
|
| 4 |
+
// Use of this source code is governed by a BSD-style
|
| 5 |
+
// license that can be found in the LICENSE file.
|
| 6 |
+
|
| 7 |
+
package main
|
| 8 |
+
|
| 9 |
+
import "unsafe"
|
| 10 |
+
|
| 11 |
+
func main() {
|
| 12 |
+
var x int
|
| 13 |
+
|
| 14 |
+
a := uint64(uintptr(unsafe.Pointer(&x)))
|
| 15 |
+
b := uint32(uintptr(unsafe.Pointer(&x)))
|
| 16 |
+
c := uint16(uintptr(unsafe.Pointer(&x)))
|
| 17 |
+
d := int64(uintptr(unsafe.Pointer(&x)))
|
| 18 |
+
e := int32(uintptr(unsafe.Pointer(&x)))
|
| 19 |
+
f := int16(uintptr(unsafe.Pointer(&x)))
|
| 20 |
+
|
| 21 |
+
_, _, _, _, _, _ = a, b, c, d, e, f
|
| 22 |
+
}
|
platform/dbops/binaries/go/go/test/fixedbugs/bug320.go
ADDED
|
@@ -0,0 +1,45 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
// run
|
| 2 |
+
|
| 3 |
+
// Copyright 2011 The Go Authors. All rights reserved.
|
| 4 |
+
// Use of this source code is governed by a BSD-style
|
| 5 |
+
// license that can be found in the LICENSE file.
|
| 6 |
+
|
| 7 |
+
package main
|
| 8 |
+
|
| 9 |
+
func main() {
|
| 10 |
+
c := make(chan int, 1)
|
| 11 |
+
dummy := make(chan int)
|
| 12 |
+
v := 0x12345678
|
| 13 |
+
for i := 0; i < 10; i++ {
|
| 14 |
+
// 6g had a bug that caused select to pass &t to
|
| 15 |
+
// selectrecv before allocating the memory for t,
|
| 16 |
+
// which caused non-deterministic crashes.
|
| 17 |
+
// This test looks for the bug by checking that the
|
| 18 |
+
// value received actually ends up in t.
|
| 19 |
+
// If the allocation happens after storing through
|
| 20 |
+
// whatever garbage &t holds, the later reference
|
| 21 |
+
// to t in the case body will use the new pointer and
|
| 22 |
+
// not see the received value.
|
| 23 |
+
v += 0x1020304
|
| 24 |
+
c <- v
|
| 25 |
+
select {
|
| 26 |
+
case t := <-c:
|
| 27 |
+
go func() {
|
| 28 |
+
f(t)
|
| 29 |
+
}()
|
| 30 |
+
escape(&t)
|
| 31 |
+
if t != v {
|
| 32 |
+
println(i, v, t)
|
| 33 |
+
panic("wrong values")
|
| 34 |
+
}
|
| 35 |
+
case dummy <- 1:
|
| 36 |
+
}
|
| 37 |
+
}
|
| 38 |
+
}
|
| 39 |
+
|
| 40 |
+
func escape(*int) {
|
| 41 |
+
}
|
| 42 |
+
|
| 43 |
+
func f(int) {
|
| 44 |
+
}
|
| 45 |
+
|
platform/dbops/binaries/go/go/test/fixedbugs/bug321.go
ADDED
|
@@ -0,0 +1,30 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
// run
|
| 2 |
+
|
| 3 |
+
// Copyright 2011 The Go Authors. All rights reserved.
|
| 4 |
+
// Use of this source code is governed by a BSD-style
|
| 5 |
+
// license that can be found in the LICENSE file.
|
| 6 |
+
|
| 7 |
+
// Troublesome floating point constants. Issue 1463.
|
| 8 |
+
|
| 9 |
+
package main
|
| 10 |
+
|
| 11 |
+
import "fmt"
|
| 12 |
+
|
| 13 |
+
func check(test string, got, want float64) bool {
|
| 14 |
+
if got != want {
|
| 15 |
+
fmt.Println(test, "got", got, "want", want)
|
| 16 |
+
return false
|
| 17 |
+
}
|
| 18 |
+
return true
|
| 19 |
+
}
|
| 20 |
+
|
| 21 |
+
func main() {
|
| 22 |
+
good := true
|
| 23 |
+
// http://www.exploringbinary.com/java-hangs-when-converting-2-2250738585072012e-308/
|
| 24 |
+
good = good && check("2.2250738585072012e-308", 2.2250738585072012e-308, 2.2250738585072014e-308)
|
| 25 |
+
// http://www.exploringbinary.com/php-hangs-on-numeric-value-2-2250738585072011e-308/
|
| 26 |
+
good = good && check("2.2250738585072011e-308", 2.2250738585072011e-308, 2.225073858507201e-308)
|
| 27 |
+
if !good {
|
| 28 |
+
panic("fail")
|
| 29 |
+
}
|
| 30 |
+
}
|
platform/dbops/binaries/go/go/test/fixedbugs/bug322.go
ADDED
|
@@ -0,0 +1,8 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
// rundir
|
| 2 |
+
|
| 3 |
+
// Copyright 2011 The Go Authors. All rights reserved.
|
| 4 |
+
// Use of this source code is governed by a BSD-style
|
| 5 |
+
// license that can be found in the LICENSE file.
|
| 6 |
+
|
| 7 |
+
// Test case for issue 1402.
|
| 8 |
+
package ignored
|
platform/dbops/binaries/go/go/test/fixedbugs/bug323.go
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
// errorcheck
|
| 2 |
+
|
| 3 |
+
// Copyright 2011 The Go Authors. All rights reserved.
|
| 4 |
+
// Use of this source code is governed by a BSD-style
|
| 5 |
+
// license that can be found in the LICENSE file.
|
| 6 |
+
|
| 7 |
+
package main
|
| 8 |
+
|
| 9 |
+
type T struct{}
|
| 10 |
+
type P *T
|
| 11 |
+
|
| 12 |
+
func (t *T) Meth() {}
|
| 13 |
+
func (t T) Meth2() {}
|
| 14 |
+
|
| 15 |
+
func main() {
|
| 16 |
+
t := &T{}
|
| 17 |
+
p := P(t)
|
| 18 |
+
p.Meth() // ERROR "undefined"
|
| 19 |
+
p.Meth2() // ERROR "undefined"
|
| 20 |
+
}
|
platform/dbops/binaries/go/go/test/fixedbugs/bug324.go
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
// rundir
|
| 2 |
+
|
| 3 |
+
// Copyright 2011 The Go Authors. All rights reserved.
|
| 4 |
+
// Use of this source code is governed by a BSD-style
|
| 5 |
+
// license that can be found in the LICENSE file.
|
| 6 |
+
|
| 7 |
+
// Test case for issue 1550: a type cannot implement an interface
|
| 8 |
+
// from another package with a private method, and type assertions
|
| 9 |
+
// should fail.
|
| 10 |
+
package ignored
|
platform/dbops/binaries/go/go/test/fixedbugs/bug325.go
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
// errorcheck
|
| 2 |
+
|
| 3 |
+
// Copyright 2011 The Go Authors. All rights reserved.
|
| 4 |
+
// Use of this source code is governed by a BSD-style
|
| 5 |
+
// license that can be found in the LICENSE file.
|
| 6 |
+
|
| 7 |
+
package main
|
| 8 |
+
|
| 9 |
+
import "unsafe"
|
| 10 |
+
|
| 11 |
+
func main() {
|
| 12 |
+
var x unsafe.Pointer
|
| 13 |
+
println(*x) // ERROR "invalid indirect.*unsafe.Pointer|cannot indirect"
|
| 14 |
+
var _ = (unsafe.Pointer)(nil).foo // ERROR "foo"
|
| 15 |
+
}
|
platform/dbops/binaries/go/go/test/fixedbugs/bug326.go
ADDED
|
@@ -0,0 +1,39 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
// errorcheck
|
| 2 |
+
|
| 3 |
+
// Copyright 2011 The Go Authors. All rights reserved.
|
| 4 |
+
// Use of this source code is governed by a BSD-style
|
| 5 |
+
// license that can be found in the LICENSE file.
|
| 6 |
+
|
| 7 |
+
package p
|
| 8 |
+
|
| 9 |
+
func f() (_ int, err error) {
|
| 10 |
+
return
|
| 11 |
+
}
|
| 12 |
+
|
| 13 |
+
func g() (x int, _ error) {
|
| 14 |
+
return
|
| 15 |
+
}
|
| 16 |
+
|
| 17 |
+
func h() (_ int, _ error) {
|
| 18 |
+
return
|
| 19 |
+
}
|
| 20 |
+
|
| 21 |
+
func i() (int, error) {
|
| 22 |
+
return // ERROR "not enough return values|not enough arguments to return"
|
| 23 |
+
}
|
| 24 |
+
|
| 25 |
+
func f1() (_ int, err error) {
|
| 26 |
+
return 1, nil
|
| 27 |
+
}
|
| 28 |
+
|
| 29 |
+
func g1() (x int, _ error) {
|
| 30 |
+
return 1, nil
|
| 31 |
+
}
|
| 32 |
+
|
| 33 |
+
func h1() (_ int, _ error) {
|
| 34 |
+
return 1, nil
|
| 35 |
+
}
|
| 36 |
+
|
| 37 |
+
func ii() (int, error) {
|
| 38 |
+
return 1, nil
|
| 39 |
+
}
|
platform/dbops/binaries/go/go/test/fixedbugs/bug327.go
ADDED
|
@@ -0,0 +1,24 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
// run
|
| 2 |
+
|
| 3 |
+
// Copyright 2011 The Go Authors. All rights reserved.
|
| 4 |
+
// Use of this source code is governed by a BSD-style
|
| 5 |
+
// license that can be found in the LICENSE file.
|
| 6 |
+
|
| 7 |
+
// Conversion between identical interfaces.
|
| 8 |
+
// Issue 1647.
|
| 9 |
+
|
| 10 |
+
// The compiler used to not realize this was a no-op,
|
| 11 |
+
// so it generated a call to the non-existent function runtime.convE2E.
|
| 12 |
+
|
| 13 |
+
package main
|
| 14 |
+
|
| 15 |
+
type (
|
| 16 |
+
a interface{}
|
| 17 |
+
b interface{}
|
| 18 |
+
)
|
| 19 |
+
|
| 20 |
+
func main() {
|
| 21 |
+
x := a(1)
|
| 22 |
+
z := b(x)
|
| 23 |
+
_ = z
|
| 24 |
+
}
|
platform/dbops/binaries/go/go/test/fixedbugs/bug328.go
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
// run
|
| 2 |
+
|
| 3 |
+
// Copyright 2011 The Go Authors. All rights reserved.
|
| 4 |
+
// Use of this source code is governed by a BSD-style
|
| 5 |
+
// license that can be found in the LICENSE file.
|
| 6 |
+
|
| 7 |
+
package main
|
| 8 |
+
|
| 9 |
+
import "unsafe"
|
| 10 |
+
|
| 11 |
+
func main() {
|
| 12 |
+
var p unsafe.Pointer
|
| 13 |
+
println(p)
|
| 14 |
+
}
|
platform/dbops/binaries/go/go/test/fixedbugs/bug328.out
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
0x0
|
platform/dbops/binaries/go/go/test/fixedbugs/bug329.go
ADDED
|
@@ -0,0 +1,46 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
// run
|
| 2 |
+
|
| 3 |
+
// Copyright 2011 The Go Authors. All rights reserved.
|
| 4 |
+
// Use of this source code is governed by a BSD-style
|
| 5 |
+
// license that can be found in the LICENSE file.
|
| 6 |
+
|
| 7 |
+
package main
|
| 8 |
+
|
| 9 |
+
type Value struct {
|
| 10 |
+
X interface{}
|
| 11 |
+
Y int
|
| 12 |
+
}
|
| 13 |
+
|
| 14 |
+
type Struct struct {
|
| 15 |
+
X complex128
|
| 16 |
+
}
|
| 17 |
+
|
| 18 |
+
const magic = 1 + 2i
|
| 19 |
+
|
| 20 |
+
func (Value) Complex(x complex128) {
|
| 21 |
+
if x != magic {
|
| 22 |
+
println(x)
|
| 23 |
+
panic("bad complex magic")
|
| 24 |
+
}
|
| 25 |
+
}
|
| 26 |
+
|
| 27 |
+
func f(x *byte, y, z int) complex128 {
|
| 28 |
+
return magic
|
| 29 |
+
}
|
| 30 |
+
|
| 31 |
+
func (Value) Struct(x Struct) {
|
| 32 |
+
if x.X != magic {
|
| 33 |
+
println(x.X)
|
| 34 |
+
panic("bad struct magic")
|
| 35 |
+
}
|
| 36 |
+
}
|
| 37 |
+
|
| 38 |
+
func f1(x *byte, y, z int) Struct {
|
| 39 |
+
return Struct{magic}
|
| 40 |
+
}
|
| 41 |
+
|
| 42 |
+
func main() {
|
| 43 |
+
var v Value
|
| 44 |
+
v.Struct(f1(nil, 0, 0)) // ok
|
| 45 |
+
v.Complex(f(nil, 0, 0)) // used to fail
|
| 46 |
+
}
|
platform/dbops/binaries/go/go/test/fixedbugs/bug330.go
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
// errorcheck
|
| 2 |
+
|
| 3 |
+
// Copyright 2011 The Go Authors. All rights reserved.
|
| 4 |
+
// Use of this source code is governed by a BSD-style
|
| 5 |
+
// license that can be found in the LICENSE file.
|
| 6 |
+
|
| 7 |
+
package main
|
| 8 |
+
|
| 9 |
+
func main() {
|
| 10 |
+
x := ""
|
| 11 |
+
x = +"hello" // ERROR "invalid operation.*string|expected numeric"
|
| 12 |
+
x = +x // ERROR "invalid operation.*string|expected numeric"
|
| 13 |
+
}
|
platform/dbops/binaries/go/go/test/fixedbugs/bug331.go
ADDED
|
@@ -0,0 +1,36 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
// run
|
| 2 |
+
|
| 3 |
+
// Copyright 2011 The Go Authors. All rights reserved.
|
| 4 |
+
// Use of this source code is governed by a BSD-style
|
| 5 |
+
// license that can be found in the LICENSE file.
|
| 6 |
+
|
| 7 |
+
package main
|
| 8 |
+
|
| 9 |
+
import "io"
|
| 10 |
+
|
| 11 |
+
func f() (_ string, x float64, err error) {
|
| 12 |
+
return
|
| 13 |
+
}
|
| 14 |
+
|
| 15 |
+
func g() (_ string, x float64, err error) {
|
| 16 |
+
return "hello", 3.14, io.EOF
|
| 17 |
+
}
|
| 18 |
+
|
| 19 |
+
var _ func() (string, float64, error) = f
|
| 20 |
+
var _ func() (string, float64, error) = g
|
| 21 |
+
|
| 22 |
+
func main() {
|
| 23 |
+
x, y, z := g()
|
| 24 |
+
if x != "hello" || y != 3.14 || z != io.EOF {
|
| 25 |
+
println("wrong", x, len(x), y, z)
|
| 26 |
+
}
|
| 27 |
+
}
|
| 28 |
+
|
| 29 |
+
/*
|
| 30 |
+
issue 1712
|
| 31 |
+
|
| 32 |
+
bug331.go:12: cannot use "hello" (type string) as type float64 in assignment
|
| 33 |
+
bug331.go:12: cannot use 0 (type float64) as type os.Error in assignment:
|
| 34 |
+
float64 does not implement os.Error (missing String method)
|
| 35 |
+
bug331.go:12: error in shape across RETURN
|
| 36 |
+
*/
|
platform/dbops/binaries/go/go/test/fixedbugs/bug332.go
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
// errorcheck
|
| 2 |
+
|
| 3 |
+
// Copyright 2011 The Go Authors. All rights reserved.
|
| 4 |
+
// Use of this source code is governed by a BSD-style
|
| 5 |
+
// license that can be found in the LICENSE file.
|
| 6 |
+
|
| 7 |
+
package main
|
| 8 |
+
|
| 9 |
+
// type T int
|
| 10 |
+
|
| 11 |
+
func main() {}
|
| 12 |
+
|
| 13 |
+
// issue 1474
|
| 14 |
+
|
| 15 |
+
// important: no newline on end of next line.
|
| 16 |
+
// 6g used to print <epoch> instead of bug332.go:111
|
| 17 |
+
func (t *T) F() {} // ERROR "undefined.*T"
|
platform/dbops/binaries/go/go/test/fixedbugs/bug333.go
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
// run
|
| 2 |
+
|
| 3 |
+
// Copyright 2011 The Go Authors. All rights reserved.
|
| 4 |
+
// Use of this source code is governed by a BSD-style
|
| 5 |
+
// license that can be found in the LICENSE file.
|
| 6 |
+
|
| 7 |
+
// Issue 1709
|
| 8 |
+
|
| 9 |
+
package main
|
| 10 |
+
|
| 11 |
+
func main() {
|
| 12 |
+
type Ts string
|
| 13 |
+
var ts Ts
|
| 14 |
+
_ = []byte(ts)
|
| 15 |
+
}
|
| 16 |
+
|
| 17 |
+
/*
|
| 18 |
+
bug333.go:14: cannot use ts (type Ts) as type string in function argument
|
| 19 |
+
*/
|
platform/dbops/binaries/go/go/test/fixedbugs/bug334.go
ADDED
|
@@ -0,0 +1,31 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
// compile
|
| 2 |
+
|
| 3 |
+
// Copyright 2011 The Go Authors. All rights reserved.
|
| 4 |
+
// Use of this source code is governed by a BSD-style
|
| 5 |
+
// license that can be found in the LICENSE file.
|
| 6 |
+
|
| 7 |
+
// Issue 1716
|
| 8 |
+
|
| 9 |
+
package main
|
| 10 |
+
|
| 11 |
+
type (
|
| 12 |
+
cplx64 complex64
|
| 13 |
+
cplx128 complex128
|
| 14 |
+
)
|
| 15 |
+
|
| 16 |
+
func (c cplx64) Foo() {}
|
| 17 |
+
func (c cplx128) Foo() {}
|
| 18 |
+
|
| 19 |
+
func main() {
|
| 20 |
+
var c64 cplx128
|
| 21 |
+
var c128 cplx64
|
| 22 |
+
c64.Foo()
|
| 23 |
+
c128.Foo()
|
| 24 |
+
}
|
| 25 |
+
|
| 26 |
+
/*
|
| 27 |
+
bug334.go:16: invalid receiver type cplx64
|
| 28 |
+
bug334.go:17: invalid receiver type cplx128
|
| 29 |
+
bug334.go:22: c64.Foo undefined (type cplx128 has no field or method Foo)
|
| 30 |
+
bug334.go:23: c128.Foo undefined (type cplx64 has no field or method Foo)
|
| 31 |
+
*/
|
platform/dbops/binaries/go/go/test/fixedbugs/bug335.go
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
// compiledir
|
| 2 |
+
|
| 3 |
+
// Copyright 2011 The Go Authors. All rights reserved.
|
| 4 |
+
// Use of this source code is governed by a BSD-style
|
| 5 |
+
// license that can be found in the LICENSE file.
|
| 6 |
+
|
| 7 |
+
// Issue 1705.
|
| 8 |
+
|
| 9 |
+
package ignored
|
platform/dbops/binaries/go/go/test/fixedbugs/bug336.go
ADDED
|
@@ -0,0 +1,86 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
// run
|
| 2 |
+
|
| 3 |
+
// Copyright 2011 The Go Authors. All rights reserved.
|
| 4 |
+
// Use of this source code is governed by a BSD-style
|
| 5 |
+
// license that can be found in the LICENSE file.
|
| 6 |
+
|
| 7 |
+
package main
|
| 8 |
+
|
| 9 |
+
type T1 struct {
|
| 10 |
+
Next *T2
|
| 11 |
+
}
|
| 12 |
+
|
| 13 |
+
type T2 T1
|
| 14 |
+
|
| 15 |
+
type T3 struct {
|
| 16 |
+
Next *T4
|
| 17 |
+
}
|
| 18 |
+
|
| 19 |
+
type T4 T5
|
| 20 |
+
type T5 T6
|
| 21 |
+
type T6 T7
|
| 22 |
+
type T7 T8
|
| 23 |
+
type T8 T9
|
| 24 |
+
type T9 T3
|
| 25 |
+
|
| 26 |
+
type T10 struct {
|
| 27 |
+
x struct {
|
| 28 |
+
y ***struct {
|
| 29 |
+
z *struct {
|
| 30 |
+
Next *T11
|
| 31 |
+
}
|
| 32 |
+
}
|
| 33 |
+
}
|
| 34 |
+
}
|
| 35 |
+
|
| 36 |
+
type T11 T10
|
| 37 |
+
|
| 38 |
+
type T12 struct {
|
| 39 |
+
F1 *T15
|
| 40 |
+
F2 *T13
|
| 41 |
+
F3 *T16
|
| 42 |
+
}
|
| 43 |
+
|
| 44 |
+
type T13 T14
|
| 45 |
+
type T14 T15
|
| 46 |
+
type T15 T16
|
| 47 |
+
type T16 T17
|
| 48 |
+
type T17 T12
|
| 49 |
+
|
| 50 |
+
// issue 1672
|
| 51 |
+
type T18 *[10]T19
|
| 52 |
+
type T19 T18
|
| 53 |
+
|
| 54 |
+
func main() {
|
| 55 |
+
_ = &T1{&T2{}}
|
| 56 |
+
_ = &T2{&T2{}}
|
| 57 |
+
_ = &T3{&T4{}}
|
| 58 |
+
_ = &T4{&T4{}}
|
| 59 |
+
_ = &T5{&T4{}}
|
| 60 |
+
_ = &T6{&T4{}}
|
| 61 |
+
_ = &T7{&T4{}}
|
| 62 |
+
_ = &T8{&T4{}}
|
| 63 |
+
_ = &T9{&T4{}}
|
| 64 |
+
_ = &T12{&T15{}, &T13{}, &T16{}}
|
| 65 |
+
|
| 66 |
+
var (
|
| 67 |
+
tn struct{ Next *T11 }
|
| 68 |
+
tz struct{ z *struct{ Next *T11 } }
|
| 69 |
+
tpz *struct{ z *struct{ Next *T11 } }
|
| 70 |
+
tppz **struct{ z *struct{ Next *T11 } }
|
| 71 |
+
tpppz ***struct{ z *struct{ Next *T11 } }
|
| 72 |
+
ty struct {
|
| 73 |
+
y ***struct{ z *struct{ Next *T11 } }
|
| 74 |
+
}
|
| 75 |
+
)
|
| 76 |
+
tn.Next = &T11{}
|
| 77 |
+
tz.z = &tn
|
| 78 |
+
tpz = &tz
|
| 79 |
+
tppz = &tpz
|
| 80 |
+
tpppz = &tppz
|
| 81 |
+
ty.y = tpppz
|
| 82 |
+
_ = &T10{ty}
|
| 83 |
+
|
| 84 |
+
t19s := &[10]T19{}
|
| 85 |
+
_ = T18(t19s)
|
| 86 |
+
}
|
platform/dbops/binaries/go/go/test/fixedbugs/bug337.go
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
// errorcheck
|
| 2 |
+
|
| 3 |
+
// Copyright 2011 The Go Authors. All rights reserved.
|
| 4 |
+
// Use of this source code is governed by a BSD-style
|
| 5 |
+
// license that can be found in the LICENSE file.
|
| 6 |
+
|
| 7 |
+
// Issue 1722.
|
| 8 |
+
|
| 9 |
+
// Check that the error messages says
|
| 10 |
+
// bug337.go:16: len("foo") not used
|
| 11 |
+
// and not
|
| 12 |
+
// bug337.go:16: 3 not used
|
| 13 |
+
|
| 14 |
+
package main
|
| 15 |
+
|
| 16 |
+
func main() {
|
| 17 |
+
len("foo") // ERROR "len|value computed is not used"
|
| 18 |
+
}
|
| 19 |
+
|
platform/dbops/binaries/go/go/test/fixedbugs/bug338.go
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
// compile
|
| 2 |
+
|
| 3 |
+
// Copyright 2011 The Go Authors. All rights reserved.
|
| 4 |
+
// Use of this source code is governed by a BSD-style
|
| 5 |
+
// license that can be found in the LICENSE file.
|
| 6 |
+
|
| 7 |
+
// Issue 1787.
|
| 8 |
+
|
| 9 |
+
package main
|
| 10 |
+
|
| 11 |
+
import "unsafe"
|
| 12 |
+
|
| 13 |
+
const x = unsafe.Sizeof([8]byte{})
|
| 14 |
+
|
| 15 |
+
func main() {
|
| 16 |
+
var b [x]int
|
| 17 |
+
_ = b
|
| 18 |
+
}
|
| 19 |
+
|
| 20 |
+
/*
|
| 21 |
+
bug338.go:14: array bound must be non-negative
|
| 22 |
+
*/
|
platform/dbops/binaries/go/go/test/fixedbugs/bug339.go
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
// run
|
| 2 |
+
|
| 3 |
+
// Copyright 2011 The Go Authors. All rights reserved.
|
| 4 |
+
// Use of this source code is governed by a BSD-style
|
| 5 |
+
// license that can be found in the LICENSE file.
|
| 6 |
+
|
| 7 |
+
// Issue 1608.
|
| 8 |
+
// Size used to be -1000000000.
|
| 9 |
+
|
| 10 |
+
package main
|
| 11 |
+
|
| 12 |
+
import "unsafe"
|
| 13 |
+
|
| 14 |
+
func main() {
|
| 15 |
+
var a interface{} = 0
|
| 16 |
+
size := unsafe.Sizeof(a)
|
| 17 |
+
if size != 2*unsafe.Sizeof((*int)(nil)) {
|
| 18 |
+
println("wrong size: ", size)
|
| 19 |
+
}
|
| 20 |
+
}
|
platform/dbops/binaries/go/go/test/fixedbugs/bug340.go
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
// errorcheck
|
| 2 |
+
|
| 3 |
+
// Copyright 2011 The Go Authors. All rights reserved.
|
| 4 |
+
// Use of this source code is governed by a BSD-style
|
| 5 |
+
// license that can be found in the LICENSE file.
|
| 6 |
+
|
| 7 |
+
// Issue 1606.
|
| 8 |
+
|
| 9 |
+
package main
|
| 10 |
+
|
| 11 |
+
func main() {
|
| 12 |
+
var x interface{}
|
| 13 |
+
switch t := x.(type) {
|
| 14 |
+
case 0: // ERROR "type"
|
| 15 |
+
t.x = 1
|
| 16 |
+
x.x = 1 // ERROR "type interface \{\}|reference to undefined field or method|interface with no methods|undefined"
|
| 17 |
+
}
|
| 18 |
+
}
|
platform/dbops/binaries/go/go/test/fixedbugs/bug341.go
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
// run
|
| 2 |
+
|
| 3 |
+
// Copyright 2011 The Go Authors. All rights reserved.
|
| 4 |
+
// Use of this source code is governed by a BSD-style
|
| 5 |
+
// license that can be found in the LICENSE file.
|
| 6 |
+
|
| 7 |
+
// Used to panic because 8g was generating incorrect
|
| 8 |
+
// code for converting a negative float to a uint64.
|
| 9 |
+
|
| 10 |
+
package main
|
| 11 |
+
|
| 12 |
+
func main() {
|
| 13 |
+
var x float32 = -2.5
|
| 14 |
+
|
| 15 |
+
_ = uint64(x)
|
| 16 |
+
_ = float32(0)
|
| 17 |
+
}
|
| 18 |
+
/*
|
| 19 |
+
panic: runtime error: floating point error
|
| 20 |
+
|
| 21 |
+
[signal 0x8 code=0x6 addr=0x8048c64 pc=0x8048c64]
|
| 22 |
+
*/
|
platform/dbops/binaries/go/go/test/fixedbugs/bug342.go
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
// errorcheck
|
| 2 |
+
|
| 3 |
+
// Copyright 2011 The Go Authors. All rights reserved.
|
| 4 |
+
// Use of this source code is governed by a BSD-style
|
| 5 |
+
// license that can be found in the LICENSE file.
|
| 6 |
+
|
| 7 |
+
// Issue 1871.
|
| 8 |
+
|
| 9 |
+
package p
|
| 10 |
+
|
| 11 |
+
type a interface {
|
| 12 |
+
foo(x int) (x int) // ERROR "duplicate argument|redefinition|redeclared"
|
| 13 |
+
}
|
| 14 |
+
|
| 15 |
+
/*
|
| 16 |
+
Previously:
|
| 17 |
+
|
| 18 |
+
bug.go:1 x redclared in this block
|
| 19 |
+
previous declaration at bug.go:1
|
| 20 |
+
*/
|
platform/dbops/binaries/go/go/test/fixedbugs/bug343.go
ADDED
|
@@ -0,0 +1,33 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
// run
|
| 2 |
+
|
| 3 |
+
// Copyright 2011 The Go Authors. All rights reserved.
|
| 4 |
+
// Use of this source code is governed by a BSD-style
|
| 5 |
+
// license that can be found in the LICENSE file.
|
| 6 |
+
|
| 7 |
+
// issue 1900
|
| 8 |
+
|
| 9 |
+
package main
|
| 10 |
+
|
| 11 |
+
func getArgs(data map[string]interface{}, keys ...string) map[string]string {
|
| 12 |
+
ret := map[string]string{}
|
| 13 |
+
var ok bool
|
| 14 |
+
for _, k := range keys {
|
| 15 |
+
ret[k], ok = data[k].(string)
|
| 16 |
+
if !ok {}
|
| 17 |
+
}
|
| 18 |
+
return ret
|
| 19 |
+
}
|
| 20 |
+
|
| 21 |
+
func main() {
|
| 22 |
+
x := getArgs(map[string]interface{}{"x":"y"}, "x")
|
| 23 |
+
if x["x"] != "y" {
|
| 24 |
+
println("BUG bug343", x)
|
| 25 |
+
}
|
| 26 |
+
}
|
| 27 |
+
|
| 28 |
+
|
| 29 |
+
/*
|
| 30 |
+
typecheck [1008592b0]
|
| 31 |
+
. INDREG a(1) l(15) x(24) tc(2) runtime.ret G0 string
|
| 32 |
+
bug343.go:15: internal compiler error: typecheck INDREG
|
| 33 |
+
*/
|
platform/dbops/binaries/go/go/test/fixedbugs/bug344.go
ADDED
|
@@ -0,0 +1,24 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
// errorcheck
|
| 2 |
+
|
| 3 |
+
// Copyright 2011 The Go Authors. All rights reserved.
|
| 4 |
+
// Use of this source code is governed by a BSD-style
|
| 5 |
+
// license that can be found in the LICENSE file.
|
| 6 |
+
|
| 7 |
+
package main
|
| 8 |
+
|
| 9 |
+
import "fmt"
|
| 10 |
+
|
| 11 |
+
func main() {
|
| 12 |
+
// invalid use of goto.
|
| 13 |
+
// do whatever you like, just don't crash.
|
| 14 |
+
i := 42
|
| 15 |
+
a := []*int{&i, &i, &i, &i}
|
| 16 |
+
x := a[0]
|
| 17 |
+
goto start // ERROR "jumps into block"
|
| 18 |
+
z := 1
|
| 19 |
+
_ = z
|
| 20 |
+
for _, x = range a { // GCCGO_ERROR "block"
|
| 21 |
+
start:
|
| 22 |
+
fmt.Sprint(*x)
|
| 23 |
+
}
|
| 24 |
+
}
|
platform/dbops/binaries/go/go/test/fixedbugs/bug345.go
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
// errorcheckdir
|
| 2 |
+
|
| 3 |
+
// Copyright 2011 The Go Authors. All rights reserved.
|
| 4 |
+
// Use of this source code is governed by a BSD-style
|
| 5 |
+
// license that can be found in the LICENSE file.
|
| 6 |
+
|
| 7 |
+
package ignored
|
platform/dbops/binaries/go/go/test/fixedbugs/bug346.go
ADDED
|
@@ -0,0 +1,36 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
// run
|
| 2 |
+
|
| 3 |
+
// Copyright 2011 The Go Authors. All rights reserved.
|
| 4 |
+
// Use of this source code is governed by a BSD-style
|
| 5 |
+
// license that can be found in the LICENSE file.
|
| 6 |
+
|
| 7 |
+
package main
|
| 8 |
+
|
| 9 |
+
import "os"
|
| 10 |
+
|
| 11 |
+
func main() {
|
| 12 |
+
// Test unclosed closure.
|
| 13 |
+
{
|
| 14 |
+
x := 4
|
| 15 |
+
a, b, c, d := func(i int) (p int, q int, r int, s int) { return 1, i, 3, x }(2)
|
| 16 |
+
|
| 17 |
+
if a != 1 || b != 2 || c != 3 || d != 4 {
|
| 18 |
+
println("1# abcd: expected 1 2 3 4 got", a, b, c, d)
|
| 19 |
+
os.Exit(1)
|
| 20 |
+
}
|
| 21 |
+
}
|
| 22 |
+
// Test real closure.
|
| 23 |
+
{
|
| 24 |
+
x := 4
|
| 25 |
+
gf = func(i int) (p int, q int, r int, s int) { return 1, i, 3, x }
|
| 26 |
+
|
| 27 |
+
a, b, c, d := gf(2)
|
| 28 |
+
|
| 29 |
+
if a != 1 || b != 2 || c != 3 || d != 4 {
|
| 30 |
+
println("2# abcd: expected 1 2 3 4 got", a, b, c, d)
|
| 31 |
+
os.Exit(1)
|
| 32 |
+
}
|
| 33 |
+
}
|
| 34 |
+
}
|
| 35 |
+
|
| 36 |
+
var gf func(int) (int, int, int, int)
|
platform/dbops/binaries/go/go/test/fixedbugs/bug347.go
ADDED
|
@@ -0,0 +1,49 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
// run
|
| 2 |
+
|
| 3 |
+
// Copyright 2011 The Go Authors. All rights reserved.
|
| 4 |
+
// Use of this source code is governed by a BSD-style
|
| 5 |
+
// license that can be found in the LICENSE file.
|
| 6 |
+
|
| 7 |
+
package main
|
| 8 |
+
|
| 9 |
+
import (
|
| 10 |
+
"runtime"
|
| 11 |
+
"strings"
|
| 12 |
+
)
|
| 13 |
+
|
| 14 |
+
var t *struct {
|
| 15 |
+
c chan int
|
| 16 |
+
}
|
| 17 |
+
|
| 18 |
+
var c chan int
|
| 19 |
+
|
| 20 |
+
func f() {
|
| 21 |
+
select {
|
| 22 |
+
case <-t.c: // THIS IS LINE 22
|
| 23 |
+
break
|
| 24 |
+
case <-c:
|
| 25 |
+
break
|
| 26 |
+
}
|
| 27 |
+
}
|
| 28 |
+
|
| 29 |
+
func main() {
|
| 30 |
+
defer func() {
|
| 31 |
+
recover()
|
| 32 |
+
for i := 0;; i++ {
|
| 33 |
+
pc, file, line, ok := runtime.Caller(i)
|
| 34 |
+
if !ok {
|
| 35 |
+
print("BUG: bug347: cannot find caller\n")
|
| 36 |
+
return
|
| 37 |
+
}
|
| 38 |
+
if !strings.Contains(file, "bug347.go") || runtime.FuncForPC(pc).Name() != "main.f" {
|
| 39 |
+
// walk past runtime frames
|
| 40 |
+
continue
|
| 41 |
+
}
|
| 42 |
+
if line != 22 {
|
| 43 |
+
print("BUG: bug347: panic at ", file, ":", line, " in ", runtime.FuncForPC(pc).Name(), "\n")
|
| 44 |
+
}
|
| 45 |
+
return
|
| 46 |
+
}
|
| 47 |
+
}()
|
| 48 |
+
f()
|
| 49 |
+
}
|
platform/dbops/binaries/go/go/test/fixedbugs/bug348.go
ADDED
|
@@ -0,0 +1,46 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
// run
|
| 2 |
+
|
| 3 |
+
// Copyright 2011 The Go Authors. All rights reserved.
|
| 4 |
+
// Use of this source code is governed by a BSD-style
|
| 5 |
+
// license that can be found in the LICENSE file.
|
| 6 |
+
|
| 7 |
+
package main
|
| 8 |
+
|
| 9 |
+
import (
|
| 10 |
+
"runtime"
|
| 11 |
+
"strings"
|
| 12 |
+
)
|
| 13 |
+
|
| 14 |
+
func f() {
|
| 15 |
+
var x *string
|
| 16 |
+
|
| 17 |
+
for _, i := range *x { // THIS IS LINE 17
|
| 18 |
+
println(i)
|
| 19 |
+
}
|
| 20 |
+
}
|
| 21 |
+
|
| 22 |
+
func g() {
|
| 23 |
+
}
|
| 24 |
+
|
| 25 |
+
func main() {
|
| 26 |
+
defer func() {
|
| 27 |
+
for i := 0;; i++ {
|
| 28 |
+
pc, file, line, ok := runtime.Caller(i)
|
| 29 |
+
if !ok {
|
| 30 |
+
print("BUG: bug348: cannot find caller\n")
|
| 31 |
+
return
|
| 32 |
+
}
|
| 33 |
+
if !strings.Contains(file, "bug348.go") || runtime.FuncForPC(pc).Name() != "main.f" {
|
| 34 |
+
// walk past runtime frames
|
| 35 |
+
continue
|
| 36 |
+
}
|
| 37 |
+
if line != 17 {
|
| 38 |
+
print("BUG: bug348: panic at ", file, ":", line, " in ", runtime.FuncForPC(pc).Name(), "\n")
|
| 39 |
+
return
|
| 40 |
+
}
|
| 41 |
+
recover()
|
| 42 |
+
return
|
| 43 |
+
}
|
| 44 |
+
}()
|
| 45 |
+
f()
|
| 46 |
+
}
|
platform/dbops/binaries/go/go/test/fixedbugs/bug349.go
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
// errorcheck
|
| 2 |
+
|
| 3 |
+
// Copyright 2011 The Go Authors. All rights reserved.
|
| 4 |
+
// Use of this source code is governed by a BSD-style
|
| 5 |
+
// license that can be found in the LICENSE file.
|
| 6 |
+
|
| 7 |
+
// issue 1192 - detail in error
|
| 8 |
+
|
| 9 |
+
package main
|
| 10 |
+
|
| 11 |
+
func foo() (a, b, c int) {
|
| 12 |
+
return 0, 1 2.01 // ERROR "unexpected literal 2.01|expected ';' or '}' or newline|not enough arguments to return"
|
| 13 |
+
}
|
platform/dbops/binaries/go/go/test/fixedbugs/bug350.go
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
// errorcheck
|
| 2 |
+
|
| 3 |
+
// Copyright 2011 The Go Authors. All rights reserved.
|
| 4 |
+
// Use of this source code is governed by a BSD-style
|
| 5 |
+
// license that can be found in the LICENSE file.
|
| 6 |
+
|
| 7 |
+
package main
|
| 8 |
+
|
| 9 |
+
type T int
|
| 10 |
+
|
| 11 |
+
func (T) m() {} // GCCGO_ERROR "previous"
|
| 12 |
+
func (T) m() {} // ERROR "T\.m already declared|redefinition"
|
| 13 |
+
|
| 14 |
+
func (*T) p() {} // GCCGO_ERROR "previous"
|
| 15 |
+
func (*T) p() {} // ERROR "T\.p already declared|redefinition"
|
platform/dbops/binaries/go/go/test/fixedbugs/bug351.go
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
// errorcheck
|
| 2 |
+
|
| 3 |
+
// Copyright 2011 The Go Authors. All rights reserved.
|
| 4 |
+
// Use of this source code is governed by a BSD-style
|
| 5 |
+
// license that can be found in the LICENSE file.
|
| 6 |
+
|
| 7 |
+
package main
|
| 8 |
+
|
| 9 |
+
var x int
|
| 10 |
+
|
| 11 |
+
func main() {
|
| 12 |
+
(x) := 0 // ERROR "non-name [(]x[)]|non-name on left side"
|
| 13 |
+
}
|
platform/dbops/binaries/go/go/test/fixedbugs/bug352.go
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
// run
|
| 2 |
+
|
| 3 |
+
// Copyright 2011 The Go Authors. All rights reserved.
|
| 4 |
+
// Use of this source code is governed by a BSD-style
|
| 5 |
+
// license that can be found in the LICENSE file.
|
| 6 |
+
|
| 7 |
+
package main
|
| 8 |
+
|
| 9 |
+
var x [10][0]byte
|
| 10 |
+
var y = make([]struct{}, 10)
|
| 11 |
+
|
| 12 |
+
func main() {
|
| 13 |
+
if &x[1] != &x[2] {
|
| 14 |
+
println("BUG: bug352 [0]byte")
|
| 15 |
+
}
|
| 16 |
+
if &y[1] != &y[2] {
|
| 17 |
+
println("BUG: bug352 struct{}")
|
| 18 |
+
}
|
| 19 |
+
}
|
platform/dbops/binaries/go/go/test/fixedbugs/bug353.go
ADDED
|
@@ -0,0 +1,30 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
// errorcheck
|
| 2 |
+
|
| 3 |
+
// Copyright 2011 The Go Authors. All rights reserved.
|
| 4 |
+
// Use of this source code is governed by a BSD-style
|
| 5 |
+
// license that can be found in the LICENSE file.
|
| 6 |
+
|
| 7 |
+
// issue 2089 - internal compiler error
|
| 8 |
+
|
| 9 |
+
package main
|
| 10 |
+
|
| 11 |
+
import (
|
| 12 |
+
"io"
|
| 13 |
+
"os"
|
| 14 |
+
)
|
| 15 |
+
|
| 16 |
+
func echo(fd io.ReadWriterCloser) { // ERROR "undefined.*io.ReadWriterCloser"
|
| 17 |
+
var buf [1024]byte
|
| 18 |
+
for {
|
| 19 |
+
n, err := fd.Read(buf)
|
| 20 |
+
if err != nil {
|
| 21 |
+
break
|
| 22 |
+
}
|
| 23 |
+
fd.Write(buf[0:n])
|
| 24 |
+
}
|
| 25 |
+
}
|
| 26 |
+
|
| 27 |
+
func main() {
|
| 28 |
+
fd, _ := os.Open("a.txt")
|
| 29 |
+
echo(fd)
|
| 30 |
+
}
|