summaryrefslogtreecommitdiff
path: root/test/bugs
diff options
context:
space:
mode:
authorLuuk van Dijk <lvd@golang.org>2012-05-02 16:56:26 +0200
committerLuuk van Dijk <lvd@golang.org>2012-05-02 16:56:26 +0200
commit7aee8270bc1b87bf8a8896780b24ccdfa6a2161e (patch)
treed45d52c5b405f0e39b3e3d1be010d4c335ffc9ee /test/bugs
parentce31a863ce49d7e282e3cc8f3c49bc92d49ebc5d (diff)
downloadgo-7aee8270bc1b87bf8a8896780b24ccdfa6a2161e.tar.gz
cmd/gc: test for issue 3552
R=rsc CC=golang-dev http://codereview.appspot.com/6128051
Diffstat (limited to 'test/bugs')
-rw-r--r--test/bugs/bug434.dir/one.go28
-rw-r--r--test/bugs/bug434.dir/two.go22
-rw-r--r--test/bugs/bug434.go7
3 files changed, 57 insertions, 0 deletions
diff --git a/test/bugs/bug434.dir/one.go b/test/bugs/bug434.dir/one.go
new file mode 100644
index 000000000..491ada1d9
--- /dev/null
+++ b/test/bugs/bug434.dir/one.go
@@ -0,0 +1,28 @@
+// Copyright 2012 The Go Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+package one
+
+// Issue 3552
+
+type T struct { int }
+
+func (t T) F() int { return t.int }
+
+type U struct { int int }
+
+func (u U) F() int { return u.int }
+
+type lint int
+
+type V struct { lint }
+
+func (v V) F() int { return int(v.lint) }
+
+type W struct { lint lint }
+
+func (w W) F() int { return int(w.lint) }
+
+
+
diff --git a/test/bugs/bug434.dir/two.go b/test/bugs/bug434.dir/two.go
new file mode 100644
index 000000000..1366d244d
--- /dev/null
+++ b/test/bugs/bug434.dir/two.go
@@ -0,0 +1,22 @@
+// Copyright 2012 The Go Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+// Use the functions in one.go so that the inlined
+// forms get type-checked.
+
+package two
+
+import "./one"
+
+func use() {
+ var t one.T
+ var u one.U
+ var v one.V
+ var w one.W
+
+ _ = t.F()
+ _ = u.F()
+ _ = v.F()
+ _ = w.F()
+}
diff --git a/test/bugs/bug434.go b/test/bugs/bug434.go
new file mode 100644
index 000000000..65047fd4a
--- /dev/null
+++ b/test/bugs/bug434.go
@@ -0,0 +1,7 @@
+// $G $D/$F.dir/one.go && $G $D/$F.dir/two.go || echo BUG:bug434
+
+// Copyright 2011 The Go Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+package ignored