Commit edf72584 authored by Chris Manghane's avatar Chris Manghane

test: add fixed GoSmith bugs reported on the gcc Bugzilla

Change-Id: I36b57f3e299a4f96b8b5aa55c9c224d888229684
Reviewed-on: https://go-review.googlesource.com/1790Reviewed-by: 's avatarMinux Ma <minux@golang.org>
Reviewed-by: 's avatarRuss Cox <rsc@golang.org>
Reviewed-by: 's avatarIan Lance Taylor <iant@golang.org>
parent c85a2bf9
// 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
}
// 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:
}
}
// 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:
}
}
// 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())
}
// 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:
}
}
// 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]++
}
// 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]++
}
// 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{})
}
// 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]++
}
// 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{}{}
// 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 {
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment