Commit 9bea6f3b authored by Ian Lance Taylor's avatar Ian Lance Taylor

test: add some test cases that were miscompiled by gccgo

R=golang-dev, r
CC=golang-dev
https://golang.org/cl/40310043
parent 4321beba
// 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
}
// 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{}
}
// 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
// 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]
}
// 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
// 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
}
// 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() {
}
// 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
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