diff options
author | ian <ian@138bc75d-0d04-0410-961f-82ee72b054a4> | 2011-12-08 23:27:33 +0000 |
---|---|---|
committer | ian <ian@138bc75d-0d04-0410-961f-82ee72b054a4> | 2011-12-08 23:27:33 +0000 |
commit | 07daa4e7f7f8600c19e4d3cecd04f5b37c63e704 (patch) | |
tree | 2de9d0efcb376d34885e8e97b873e5013b7bb9c6 /gcc/testsuite/go.test/test | |
parent | ab98db53d3e6829e061f862d9bcb9d695112f8ca (diff) | |
download | gcc-07daa4e7f7f8600c19e4d3cecd04f5b37c63e704.tar.gz |
compiler: Don't check for hidden fields on struct assignments.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@182143 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/testsuite/go.test/test')
-rw-r--r-- | gcc/testsuite/go.test/test/assign.go | 22 | ||||
-rw-r--r-- | gcc/testsuite/go.test/test/fixedbugs/bug226.dir/x.go | 9 | ||||
-rw-r--r-- | gcc/testsuite/go.test/test/fixedbugs/bug226.dir/y.go | 31 | ||||
-rw-r--r-- | gcc/testsuite/go.test/test/fixedbugs/bug226.go | 7 | ||||
-rw-r--r-- | gcc/testsuite/go.test/test/fixedbugs/bug310.go | 20 | ||||
-rw-r--r-- | gcc/testsuite/go.test/test/fixedbugs/bug359.go | 26 |
6 files changed, 11 insertions, 104 deletions
diff --git a/gcc/testsuite/go.test/test/assign.go b/gcc/testsuite/go.test/test/assign.go index 59471388c06..2192f9ede08 100644 --- a/gcc/testsuite/go.test/test/assign.go +++ b/gcc/testsuite/go.test/test/assign.go @@ -16,38 +16,38 @@ type T struct { func main() { { var x, y sync.Mutex - x = y // ERROR "assignment.*Mutex" + x = y // ok _ = x } { var x, y T - x = y // ERROR "assignment.*Mutex" + x = y // ok _ = x } { var x, y [2]sync.Mutex - x = y // ERROR "assignment.*Mutex" + x = y // ok _ = x } { var x, y [2]T - x = y // ERROR "assignment.*Mutex" + x = y // ok _ = x } { - x := sync.Mutex{0, 0} // ERROR "assignment.*Mutex" + x := sync.Mutex{0, 0} // ERROR "assignment.*Mutex" _ = x } { - x := sync.Mutex{key: 0} // ERROR "(unknown|assignment).*Mutex" + x := sync.Mutex{key: 0} // ERROR "(unknown|assignment).*Mutex" _ = x } { - x := &sync.Mutex{} // ok - var y sync.Mutex // ok - y = *x // ERROR "assignment.*Mutex" - *x = y // ERROR "assignment.*Mutex" + x := &sync.Mutex{} // ok + var y sync.Mutex // ok + y = *x // ok + *x = y // ok _ = x _ = y - } + } } diff --git a/gcc/testsuite/go.test/test/fixedbugs/bug226.dir/x.go b/gcc/testsuite/go.test/test/fixedbugs/bug226.dir/x.go deleted file mode 100644 index 64d7a29e7e1..00000000000 --- a/gcc/testsuite/go.test/test/fixedbugs/bug226.dir/x.go +++ /dev/null @@ -1,9 +0,0 @@ -// Copyright 2009 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 x - -type T struct { x, Y int } - -func (t T) M() diff --git a/gcc/testsuite/go.test/test/fixedbugs/bug226.dir/y.go b/gcc/testsuite/go.test/test/fixedbugs/bug226.dir/y.go deleted file mode 100644 index c66d592b7c0..00000000000 --- a/gcc/testsuite/go.test/test/fixedbugs/bug226.dir/y.go +++ /dev/null @@ -1,31 +0,0 @@ -// Copyright 2009 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 y - -import "./x" - -func f() { - ok := new(x.T); - var ok1 x.T; - ok2 := &ok1; - ok3 := &x.T{}; - ok4 := &x.T{Y:2}; - _ = x.T{}; - _ = x.T{Y:2}; - - ok1.M(); - bad1 := *ok; // ERROR "assignment.*T" - bad2 := ok1; // ERROR "assignment.*T" - *ok4 = ok1; // ERROR "assignment.*T" - *ok4 = *ok2; // ERROR "assignment.*T" - ok1 = *ok4; // ERROR "assignment.*T" - _ = bad1; - _ = bad2; - _ = ok4; - _ = ok3; - _ = ok2; - _ = ok1; - _ = ok; -} diff --git a/gcc/testsuite/go.test/test/fixedbugs/bug226.go b/gcc/testsuite/go.test/test/fixedbugs/bug226.go deleted file mode 100644 index 5457a64bc11..00000000000 --- a/gcc/testsuite/go.test/test/fixedbugs/bug226.go +++ /dev/null @@ -1,7 +0,0 @@ -// $G $D/$F.dir/x.go && errchk $G $D/$F.dir/y.go - -// Copyright 2009 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. - -ignored diff --git a/gcc/testsuite/go.test/test/fixedbugs/bug310.go b/gcc/testsuite/go.test/test/fixedbugs/bug310.go deleted file mode 100644 index 191f3ed2b4e..00000000000 --- a/gcc/testsuite/go.test/test/fixedbugs/bug310.go +++ /dev/null @@ -1,20 +0,0 @@ -// errchk $G $D/$F.go - -// Copyright 2010 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 p - -import ( - "bytes" - "fmt" -) - -type t int - -func main() { - _ = t.bar // ERROR "no method" - var b bytes.Buffer - fmt.Print(b) // ERROR "implicit assignment" -} diff --git a/gcc/testsuite/go.test/test/fixedbugs/bug359.go b/gcc/testsuite/go.test/test/fixedbugs/bug359.go deleted file mode 100644 index 3701499ed20..00000000000 --- a/gcc/testsuite/go.test/test/fixedbugs/bug359.go +++ /dev/null @@ -1,26 +0,0 @@ -// errchk $G $D/$F.go - -// 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. - -// issue 1910 -// error on wrong line - -package main - -import "container/list" - -type Painting struct { - fragments list.List // private -} - -func (p Painting) Foo() { - for e := p.fragments; e.Front() != nil; { // ERROR "unexported field|hidden field" - } -} - -// from comment 4 of issue 1910 -type Foo interface { - Run(a int) (a int) // ERROR "a redeclared|redefinition|previous" -} |