mirror of
https://github.com/golang/go
synced 2024-11-25 05:38:01 -07:00
Fix for gccgo, which uses a package prefix.
R=rsc CC=golang-dev https://golang.org/cl/198046
This commit is contained in:
parent
001d9917f4
commit
9a65381b77
@ -37,11 +37,11 @@ func main() {
|
|||||||
// check that reflect paths are correct,
|
// check that reflect paths are correct,
|
||||||
// meaning that reflect data for v0, v1 didn't get confused.
|
// meaning that reflect data for v0, v1 didn't get confused.
|
||||||
|
|
||||||
// path is full (rooted) path name. check suffix only.
|
// path is full (rooted) path name. check suffix for gc, prefix for gccgo
|
||||||
if s := reflect.Typeof(v0).PkgPath(); !strings.HasSuffix(s, "/bug0") {
|
if s := reflect.Typeof(v0).PkgPath(); !strings.HasSuffix(s, "/bug0") && !strings.HasPrefix(s, "bug0") {
|
||||||
panicln("bad v0 path", len(s), s)
|
panicln("bad v0 path", len(s), s)
|
||||||
}
|
}
|
||||||
if s := reflect.Typeof(v1).PkgPath(); !strings.HasSuffix(s, "/bug1") {
|
if s := reflect.Typeof(v1).PkgPath(); !strings.HasSuffix(s, "/bug1") && !strings.HasPrefix(s, "bug1") {
|
||||||
panicln("bad v1 path", s)
|
panicln("bad v1 path", s)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user