]> Cypherpunks repositories - gostls13.git/commitdiff
test: add fixed GoSmith bugs reported on the gcc Bugzilla
authorChris Manghane <cmang@golang.org>
Thu, 18 Dec 2014 17:54:32 +0000 (09:54 -0800)
committerChris Manghane <cmang@golang.org>
Mon, 29 Dec 2014 23:21:10 +0000 (23:21 +0000)
Change-Id: I36b57f3e299a4f96b8b5aa55c9c224d888229684
Reviewed-on: https://go-review.googlesource.com/1790
Reviewed-by: Minux Ma <minux@golang.org>
Reviewed-by: Russ Cox <rsc@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
test/fixedbugs/gcc61204.go [new file with mode: 0644]
test/fixedbugs/gcc61244.go [new file with mode: 0644]
test/fixedbugs/gcc61246.go [new file with mode: 0644]
test/fixedbugs/gcc61248.go [new file with mode: 0644]
test/fixedbugs/gcc61253.go [new file with mode: 0644]
test/fixedbugs/gcc61254.go [new file with mode: 0644]
test/fixedbugs/gcc61255.go [new file with mode: 0644]
test/fixedbugs/gcc61258.go [new file with mode: 0644]
test/fixedbugs/gcc61264.go [new file with mode: 0644]
test/fixedbugs/gcc61265.go [new file with mode: 0644]
test/fixedbugs/gcc61273.go [new file with mode: 0644]

diff --git a/test/fixedbugs/gcc61204.go b/test/fixedbugs/gcc61204.go
new file mode 100644 (file)
index 0000000..5a5bb16
--- /dev/null
@@ -0,0 +1,17 @@
+// compile
+
+// Copyright 2014 The Go Authors.  All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+// PR61204: Making temporaries for zero-sized types caused an ICE in gccgo.
+// This is a reduction of a program reported by GoSmith.
+
+package main
+
+func main() {
+       type t [0]int
+       var v t
+       v, _ = [0]int{}, 0
+       _ = v
+}
diff --git a/test/fixedbugs/gcc61244.go b/test/fixedbugs/gcc61244.go
new file mode 100644 (file)
index 0000000..7fbc872
--- /dev/null
@@ -0,0 +1,19 @@
+// compile
+
+// Copyright 2014 The Go Authors.  All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+// PR61244: Type descriptors expressions were not traversed, causing an ICE
+// in gccgo when producing the backend representation.
+// This is a reduction of a program reported by GoSmith.
+
+package main
+
+const a = 0
+
+func main() {
+       switch i := (interface{})(a); i.(type) {
+       case [0]string:
+       }
+}
diff --git a/test/fixedbugs/gcc61246.go b/test/fixedbugs/gcc61246.go
new file mode 100644 (file)
index 0000000..4866570
--- /dev/null
@@ -0,0 +1,17 @@
+// compile
+
+// Copyright 2014 The Go Authors.  All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+// PR61246: Switch conditions could be untyped, causing an ICE when the
+// conditions were lowered into temporaries.
+// This is a reduction of a program reported by GoSmith.
+
+package main
+
+func main() {
+       switch 1 != 1 {
+       default:
+       }
+}
diff --git a/test/fixedbugs/gcc61248.go b/test/fixedbugs/gcc61248.go
new file mode 100644 (file)
index 0000000..593c634
--- /dev/null
@@ -0,0 +1,14 @@
+// compile
+
+// Copyright 2014 The Go Authors.  All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+// PR61248: Transformations to recover calls made them fail typechecking in gccgo.
+
+package main
+
+func main() {
+       var f func(int, interface{})
+       go f(0, recover())
+}
diff --git a/test/fixedbugs/gcc61253.go b/test/fixedbugs/gcc61253.go
new file mode 100644 (file)
index 0000000..dc125ac
--- /dev/null
@@ -0,0 +1,20 @@
+// compile
+
+// Copyright 2014 The Go Authors.  All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+// PR61253: gccgo incorrectly parsed the
+// `RecvStmt = ExpressionList "=" RecvExpr` production.
+
+package main
+
+func main() {
+       c := make(chan int)
+       v := new(int)
+       b := new(bool)
+       select {
+       case (*v), (*b) = <-c:
+       }
+
+}
diff --git a/test/fixedbugs/gcc61254.go b/test/fixedbugs/gcc61254.go
new file mode 100644 (file)
index 0000000..36ac7d4
--- /dev/null
@@ -0,0 +1,13 @@
+// compile
+
+// Copyright 2014 The Go Authors.  All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+// PR61254: gccgo failed to compile a slice expression with missing indices.
+
+package main
+
+func main() {
+       [][]int{}[:][0][0]++
+}
diff --git a/test/fixedbugs/gcc61255.go b/test/fixedbugs/gcc61255.go
new file mode 100644 (file)
index 0000000..a0e6d18
--- /dev/null
@@ -0,0 +1,13 @@
+// compile
+
+// Copyright 2014 The Go Authors.  All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+// PR61255: gccgo failed to compile IncDec statements on variadic functions.
+
+package main
+
+func main() {
+       append([]byte{}, 0)[0]++
+}
diff --git a/test/fixedbugs/gcc61258.go b/test/fixedbugs/gcc61258.go
new file mode 100644 (file)
index 0000000..8474665
--- /dev/null
@@ -0,0 +1,13 @@
+// run
+
+// Copyright 2014 The Go Authors.  All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+// PR61258: gccgo crashed when deleting a zero-sized key from a map.
+
+package main
+
+func main() {
+       delete(make(map[[0]bool]int), [0]bool{})
+}
diff --git a/test/fixedbugs/gcc61264.go b/test/fixedbugs/gcc61264.go
new file mode 100644 (file)
index 0000000..d4e05f4
--- /dev/null
@@ -0,0 +1,13 @@
+// compile
+
+// Copyright 2014 The Go Authors.  All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+// PR61264: IncDec statements involving composite literals caused in ICE in gccgo.
+
+package main
+
+func main() {
+        map[int]int{}[0]++
+}
diff --git a/test/fixedbugs/gcc61265.go b/test/fixedbugs/gcc61265.go
new file mode 100644 (file)
index 0000000..42fae36
--- /dev/null
@@ -0,0 +1,16 @@
+// compile
+
+// Copyright 2014 The Go Authors.  All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+// PR61265: The gccgo middle-end failed to represent array composite literals
+// where the elements are zero-sized values.
+// This is a reduction of a program reported by GoSmith.
+
+package p
+
+var a = [1][0]int{B}[0]
+var B = [0]int{}
+var c = [1]struct{}{D}[0]
+var D = struct{}{}
diff --git a/test/fixedbugs/gcc61273.go b/test/fixedbugs/gcc61273.go
new file mode 100644 (file)
index 0000000..2983222
--- /dev/null
@@ -0,0 +1,16 @@
+// compile
+
+// Copyright 2014 The Go Authors.  All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+// PR61273: gccgo failed to compile a SendStmt in the PostStmt of a ForClause
+// that involved predefined constants.
+
+package main
+
+func main() {
+       c := make(chan bool, 1)
+       for ; false; c <- false {
+       }
+}