]> Cypherpunks.ru repositories - gostls13.git/blobdiff - test/blank.go
cmd/compile/internal/inline: score call sites exposed by inlines
[gostls13.git] / test / blank.go
index 7f7d9f6f7fbac6a7c6ad3eec1eb5df661229d82c..0539debb1f25249788954bf0704db109ae1d635b 100644 (file)
@@ -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)