aboutsummaryrefslogtreecommitdiff
path: root/test/blank.go
diff options
context:
space:
mode:
authorRémy Oudompheng <oudomphe@phare.normalesup.org>2013-01-18 18:26:43 +0100
committerRémy Oudompheng <oudomphe@phare.normalesup.org>2013-01-18 18:26:43 +0100
commit2ad57b45833cb7db3f5ae501d97b731ef16e8ff6 (patch)
tree9fffa62f6cbfd791f32b49c1e5f0874271244c9d /test/blank.go
parent2ee06a51bed4db90ffa872ed9adef120112561e2 (diff)
downloadgo-2ad57b45833cb7db3f5ae501d97b731ef16e8ff6.tar.gz
go-2ad57b45833cb7db3f5ae501d97b731ef16e8ff6.zip
cmd/gc: don't hash nor compare struct padding or blank fields.
Fixes #4585. R=rsc, golang-dev CC=golang-dev https://golang.org/cl/7142052
Diffstat (limited to 'test/blank.go')
-rw-r--r--test/blank.go17
1 files changed, 12 insertions, 5 deletions
diff --git a/test/blank.go b/test/blank.go
index ee618b1485..ad4d6ebdc6 100644
--- a/test/blank.go
+++ b/test/blank.go
@@ -8,6 +8,8 @@
package main
+import "unsafe"
+
import _ "fmt"
var call string
@@ -102,8 +104,15 @@ func main() {
panic(sum)
}
+ 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()
}
@@ -133,14 +142,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 +170,3 @@ func _() {
func ff() {
var _ int = 1
}
-