mirror of
https://github.com/golang/go
synced 2024-09-06 00:19:45 +00:00
test: add fixed GoSmith bugs reported on the gcc Bugzilla
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>
This commit is contained in:
parent
c85a2bf9c2
commit
edf7258416
17
test/fixedbugs/gcc61204.go
Normal file
17
test/fixedbugs/gcc61204.go
Normal file
|
@ -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
|
||||
}
|
19
test/fixedbugs/gcc61244.go
Normal file
19
test/fixedbugs/gcc61244.go
Normal file
|
@ -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:
|
||||
}
|
||||
}
|
17
test/fixedbugs/gcc61246.go
Normal file
17
test/fixedbugs/gcc61246.go
Normal file
|
@ -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:
|
||||
}
|
||||
}
|
14
test/fixedbugs/gcc61248.go
Normal file
14
test/fixedbugs/gcc61248.go
Normal file
|
@ -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())
|
||||
}
|
20
test/fixedbugs/gcc61253.go
Normal file
20
test/fixedbugs/gcc61253.go
Normal file
|
@ -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:
|
||||
}
|
||||
|
||||
}
|
13
test/fixedbugs/gcc61254.go
Normal file
13
test/fixedbugs/gcc61254.go
Normal file
|
@ -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]++
|
||||
}
|
13
test/fixedbugs/gcc61255.go
Normal file
13
test/fixedbugs/gcc61255.go
Normal file
|
@ -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]++
|
||||
}
|
13
test/fixedbugs/gcc61258.go
Normal file
13
test/fixedbugs/gcc61258.go
Normal file
|
@ -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{})
|
||||
}
|
13
test/fixedbugs/gcc61264.go
Normal file
13
test/fixedbugs/gcc61264.go
Normal file
|
@ -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]++
|
||||
}
|
16
test/fixedbugs/gcc61265.go
Normal file
16
test/fixedbugs/gcc61265.go
Normal file
|
@ -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{}{}
|
16
test/fixedbugs/gcc61273.go
Normal file
16
test/fixedbugs/gcc61273.go
Normal file
|
@ -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 {
|
||||
}
|
||||
}
|
Loading…
Reference in a new issue