summaryrefslogtreecommitdiff
path: root/test/blank.go
diff options
context:
space:
mode:
Diffstat (limited to 'test/blank.go')
-rw-r--r--test/blank.go26
1 files changed, 20 insertions, 6 deletions
diff --git a/test/blank.go b/test/blank.go
index 961ed153b..7f7d9f6f7 100644
--- a/test/blank.go
+++ b/test/blank.go
@@ -8,6 +8,11 @@
package main
+import (
+ "os"
+ "unsafe"
+)
+
import _ "fmt"
var call string
@@ -102,8 +107,19 @@ func main() {
panic(sum)
}
+ // exp/ssa/interp doesn't yet skip blank fields in struct
+ // equivalence. It also cannot support unsafe.Pointer.
+ if os.Getenv("GOSSAINTERP") == "" {
+ type T1 struct{ x, y, z int }
+ t1 := *(*T)(unsafe.Pointer(&T1{1, 2, 3}))
+ t2 := *(*T)(unsafe.Pointer(&T1{4, 5, 6}))
+ if t1 != t2 {
+ panic("T{} != T{}")
+ }
+ }
+
h(a, b)
-
+
m()
}
@@ -113,7 +129,7 @@ type I interface {
type TI struct{}
-func (TI) M(x int, y int) {
+func (_ TI) M(x int, y int) {
if x != y {
println("invalid M call:", x, y)
panic("bad M")
@@ -133,14 +149,13 @@ func fp1(x, y int) {
}
}
-
func m() {
var i I
-
+
i = TI{}
i.M(1, 1)
i.M(2, 2)
-
+
fp(1, 1)
fp(2, 2)
}
@@ -162,4 +177,3 @@ func _() {
func ff() {
var _ int = 1
}
-