mirror of
https://github.com/golang/go
synced 2024-11-05 18:36:08 +00:00
test: add some test cases that were miscompiled by gccgo
R=golang-dev, r CC=golang-dev https://golang.org/cl/40310043
This commit is contained in:
parent
4321beba85
commit
9bea6f3b2c
8 changed files with 113 additions and 0 deletions
17
test/fixedbugs/bug480.dir/a.go
Normal file
17
test/fixedbugs/bug480.dir/a.go
Normal file
|
@ -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
|
||||
}
|
13
test/fixedbugs/bug480.dir/b.go
Normal file
13
test/fixedbugs/bug480.dir/b.go
Normal file
|
@ -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{}
|
||||
}
|
9
test/fixedbugs/bug480.go
Normal file
9
test/fixedbugs/bug480.go
Normal file
|
@ -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
|
18
test/fixedbugs/bug481.go
Normal file
18
test/fixedbugs/bug481.go
Normal file
|
@ -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]
|
||||
}
|
20
test/fixedbugs/bug482.go
Normal file
20
test/fixedbugs/bug482.go
Normal file
|
@ -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
|
14
test/fixedbugs/issue6789.dir/a.go
Normal file
14
test/fixedbugs/issue6789.dir/a.go
Normal file
|
@ -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
|
||||
}
|
12
test/fixedbugs/issue6789.dir/b.go
Normal file
12
test/fixedbugs/issue6789.dir/b.go
Normal file
|
@ -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() {
|
||||
}
|
10
test/fixedbugs/issue6789.go
Normal file
10
test/fixedbugs/issue6789.go
Normal file
|
@ -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
|
Loading…
Reference in a new issue