diff options
Diffstat (limited to 'gcc/testsuite/go.test/test/blank.go')
-rw-r--r-- | gcc/testsuite/go.test/test/blank.go | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/gcc/testsuite/go.test/test/blank.go b/gcc/testsuite/go.test/test/blank.go index 7f7d9f6..0539deb 100644 --- a/gcc/testsuite/go.test/test/blank.go +++ b/gcc/testsuite/go.test/test/blank.go @@ -27,6 +27,10 @@ func (T) _() { func (T) _() { } +type U struct { + _ struct{ a, b, c int } +} + const ( c0 = iota _ @@ -107,8 +111,7 @@ func main() { panic(sum) } - // exp/ssa/interp doesn't yet skip blank fields in struct - // equivalence. It also cannot support unsafe.Pointer. + // go.tools/ssa/interp cannot support unsafe.Pointer. if os.Getenv("GOSSAINTERP") == "" { type T1 struct{ x, y, z int } t1 := *(*T)(unsafe.Pointer(&T1{1, 2, 3})) @@ -116,6 +119,13 @@ func main() { if t1 != t2 { panic("T{} != T{}") } + + var u1, u2 interface{} + u1 = *(*U)(unsafe.Pointer(&T1{1, 2, 3})) + u2 = *(*U)(unsafe.Pointer(&T1{4, 5, 6})) + if u1 != u2 { + panic("U{} != U{}") + } } h(a, b) |