2015-04-14 04:03:21 -06:00
|
|
|
package main
|
|
|
|
|
2015-07-14 17:31:30 -06:00
|
|
|
import (
|
2016-05-03 17:23:24 -06:00
|
|
|
"depBase"
|
2016-10-25 20:57:58 -06:00
|
|
|
"os"
|
|
|
|
"reflect"
|
2015-07-14 17:31:30 -06:00
|
|
|
"runtime"
|
|
|
|
)
|
2015-04-14 04:03:21 -06:00
|
|
|
|
2016-12-08 12:49:23 -07:00
|
|
|
// Having a function declared in the main package triggered
|
|
|
|
// golang.org/issue/18250
|
|
|
|
func DeclaredInMain() {
|
|
|
|
}
|
|
|
|
|
2016-12-11 17:31:56 -07:00
|
|
|
type C struct {
|
|
|
|
}
|
|
|
|
|
|
|
|
func F() *C {
|
|
|
|
return nil
|
|
|
|
}
|
|
|
|
|
2017-01-24 21:19:36 -07:00
|
|
|
var slicePtr interface{} = &[]int{}
|
|
|
|
|
2015-04-14 04:03:21 -06:00
|
|
|
func main() {
|
2016-05-03 17:23:24 -06:00
|
|
|
defer depBase.ImplementedInAsm()
|
2016-10-25 20:57:58 -06:00
|
|
|
// This code below causes various go.itab.* symbols to be generated in
|
|
|
|
// the executable. Similar code in ../depBase/dep.go results in
|
2017-11-02 23:48:43 -06:00
|
|
|
// exercising https://golang.org/issues/17594
|
2016-10-25 20:57:58 -06:00
|
|
|
reflect.TypeOf(os.Stdout).Elem()
|
2015-07-14 17:31:30 -06:00
|
|
|
runtime.GC()
|
2016-05-03 17:23:24 -06:00
|
|
|
depBase.V = depBase.F() + 1
|
2016-12-11 17:31:56 -07:00
|
|
|
|
|
|
|
var c *C
|
|
|
|
if reflect.TypeOf(F).Out(0) != reflect.TypeOf(c) {
|
|
|
|
panic("bad reflection results, see golang.org/issue/18252")
|
|
|
|
}
|
2017-01-24 21:19:36 -07:00
|
|
|
|
|
|
|
sp := reflect.New(reflect.TypeOf(slicePtr).Elem())
|
|
|
|
s := sp.Interface()
|
|
|
|
|
|
|
|
if reflect.TypeOf(s) != reflect.TypeOf(slicePtr) {
|
|
|
|
panic("bad reflection results, see golang.org/issue/18729")
|
|
|
|
}
|
2015-04-14 04:03:21 -06:00
|
|
|
}
|