diff options
Diffstat (limited to 'gcc/testsuite/go.test/test/fixedbugs')
61 files changed, 1150 insertions, 23 deletions
diff --git a/gcc/testsuite/go.test/test/fixedbugs/bug191.dir/a.go b/gcc/testsuite/go.test/test/fixedbugs/bug191.dir/a.go index b87ad6f4fee..139a8a3a230 100644 --- a/gcc/testsuite/go.test/test/fixedbugs/bug191.dir/a.go +++ b/gcc/testsuite/go.test/test/fixedbugs/bug191.dir/a.go @@ -4,8 +4,10 @@ package a +var A int + func init() { - println("a"); + A = 1 } type T int; diff --git a/gcc/testsuite/go.test/test/fixedbugs/bug191.dir/b.go b/gcc/testsuite/go.test/test/fixedbugs/bug191.dir/b.go index 3e780ac0dd8..36770f6fc99 100644 --- a/gcc/testsuite/go.test/test/fixedbugs/bug191.dir/b.go +++ b/gcc/testsuite/go.test/test/fixedbugs/bug191.dir/b.go @@ -4,8 +4,10 @@ package b +var B int + func init() { - println("b"); + B = 2 } type V int; diff --git a/gcc/testsuite/go.test/test/fixedbugs/bug191.dir/main.go b/gcc/testsuite/go.test/test/fixedbugs/bug191.dir/main.go index 995134ccfcb..2d24dd12d52 100644 --- a/gcc/testsuite/go.test/test/fixedbugs/bug191.dir/main.go +++ b/gcc/testsuite/go.test/test/fixedbugs/bug191.dir/main.go @@ -11,4 +11,7 @@ var _ T var _ V func main() { + if A != 1 || B != 2 { + panic("wrong vars") + } } diff --git a/gcc/testsuite/go.test/test/fixedbugs/bug295.go b/gcc/testsuite/go.test/test/fixedbugs/bug295.go index e2e5206ca14..63a12a3a741 100644 --- a/gcc/testsuite/go.test/test/fixedbugs/bug295.go +++ b/gcc/testsuite/go.test/test/fixedbugs/bug295.go @@ -6,7 +6,9 @@ package main -import . "testing" // defines top-level T +import . "testing" // defines file-level T + +type _ B // make use of package "testing" (but don't refer to T) type S struct { T int diff --git a/gcc/testsuite/go.test/test/fixedbugs/bug385_64.go b/gcc/testsuite/go.test/test/fixedbugs/bug385_64.go index b593cd53cf1..6789c0abf0f 100644 --- a/gcc/testsuite/go.test/test/fixedbugs/bug385_64.go +++ b/gcc/testsuite/go.test/test/fixedbugs/bug385_64.go @@ -10,13 +10,214 @@ package main -func main() { // GC_ERROR "stack frame too large" - var arr [1000200030]int32 - arr_bkup := arr - _ = arr_bkup -} +var z [10<<20]byte -func F() { // GC_ERROR "stack frame too large" - var arr [1 << 30]int32 - _ = arr[42] +func main() { // GC_ERROR "stack frame too large" + // seq 1 206 | sed 's/.*/ var x& [10<<20]byte; z = x&/' + var x1 [10<<20]byte; z = x1 + var x2 [10<<20]byte; z = x2 + var x3 [10<<20]byte; z = x3 + var x4 [10<<20]byte; z = x4 + var x5 [10<<20]byte; z = x5 + var x6 [10<<20]byte; z = x6 + var x7 [10<<20]byte; z = x7 + var x8 [10<<20]byte; z = x8 + var x9 [10<<20]byte; z = x9 + var x10 [10<<20]byte; z = x10 + var x11 [10<<20]byte; z = x11 + var x12 [10<<20]byte; z = x12 + var x13 [10<<20]byte; z = x13 + var x14 [10<<20]byte; z = x14 + var x15 [10<<20]byte; z = x15 + var x16 [10<<20]byte; z = x16 + var x17 [10<<20]byte; z = x17 + var x18 [10<<20]byte; z = x18 + var x19 [10<<20]byte; z = x19 + var x20 [10<<20]byte; z = x20 + var x21 [10<<20]byte; z = x21 + var x22 [10<<20]byte; z = x22 + var x23 [10<<20]byte; z = x23 + var x24 [10<<20]byte; z = x24 + var x25 [10<<20]byte; z = x25 + var x26 [10<<20]byte; z = x26 + var x27 [10<<20]byte; z = x27 + var x28 [10<<20]byte; z = x28 + var x29 [10<<20]byte; z = x29 + var x30 [10<<20]byte; z = x30 + var x31 [10<<20]byte; z = x31 + var x32 [10<<20]byte; z = x32 + var x33 [10<<20]byte; z = x33 + var x34 [10<<20]byte; z = x34 + var x35 [10<<20]byte; z = x35 + var x36 [10<<20]byte; z = x36 + var x37 [10<<20]byte; z = x37 + var x38 [10<<20]byte; z = x38 + var x39 [10<<20]byte; z = x39 + var x40 [10<<20]byte; z = x40 + var x41 [10<<20]byte; z = x41 + var x42 [10<<20]byte; z = x42 + var x43 [10<<20]byte; z = x43 + var x44 [10<<20]byte; z = x44 + var x45 [10<<20]byte; z = x45 + var x46 [10<<20]byte; z = x46 + var x47 [10<<20]byte; z = x47 + var x48 [10<<20]byte; z = x48 + var x49 [10<<20]byte; z = x49 + var x50 [10<<20]byte; z = x50 + var x51 [10<<20]byte; z = x51 + var x52 [10<<20]byte; z = x52 + var x53 [10<<20]byte; z = x53 + var x54 [10<<20]byte; z = x54 + var x55 [10<<20]byte; z = x55 + var x56 [10<<20]byte; z = x56 + var x57 [10<<20]byte; z = x57 + var x58 [10<<20]byte; z = x58 + var x59 [10<<20]byte; z = x59 + var x60 [10<<20]byte; z = x60 + var x61 [10<<20]byte; z = x61 + var x62 [10<<20]byte; z = x62 + var x63 [10<<20]byte; z = x63 + var x64 [10<<20]byte; z = x64 + var x65 [10<<20]byte; z = x65 + var x66 [10<<20]byte; z = x66 + var x67 [10<<20]byte; z = x67 + var x68 [10<<20]byte; z = x68 + var x69 [10<<20]byte; z = x69 + var x70 [10<<20]byte; z = x70 + var x71 [10<<20]byte; z = x71 + var x72 [10<<20]byte; z = x72 + var x73 [10<<20]byte; z = x73 + var x74 [10<<20]byte; z = x74 + var x75 [10<<20]byte; z = x75 + var x76 [10<<20]byte; z = x76 + var x77 [10<<20]byte; z = x77 + var x78 [10<<20]byte; z = x78 + var x79 [10<<20]byte; z = x79 + var x80 [10<<20]byte; z = x80 + var x81 [10<<20]byte; z = x81 + var x82 [10<<20]byte; z = x82 + var x83 [10<<20]byte; z = x83 + var x84 [10<<20]byte; z = x84 + var x85 [10<<20]byte; z = x85 + var x86 [10<<20]byte; z = x86 + var x87 [10<<20]byte; z = x87 + var x88 [10<<20]byte; z = x88 + var x89 [10<<20]byte; z = x89 + var x90 [10<<20]byte; z = x90 + var x91 [10<<20]byte; z = x91 + var x92 [10<<20]byte; z = x92 + var x93 [10<<20]byte; z = x93 + var x94 [10<<20]byte; z = x94 + var x95 [10<<20]byte; z = x95 + var x96 [10<<20]byte; z = x96 + var x97 [10<<20]byte; z = x97 + var x98 [10<<20]byte; z = x98 + var x99 [10<<20]byte; z = x99 + var x100 [10<<20]byte; z = x100 + var x101 [10<<20]byte; z = x101 + var x102 [10<<20]byte; z = x102 + var x103 [10<<20]byte; z = x103 + var x104 [10<<20]byte; z = x104 + var x105 [10<<20]byte; z = x105 + var x106 [10<<20]byte; z = x106 + var x107 [10<<20]byte; z = x107 + var x108 [10<<20]byte; z = x108 + var x109 [10<<20]byte; z = x109 + var x110 [10<<20]byte; z = x110 + var x111 [10<<20]byte; z = x111 + var x112 [10<<20]byte; z = x112 + var x113 [10<<20]byte; z = x113 + var x114 [10<<20]byte; z = x114 + var x115 [10<<20]byte; z = x115 + var x116 [10<<20]byte; z = x116 + var x117 [10<<20]byte; z = x117 + var x118 [10<<20]byte; z = x118 + var x119 [10<<20]byte; z = x119 + var x120 [10<<20]byte; z = x120 + var x121 [10<<20]byte; z = x121 + var x122 [10<<20]byte; z = x122 + var x123 [10<<20]byte; z = x123 + var x124 [10<<20]byte; z = x124 + var x125 [10<<20]byte; z = x125 + var x126 [10<<20]byte; z = x126 + var x127 [10<<20]byte; z = x127 + var x128 [10<<20]byte; z = x128 + var x129 [10<<20]byte; z = x129 + var x130 [10<<20]byte; z = x130 + var x131 [10<<20]byte; z = x131 + var x132 [10<<20]byte; z = x132 + var x133 [10<<20]byte; z = x133 + var x134 [10<<20]byte; z = x134 + var x135 [10<<20]byte; z = x135 + var x136 [10<<20]byte; z = x136 + var x137 [10<<20]byte; z = x137 + var x138 [10<<20]byte; z = x138 + var x139 [10<<20]byte; z = x139 + var x140 [10<<20]byte; z = x140 + var x141 [10<<20]byte; z = x141 + var x142 [10<<20]byte; z = x142 + var x143 [10<<20]byte; z = x143 + var x144 [10<<20]byte; z = x144 + var x145 [10<<20]byte; z = x145 + var x146 [10<<20]byte; z = x146 + var x147 [10<<20]byte; z = x147 + var x148 [10<<20]byte; z = x148 + var x149 [10<<20]byte; z = x149 + var x150 [10<<20]byte; z = x150 + var x151 [10<<20]byte; z = x151 + var x152 [10<<20]byte; z = x152 + var x153 [10<<20]byte; z = x153 + var x154 [10<<20]byte; z = x154 + var x155 [10<<20]byte; z = x155 + var x156 [10<<20]byte; z = x156 + var x157 [10<<20]byte; z = x157 + var x158 [10<<20]byte; z = x158 + var x159 [10<<20]byte; z = x159 + var x160 [10<<20]byte; z = x160 + var x161 [10<<20]byte; z = x161 + var x162 [10<<20]byte; z = x162 + var x163 [10<<20]byte; z = x163 + var x164 [10<<20]byte; z = x164 + var x165 [10<<20]byte; z = x165 + var x166 [10<<20]byte; z = x166 + var x167 [10<<20]byte; z = x167 + var x168 [10<<20]byte; z = x168 + var x169 [10<<20]byte; z = x169 + var x170 [10<<20]byte; z = x170 + var x171 [10<<20]byte; z = x171 + var x172 [10<<20]byte; z = x172 + var x173 [10<<20]byte; z = x173 + var x174 [10<<20]byte; z = x174 + var x175 [10<<20]byte; z = x175 + var x176 [10<<20]byte; z = x176 + var x177 [10<<20]byte; z = x177 + var x178 [10<<20]byte; z = x178 + var x179 [10<<20]byte; z = x179 + var x180 [10<<20]byte; z = x180 + var x181 [10<<20]byte; z = x181 + var x182 [10<<20]byte; z = x182 + var x183 [10<<20]byte; z = x183 + var x184 [10<<20]byte; z = x184 + var x185 [10<<20]byte; z = x185 + var x186 [10<<20]byte; z = x186 + var x187 [10<<20]byte; z = x187 + var x188 [10<<20]byte; z = x188 + var x189 [10<<20]byte; z = x189 + var x190 [10<<20]byte; z = x190 + var x191 [10<<20]byte; z = x191 + var x192 [10<<20]byte; z = x192 + var x193 [10<<20]byte; z = x193 + var x194 [10<<20]byte; z = x194 + var x195 [10<<20]byte; z = x195 + var x196 [10<<20]byte; z = x196 + var x197 [10<<20]byte; z = x197 + var x198 [10<<20]byte; z = x198 + var x199 [10<<20]byte; z = x199 + var x200 [10<<20]byte; z = x200 + var x201 [10<<20]byte; z = x201 + var x202 [10<<20]byte; z = x202 + var x203 [10<<20]byte; z = x203 + var x204 [10<<20]byte; z = x204 + var x205 [10<<20]byte; z = x205 + var x206 [10<<20]byte; z = x206 } diff --git a/gcc/testsuite/go.test/test/fixedbugs/bug435.go b/gcc/testsuite/go.test/test/fixedbugs/bug435.go index 9c30b143bcf..45323d8eed6 100644 --- a/gcc/testsuite/go.test/test/fixedbugs/bug435.go +++ b/gcc/testsuite/go.test/test/fixedbugs/bug435.go @@ -12,4 +12,4 @@ package main func foo() { - bar(1, // ERROR "unexpected|missing|undefined" + bar(1, // ERROR "unexpected|missing|undefined"
\ No newline at end of file diff --git a/gcc/testsuite/go.test/test/fixedbugs/bug460.dir/a.go b/gcc/testsuite/go.test/test/fixedbugs/bug460.dir/a.go index 02a287b3177..29049d9aae5 100644 --- a/gcc/testsuite/go.test/test/fixedbugs/bug460.dir/a.go +++ b/gcc/testsuite/go.test/test/fixedbugs/bug460.dir/a.go @@ -6,4 +6,8 @@ package a type Foo struct { int + int8 + error + rune + byte } diff --git a/gcc/testsuite/go.test/test/fixedbugs/bug460.dir/b.go b/gcc/testsuite/go.test/test/fixedbugs/bug460.dir/b.go index 1868afe073e..5c0a0c47e3c 100644 --- a/gcc/testsuite/go.test/test/fixedbugs/bug460.dir/b.go +++ b/gcc/testsuite/go.test/test/fixedbugs/bug460.dir/b.go @@ -9,6 +9,9 @@ import "./a" var x a.Foo func main() { - x.int = 20 // ERROR "unexported field" + x.int = 20 // ERROR "unexported field" + x.int8 = 20 // ERROR "unexported field" + x.error = nil // ERROR "unexported field" + x.rune = 'a' // ERROR "unexported field" + x.byte = 20 // ERROR "unexported field" } - diff --git a/gcc/testsuite/go.test/test/fixedbugs/bug475.go b/gcc/testsuite/go.test/test/fixedbugs/bug475.go new file mode 100644 index 00000000000..1bd6fa35ce7 --- /dev/null +++ b/gcc/testsuite/go.test/test/fixedbugs/bug475.go @@ -0,0 +1,22 @@ +// compile + +// Copyright 2013 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. + +// Variable in enclosing function with same name as field in struct +// composite literal confused gccgo. + +package p + +type s1 struct { + f *s1 +} + +func F() { + var f *s1 + _ = func() { + _ = s1{f: nil} + } + _ = f +} diff --git a/gcc/testsuite/go.test/test/fixedbugs/bug476.go b/gcc/testsuite/go.test/test/fixedbugs/bug476.go new file mode 100644 index 00000000000..4ea21740484 --- /dev/null +++ b/gcc/testsuite/go.test/test/fixedbugs/bug476.go @@ -0,0 +1,23 @@ +// compile + +// Copyright 2013 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. + +// Logical operation on named boolean type returns the same type, +// supporting an implicit convertion to an interface type. This used +// to crash gccgo. + +package p + +type B bool + +func (b B) M() {} + +type I interface { + M() +} + +func F(a, b B) I { + return a && b +} diff --git a/gcc/testsuite/go.test/test/fixedbugs/bug477.go b/gcc/testsuite/go.test/test/fixedbugs/bug477.go new file mode 100644 index 00000000000..86289afa6db --- /dev/null +++ b/gcc/testsuite/go.test/test/fixedbugs/bug477.go @@ -0,0 +1,34 @@ +// compile + +// Copyright 2013 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 multiple identical unnamed structs with methods. This caused +// a compilation error with gccgo. + +package p + +type S1 struct{} + +func (s S1) M() {} + +type S2 struct { + F1 struct { + S1 + } + F2 struct { + S1 + } +} + +type I interface { + M() +} + +func F() { + var s2 S2 + var i1 I = s2.F1 + var i2 I = s2.F2 + _, _ = i1, i2 +} diff --git a/gcc/testsuite/go.test/test/fixedbugs/bug478.dir/a.go b/gcc/testsuite/go.test/test/fixedbugs/bug478.dir/a.go new file mode 100644 index 00000000000..a40e454f9b1 --- /dev/null +++ b/gcc/testsuite/go.test/test/fixedbugs/bug478.dir/a.go @@ -0,0 +1,9 @@ +// Copyright 2013 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 p1 + +type S1 struct{} + +func (s S1) f() {} diff --git a/gcc/testsuite/go.test/test/fixedbugs/bug478.dir/b.go b/gcc/testsuite/go.test/test/fixedbugs/bug478.dir/b.go new file mode 100644 index 00000000000..c0fdf1127b4 --- /dev/null +++ b/gcc/testsuite/go.test/test/fixedbugs/bug478.dir/b.go @@ -0,0 +1,13 @@ +// Copyright 2013 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 p2 + +import "./a" + +type S2 struct { + p1.S1 +} + +func (s S2) f() {} diff --git a/gcc/testsuite/go.test/test/fixedbugs/bug478.go b/gcc/testsuite/go.test/test/fixedbugs/bug478.go new file mode 100644 index 00000000000..5e339e801d5 --- /dev/null +++ b/gcc/testsuite/go.test/test/fixedbugs/bug478.go @@ -0,0 +1,10 @@ +// compiledir + +// Copyright 2013 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. + +// Using the same unexported name for a method as a method on an +// imported embedded type caused a gccgo compilation failure. + +package ignored diff --git a/gcc/testsuite/go.test/test/fixedbugs/bug479.dir/a.go b/gcc/testsuite/go.test/test/fixedbugs/bug479.dir/a.go new file mode 100644 index 00000000000..5ff3bef1d16 --- /dev/null +++ b/gcc/testsuite/go.test/test/fixedbugs/bug479.dir/a.go @@ -0,0 +1,15 @@ +// Copyright 2013 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 "unsafe" + +type S2 struct {} + +const C = unsafe.Sizeof(S2{}) + +type S1 struct { + S2 +} diff --git a/gcc/testsuite/go.test/test/fixedbugs/bug479.dir/b.go b/gcc/testsuite/go.test/test/fixedbugs/bug479.dir/b.go new file mode 100644 index 00000000000..a1b27b33264 --- /dev/null +++ b/gcc/testsuite/go.test/test/fixedbugs/bug479.dir/b.go @@ -0,0 +1,16 @@ +// Copyright 2013 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" + +type S3 struct { + p.S1 +} + +func main() { + var i interface{} = S3{} + _ = i +} diff --git a/gcc/testsuite/go.test/test/fixedbugs/bug479.go b/gcc/testsuite/go.test/test/fixedbugs/bug479.go new file mode 100644 index 00000000000..f8a0f93c736 --- /dev/null +++ b/gcc/testsuite/go.test/test/fixedbugs/bug479.go @@ -0,0 +1,10 @@ +// rundir + +// Copyright 2013 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 was not consistent in deciding how to compare a struct type +// for equality, leading to an undefined symbol at link time. + +package ignored diff --git a/gcc/testsuite/go.test/test/fixedbugs/bug480.dir/a.go b/gcc/testsuite/go.test/test/fixedbugs/bug480.dir/a.go new file mode 100644 index 00000000000..6dff51586b7 --- /dev/null +++ b/gcc/testsuite/go.test/test/fixedbugs/bug480.dir/a.go @@ -0,0 +1,17 @@ +// Copyright 2013 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 interface{ + F() T +} + +type T struct { + S +} + +type U struct { + error +} diff --git a/gcc/testsuite/go.test/test/fixedbugs/bug480.dir/b.go b/gcc/testsuite/go.test/test/fixedbugs/bug480.dir/b.go new file mode 100644 index 00000000000..620736540ae --- /dev/null +++ b/gcc/testsuite/go.test/test/fixedbugs/bug480.dir/b.go @@ -0,0 +1,13 @@ +// Copyright 2013 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 t a.T + +func F() error { + return a.U{} +} diff --git a/gcc/testsuite/go.test/test/fixedbugs/bug480.go b/gcc/testsuite/go.test/test/fixedbugs/bug480.go new file mode 100644 index 00000000000..5b44af43083 --- /dev/null +++ b/gcc/testsuite/go.test/test/fixedbugs/bug480.go @@ -0,0 +1,9 @@ +// compiledir + +// Copyright 2013 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 an import of a forward declared type. + +package ignored diff --git a/gcc/testsuite/go.test/test/fixedbugs/bug481.go b/gcc/testsuite/go.test/test/fixedbugs/bug481.go new file mode 100644 index 00000000000..d0922a5a4ff --- /dev/null +++ b/gcc/testsuite/go.test/test/fixedbugs/bug481.go @@ -0,0 +1,18 @@ +// compile + +// Copyright 2013 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. + +// Returning an index into a conversion from string to slice caused a +// compilation error when using gccgo. + +package p + +func F1(s string) byte { + return []byte(s)[0] +} + +func F2(s string) rune { + return []rune(s)[0] +} diff --git a/gcc/testsuite/go.test/test/fixedbugs/bug482.go b/gcc/testsuite/go.test/test/fixedbugs/bug482.go new file mode 100644 index 00000000000..10c48287d3a --- /dev/null +++ b/gcc/testsuite/go.test/test/fixedbugs/bug482.go @@ -0,0 +1,20 @@ +// compile + +// Copyright 2013 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. + +// Using the same name for a field in a composite literal and for a +// global variable that depends on the variable being initialized +// caused gccgo to erroneously report "variable initializer refers to +// itself". + +package p + +type S struct { + F int +} + +var V = S{F: 1} + +var F = V.F diff --git a/gcc/testsuite/go.test/test/fixedbugs/issue4085a.go b/gcc/testsuite/go.test/test/fixedbugs/issue4085a.go index 1d8e57cb7c7..089637d86b8 100644 --- a/gcc/testsuite/go.test/test/fixedbugs/issue4085a.go +++ b/gcc/testsuite/go.test/test/fixedbugs/issue4085a.go @@ -9,10 +9,10 @@ package main type T []int func main() { - _ = make(T, -1) // ERROR "negative" - _ = make(T, 0.5) // ERROR "constant 0.5 truncated to integer|non-integer" - _ = make(T, 1.0) // ok - _ = make(T, 1<<63) // ERROR "len argument too large" - _ = make(T, 0, -1) // ERROR "negative cap" + _ = make(T, -1) // ERROR "negative" + _ = make(T, 0.5) // ERROR "constant 0.5 truncated to integer|non-integer len argument" + _ = make(T, 1.0) // ok + _ = make(T, 1<<63) // ERROR "len argument too large" + _ = make(T, 0, -1) // ERROR "negative cap" _ = make(T, 10, 0) // ERROR "len larger than cap" } diff --git a/gcc/testsuite/go.test/test/fixedbugs/issue4251.go b/gcc/testsuite/go.test/test/fixedbugs/issue4251.go index a14e0896a47..3668d4c89a8 100644 --- a/gcc/testsuite/go.test/test/fixedbugs/issue4251.go +++ b/gcc/testsuite/go.test/test/fixedbugs/issue4251.go @@ -9,13 +9,13 @@ package p func F1(s []byte) []byte { - return s[2:1] // ERROR "inverted" + return s[2:1] // ERROR "invalid slice index|inverted slice range" } func F2(a [10]byte) []byte { - return a[2:1] // ERROR "inverted" + return a[2:1] // ERROR "invalid slice index|inverted slice range" } func F3(s string) string { - return s[2:1] // ERROR "inverted" + return s[2:1] // ERROR "invalid slice index|inverted slice range" } diff --git a/gcc/testsuite/go.test/test/fixedbugs/issue4517d.go b/gcc/testsuite/go.test/test/fixedbugs/issue4517d.go new file mode 100644 index 00000000000..3d727d433ed --- /dev/null +++ b/gcc/testsuite/go.test/test/fixedbugs/issue4517d.go @@ -0,0 +1,9 @@ +// errorcheck + +// Copyright 2012 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 init "fmt" // ERROR "cannot import package as init" diff --git a/gcc/testsuite/go.test/test/fixedbugs/issue4776.go b/gcc/testsuite/go.test/test/fixedbugs/issue4776.go new file mode 100644 index 00000000000..13781af1f36 --- /dev/null +++ b/gcc/testsuite/go.test/test/fixedbugs/issue4776.go @@ -0,0 +1,10 @@ +// errorcheck + +// Copyright 2013 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 4776: missing package declaration error should be fatal. + +type MyInt int32 // ERROR "package statement must be first|package clause" + diff --git a/gcc/testsuite/go.test/test/fixedbugs/issue4847.go b/gcc/testsuite/go.test/test/fixedbugs/issue4847.go new file mode 100644 index 00000000000..91a6568f271 --- /dev/null +++ b/gcc/testsuite/go.test/test/fixedbugs/issue4847.go @@ -0,0 +1,24 @@ +// errorcheck + +// Copyright 2013 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 4847: initialization loop is not detected. + +package p + +type ( + E int + S int +) + +type matcher func(s *S) E + +func matchList(s *S) E { return matcher(matchAnyFn)(s) } + +var foo = matcher(matchList) + +var matchAny = matcher(matchList) // ERROR "initialization loop|depends upon itself" + +func matchAnyFn(s *S) (err E) { return matchAny(s) } diff --git a/gcc/testsuite/go.test/test/fixedbugs/issue5172.go b/gcc/testsuite/go.test/test/fixedbugs/issue5172.go new file mode 100644 index 00000000000..a6acbd3db78 --- /dev/null +++ b/gcc/testsuite/go.test/test/fixedbugs/issue5172.go @@ -0,0 +1,19 @@ +// errorcheck + +// Copyright 2013 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 5172: spurious warn about type conversion on broken type inside go and defer + +package main + +type foo struct { + x bar // ERROR "undefined" +} + +func main() { + var f foo + go f.bar() // GCCGO_ERROR "undefined" + defer f.bar() // GCCGO_ERROR "undefined" +} diff --git a/gcc/testsuite/go.test/test/fixedbugs/issue5358.go b/gcc/testsuite/go.test/test/fixedbugs/issue5358.go new file mode 100644 index 00000000000..c2b1da9e0e1 --- /dev/null +++ b/gcc/testsuite/go.test/test/fixedbugs/issue5358.go @@ -0,0 +1,17 @@ +// errorcheck + +// Copyright 2013 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 5358: incorrect error message when using f(g()) form on ... args. + +package main + +func f(x int, y ...int) {} + +func g() (int, []int) + +func main() { + f(g()) // ERROR "as type int in|incompatible type" +} diff --git a/gcc/testsuite/go.test/test/fixedbugs/issue5493.go b/gcc/testsuite/go.test/test/fixedbugs/issue5493.go index bbc62ffac0a..2ee0398af2c 100644 --- a/gcc/testsuite/go.test/test/fixedbugs/issue5493.go +++ b/gcc/testsuite/go.test/test/fixedbugs/issue5493.go @@ -52,7 +52,7 @@ func main() { runtime.GC() } if count != 0 { - println(count, "out of", N, "finalizer are called") + println(count, "out of", N, "finalizer are not called") panic("not all finalizers are called") } } diff --git a/gcc/testsuite/go.test/test/fixedbugs/issue5581.go b/gcc/testsuite/go.test/test/fixedbugs/issue5581.go new file mode 100644 index 00000000000..36a4ad671d2 --- /dev/null +++ b/gcc/testsuite/go.test/test/fixedbugs/issue5581.go @@ -0,0 +1,34 @@ +// errorcheck + +// Used to emit a spurious "invalid recursive type" error. +// See golang.org/issue/5581. + +// Copyright 2013 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" + +func NewBar() *Bar { return nil } + +func (x *Foo) Method() (int, error) { + for y := range x.m { + _ = y.A + } + return 0, nil +} + +type Foo struct { + m map[*Bar]int +} + +type Bar struct { + A *Foo + B chan Blah // ERROR "undefined.*Blah" +} + +func main() { + fmt.Println("Hello, playground") +} diff --git a/gcc/testsuite/go.test/test/fixedbugs/issue5609.go b/gcc/testsuite/go.test/test/fixedbugs/issue5609.go new file mode 100644 index 00000000000..ea770b48654 --- /dev/null +++ b/gcc/testsuite/go.test/test/fixedbugs/issue5609.go @@ -0,0 +1,13 @@ +// errorcheck + +// Copyright 2013 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 5609: overflow when calculating array size + +package pkg + +const Large uint64 = 18446744073709551615 + +var foo [Large]uint64 // ERROR "array bound is too large|array bound overflows" diff --git a/gcc/testsuite/go.test/test/fixedbugs/issue5698.go b/gcc/testsuite/go.test/test/fixedbugs/issue5698.go new file mode 100644 index 00000000000..035bbd35d25 --- /dev/null +++ b/gcc/testsuite/go.test/test/fixedbugs/issue5698.go @@ -0,0 +1,18 @@ +// errorcheck + +// Copyright 2013 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 5698: can define a key type with slices. + +package main + +type Key struct { + a int16 // the compiler was confused by the padding. + b []int +} + +type Val struct{} + +type Map map[Key]Val // ERROR "invalid map key type" diff --git a/gcc/testsuite/go.test/test/fixedbugs/issue5704.go b/gcc/testsuite/go.test/test/fixedbugs/issue5704.go new file mode 100644 index 00000000000..1dfa072143e --- /dev/null +++ b/gcc/testsuite/go.test/test/fixedbugs/issue5704.go @@ -0,0 +1,46 @@ +// run + +// Copyright 2012 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 5704: Conversions of empty strings to byte +// or rune slices return empty but non-nil slices. + +package main + +type ( + mystring string + mybytes []byte + myrunes []rune +) + +func checkBytes(s []byte, arg string) { + if len(s) != 0 { + panic("len(" + arg + ") != 0") + } + if s == nil { + panic(arg + " == nil") + } +} + +func checkRunes(s []rune, arg string) { + if len(s) != 0 { + panic("len(" + arg + ") != 0") + } + if s == nil { + panic(arg + " == nil") + } +} + +func main() { + checkBytes([]byte(""), `[]byte("")`) + checkBytes([]byte(mystring("")), `[]byte(mystring(""))`) + checkBytes(mybytes(""), `mybytes("")`) + checkBytes(mybytes(mystring("")), `mybytes(mystring(""))`) + + checkRunes([]rune(""), `[]rune("")`) + checkRunes([]rune(mystring("")), `[]rune(mystring(""))`) + checkRunes(myrunes(""), `myrunes("")`) + checkRunes(myrunes(mystring("")), `myrunes(mystring(""))`) +} diff --git a/gcc/testsuite/go.test/test/fixedbugs/issue5856.go b/gcc/testsuite/go.test/test/fixedbugs/issue5856.go new file mode 100644 index 00000000000..35cadf8c9e7 --- /dev/null +++ b/gcc/testsuite/go.test/test/fixedbugs/issue5856.go @@ -0,0 +1,38 @@ +// run + +// Copyright 2013 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" + "os" + "runtime" + "strings" +) + +func main() { + f() + panic("deferred function not run") +} + +var x = 1 + +func f() { + if x == 0 { + return + } + defer g() + panic("panic") +} + +func g() { + _, file, line, _ := runtime.Caller(2) + if !strings.HasSuffix(file, "issue5856.go") || line != 28 { + fmt.Printf("BUG: defer called from %s:%d, want issue5856.go:28\n", file, line) + os.Exit(1) + } + os.Exit(0) +} diff --git a/gcc/testsuite/go.test/test/fixedbugs/issue5910.dir/a.go b/gcc/testsuite/go.test/test/fixedbugs/issue5910.dir/a.go new file mode 100644 index 00000000000..b236c15c7d3 --- /dev/null +++ b/gcc/testsuite/go.test/test/fixedbugs/issue5910.dir/a.go @@ -0,0 +1,22 @@ +// Copyright 2013 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 Package struct { + name string +} + +type Future struct { + result chan struct { + *Package + error + } +} + +func (t *Future) Result() (*Package, error) { + result := <-t.result + t.result <- result + return result.Package, result.error +} diff --git a/gcc/testsuite/go.test/test/fixedbugs/issue5910.dir/main.go b/gcc/testsuite/go.test/test/fixedbugs/issue5910.dir/main.go new file mode 100644 index 00000000000..c5d42ea0986 --- /dev/null +++ b/gcc/testsuite/go.test/test/fixedbugs/issue5910.dir/main.go @@ -0,0 +1,12 @@ +// Copyright 2013 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() { + f := new(a.Future) + f.Result() +} diff --git a/gcc/testsuite/go.test/test/fixedbugs/issue5910.go b/gcc/testsuite/go.test/test/fixedbugs/issue5910.go new file mode 100644 index 00000000000..54e74bac8dd --- /dev/null +++ b/gcc/testsuite/go.test/test/fixedbugs/issue5910.go @@ -0,0 +1,10 @@ +// compiledir + +// Copyright 2013 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 5910: parsing of unnamed struct types +// in inlined bodies was broken. + +package ignored diff --git a/gcc/testsuite/go.test/test/fixedbugs/issue5957.dir/a.go b/gcc/testsuite/go.test/test/fixedbugs/issue5957.dir/a.go new file mode 100644 index 00000000000..7411d5fcd54 --- /dev/null +++ b/gcc/testsuite/go.test/test/fixedbugs/issue5957.dir/a.go @@ -0,0 +1,3 @@ +package surprise + +var X int diff --git a/gcc/testsuite/go.test/test/fixedbugs/issue5957.dir/b.go b/gcc/testsuite/go.test/test/fixedbugs/issue5957.dir/b.go new file mode 100644 index 00000000000..9bc561b9ce5 --- /dev/null +++ b/gcc/testsuite/go.test/test/fixedbugs/issue5957.dir/b.go @@ -0,0 +1,2 @@ +package surprise2 + diff --git a/gcc/testsuite/go.test/test/fixedbugs/issue5957.dir/c.go b/gcc/testsuite/go.test/test/fixedbugs/issue5957.dir/c.go new file mode 100644 index 00000000000..a1781d4d406 --- /dev/null +++ b/gcc/testsuite/go.test/test/fixedbugs/issue5957.dir/c.go @@ -0,0 +1,12 @@ +package p + +import ( + "./a" // ERROR "imported and not used: \x22a\x22 as surprise|imported and not used: surprise" + "./b" // GC_ERROR "imported and not used: \x22b\x22 as surprise2|imported and not used: surprise2" + b "./b" // ERROR "imported and not used: \x22b\x22$|imported and not used: surprise2" + foo "math" // ERROR "imported and not used: \x22math\x22 as foo|imported and not used: math" + "fmt" // actually used + "strings" // ERROR "imported and not used: \x22strings\x22|imported and not used: strings" +) + +var _ = fmt.Printf diff --git a/gcc/testsuite/go.test/test/fixedbugs/issue5957.go b/gcc/testsuite/go.test/test/fixedbugs/issue5957.go new file mode 100644 index 00000000000..891d8e6d2ee --- /dev/null +++ b/gcc/testsuite/go.test/test/fixedbugs/issue5957.go @@ -0,0 +1,7 @@ +// errorcheckdir + +// Copyright 2013 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 diff --git a/gcc/testsuite/go.test/test/fixedbugs/issue5963.go b/gcc/testsuite/go.test/test/fixedbugs/issue5963.go new file mode 100644 index 00000000000..190e8f45647 --- /dev/null +++ b/gcc/testsuite/go.test/test/fixedbugs/issue5963.go @@ -0,0 +1,50 @@ +// run + +// Copyright 2013 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. + +// Used to die in runtime due to init goroutine exiting while +// locked to main thread. + +package main + +import ( + "os" + "runtime" +) + +func init() { + c := make(chan int, 1) + defer func() { + c <- 0 + }() + go func() { + os.Exit(<-c) + }() + runtime.Goexit() +} + +func main() { +} + +/* Before fix: + +invalid m->locked = 2 +fatal error: internal lockOSThread error + +goroutine 2 [runnable]: +runtime.MHeap_Scavenger() + /Users/rsc/g/go/src/pkg/runtime/mheap.c:438 +runtime.goexit() + /Users/rsc/g/go/src/pkg/runtime/proc.c:1313 +created by runtime.main + /Users/rsc/g/go/src/pkg/runtime/proc.c:165 + +goroutine 3 [runnable]: +main.funcĀ·002() + /Users/rsc/g/go/test/fixedbugs/issue5963.go:22 +created by main.initĀ·1 + /Users/rsc/g/go/test/fixedbugs/issue5963.go:24 +0xb9 +exit status 2 +*/ diff --git a/gcc/testsuite/go.test/test/fixedbugs/issue6004.go b/gcc/testsuite/go.test/test/fixedbugs/issue6004.go new file mode 100644 index 00000000000..45aaffd2c90 --- /dev/null +++ b/gcc/testsuite/go.test/test/fixedbugs/issue6004.go @@ -0,0 +1,15 @@ +// errorcheck + +// Copyright 2013 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 + +func main() { + _ = nil // ERROR "use of untyped nil" + _, _ = nil, 1 // ERROR "use of untyped nil" + _, _ = 1, nil // ERROR "use of untyped nil" + _ = append(nil, 1, 2, 3) // ERROR "untyped nil" +} + diff --git a/gcc/testsuite/go.test/test/fixedbugs/issue6036.go b/gcc/testsuite/go.test/test/fixedbugs/issue6036.go new file mode 100644 index 00000000000..5f787c56900 --- /dev/null +++ b/gcc/testsuite/go.test/test/fixedbugs/issue6036.go @@ -0,0 +1,44 @@ +// +build amd64 +// compile + +// Copyright 2013 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 6036: 6g's backend generates OINDREG with +// offsets larger than 32-bit. + +package main + +type T struct { + Large [1 << 31]byte + A int + B int +} + +func F(t *T) { + t.B = t.A +} + +type T2 [1<<31 + 2]byte + +func F2(t *T2) { + t[1<<31+1] = 42 +} + +type T3 [1<<15 + 1][1<<15 + 1]int + +func F3(t *T3) { + t[1<<15][1<<15] = 42 +} + +type S struct { + A int32 + B int32 +} + +type T4 [1<<29 + 1]S + +func F4(t *T4) { + t[1<<29].B = 42 +} diff --git a/gcc/testsuite/go.test/test/fixedbugs/issue6055.go b/gcc/testsuite/go.test/test/fixedbugs/issue6055.go new file mode 100644 index 00000000000..698f62ac956 --- /dev/null +++ b/gcc/testsuite/go.test/test/fixedbugs/issue6055.go @@ -0,0 +1,35 @@ +// run + +// Copyright 2013 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 "runtime" + +type Closer interface { + Close() +} + +func nilInterfaceDeferCall() { + defer func() { + // make sure a traceback happens with jmpdefer on the stack + runtime.GC() + }() + var x Closer + defer x.Close() +} + +func shouldPanic(f func()) { + defer func() { + if recover() == nil { + panic("did not panic") + } + }() + f() +} + +func main() { + shouldPanic(nilInterfaceDeferCall) +} diff --git a/gcc/testsuite/go.test/test/fixedbugs/issue6131.go b/gcc/testsuite/go.test/test/fixedbugs/issue6131.go new file mode 100644 index 00000000000..817e4a877cd --- /dev/null +++ b/gcc/testsuite/go.test/test/fixedbugs/issue6131.go @@ -0,0 +1,20 @@ +// compile + +// Copyright 2013 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 6131: missing typecheck after reducing +// n%1 == 0 to a constant value. + +package main + +func isGood(n int) bool { + return n%1 == 0 +} + +func main() { + if !isGood(256) { + panic("!isGood") + } +} diff --git a/gcc/testsuite/go.test/test/fixedbugs/issue6140.go b/gcc/testsuite/go.test/test/fixedbugs/issue6140.go new file mode 100644 index 00000000000..d494933b2e2 --- /dev/null +++ b/gcc/testsuite/go.test/test/fixedbugs/issue6140.go @@ -0,0 +1,31 @@ +// compile + +// Copyright 2013 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 6140: compiler incorrectly rejects method values +// whose receiver has an unnamed interface type. + +package p + +type T *interface { + m() int +} + +var x T + +var _ = (*x).m + +var y interface { + m() int +} + +var _ = y.m + +type I interface { + String() string +} + +var z *struct{ I } +var _ = z.String diff --git a/gcc/testsuite/go.test/test/fixedbugs/issue6247.go b/gcc/testsuite/go.test/test/fixedbugs/issue6247.go new file mode 100644 index 00000000000..eea8f9c878f --- /dev/null +++ b/gcc/testsuite/go.test/test/fixedbugs/issue6247.go @@ -0,0 +1,17 @@ +// compile + +// Copyright 2013 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 6247: 5g used to be confused by the numbering +// of floating-point registers. + +package main + +var p map[string]interface{} +var v interface{} + +func F() { + p["hello"] = v.(complex128) * v.(complex128) +} diff --git a/gcc/testsuite/go.test/test/fixedbugs/issue6269.go b/gcc/testsuite/go.test/test/fixedbugs/issue6269.go new file mode 100644 index 00000000000..af5feb72866 --- /dev/null +++ b/gcc/testsuite/go.test/test/fixedbugs/issue6269.go @@ -0,0 +1,39 @@ +// run + +// Copyright 2013 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 6269: name collision on method names for function local types. + +package main + +type foo struct{} + +func (foo) Error() string { + return "ok" +} + +type bar struct{} + +func (bar) Error() string { + return "fail" +} + +func unused() { + type collision struct { + bar + } + _ = collision{} +} + +func main() { + type collision struct { + foo + } + s := error(collision{}) + if str := s.Error(); str != "ok" { + println("s.Error() ==", str) + panic(`s.Error() != "ok"`) + } +} diff --git a/gcc/testsuite/go.test/test/fixedbugs/issue6298.go b/gcc/testsuite/go.test/test/fixedbugs/issue6298.go new file mode 100644 index 00000000000..6303dbe5b09 --- /dev/null +++ b/gcc/testsuite/go.test/test/fixedbugs/issue6298.go @@ -0,0 +1,15 @@ +// compile + +// golang.org/issue/6298. +// Used to cause "internal error: typename ideal bool" + +// Copyright 2013 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 + +func main() { + var x interface{} = "abc"[0] == 'a' + _ = x +} diff --git a/gcc/testsuite/go.test/test/fixedbugs/issue6399.go b/gcc/testsuite/go.test/test/fixedbugs/issue6399.go new file mode 100644 index 00000000000..b3d1c855b2c --- /dev/null +++ b/gcc/testsuite/go.test/test/fixedbugs/issue6399.go @@ -0,0 +1,27 @@ +// compile + +package main + +type Foo interface { + Print() +} + +type Bar struct{} + +func (b Bar) Print() {} + +func main() { + b := make([]Bar, 20) + f := make([]Foo, 20) + for i := range f { + f[i] = b[i] + } + T(f) + _ = make([]struct{}, 1) +} + +func T(f []Foo) { + for i := range f { + f[i].Print() + } +} diff --git a/gcc/testsuite/go.test/test/fixedbugs/issue6513.dir/a.go b/gcc/testsuite/go.test/test/fixedbugs/issue6513.dir/a.go new file mode 100644 index 00000000000..da90ca377b4 --- /dev/null +++ b/gcc/testsuite/go.test/test/fixedbugs/issue6513.dir/a.go @@ -0,0 +1,7 @@ +// Copyright 2013 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{ int } diff --git a/gcc/testsuite/go.test/test/fixedbugs/issue6513.dir/b.go b/gcc/testsuite/go.test/test/fixedbugs/issue6513.dir/b.go new file mode 100644 index 00000000000..3b35b2d324b --- /dev/null +++ b/gcc/testsuite/go.test/test/fixedbugs/issue6513.dir/b.go @@ -0,0 +1,9 @@ +// Copyright 2013 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 U struct{ a.T } diff --git a/gcc/testsuite/go.test/test/fixedbugs/issue6513.dir/main.go b/gcc/testsuite/go.test/test/fixedbugs/issue6513.dir/main.go new file mode 100644 index 00000000000..f09b7274821 --- /dev/null +++ b/gcc/testsuite/go.test/test/fixedbugs/issue6513.dir/main.go @@ -0,0 +1,16 @@ +// Copyright 2013 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 t a.T + var u b.U + _, _ = t, u +} diff --git a/gcc/testsuite/go.test/test/fixedbugs/issue6513.go b/gcc/testsuite/go.test/test/fixedbugs/issue6513.go new file mode 100644 index 00000000000..b32e0c5614d --- /dev/null +++ b/gcc/testsuite/go.test/test/fixedbugs/issue6513.go @@ -0,0 +1,10 @@ +// compiledir + +// Copyright 2013 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 6513: embedded builtins may get incorrect qualified +// field name during import. + +package ignored diff --git a/gcc/testsuite/go.test/test/fixedbugs/issue6789.dir/a.go b/gcc/testsuite/go.test/test/fixedbugs/issue6789.dir/a.go new file mode 100644 index 00000000000..9c90e0740cd --- /dev/null +++ b/gcc/testsuite/go.test/test/fixedbugs/issue6789.dir/a.go @@ -0,0 +1,14 @@ +// Copyright 2013 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 unexported struct { + a int + b bool +} + +type Struct struct { + unexported +} diff --git a/gcc/testsuite/go.test/test/fixedbugs/issue6789.dir/b.go b/gcc/testsuite/go.test/test/fixedbugs/issue6789.dir/b.go new file mode 100644 index 00000000000..b6a6fc317f5 --- /dev/null +++ b/gcc/testsuite/go.test/test/fixedbugs/issue6789.dir/b.go @@ -0,0 +1,12 @@ +// Copyright 2013 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" + +type s a.Struct + +func main() { +} diff --git a/gcc/testsuite/go.test/test/fixedbugs/issue6789.go b/gcc/testsuite/go.test/test/fixedbugs/issue6789.go new file mode 100644 index 00000000000..e3a2c3320ef --- /dev/null +++ b/gcc/testsuite/go.test/test/fixedbugs/issue6789.go @@ -0,0 +1,10 @@ +// rundir + +// Copyright 2013 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 6789: gccgo failed to find the hash function for an +// unexported struct embedded in an exported struct. + +package ignored diff --git a/gcc/testsuite/go.test/test/fixedbugs/issue6899.go b/gcc/testsuite/go.test/test/fixedbugs/issue6899.go new file mode 100644 index 00000000000..a693bf28508 --- /dev/null +++ b/gcc/testsuite/go.test/test/fixedbugs/issue6899.go @@ -0,0 +1,13 @@ +// cmpout + +// Copyright 2013 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 "math" + +func main() { + println(math.Copysign(0, -1)) +} diff --git a/gcc/testsuite/go.test/test/fixedbugs/issue6899.out b/gcc/testsuite/go.test/test/fixedbugs/issue6899.out new file mode 100644 index 00000000000..e2375f07766 --- /dev/null +++ b/gcc/testsuite/go.test/test/fixedbugs/issue6899.out @@ -0,0 +1 @@ +-0.000000e+000 |