OSDN Git Service

c66d592b7c01166418656a060180705c9620c02a
[pf3gnuchains/gcc-fork.git] / gcc / testsuite / go.test / test / fixedbugs / bug226.dir / y.go
1 // Copyright 2009 The Go Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style
3 // license that can be found in the LICENSE file.
4
5 package y
6
7 import "./x"
8
9 func f() {
10         ok := new(x.T);
11         var ok1 x.T;
12         ok2 := &ok1;
13         ok3 := &x.T{};
14         ok4 := &x.T{Y:2};
15         _ = x.T{};
16         _ = x.T{Y:2};
17         
18         ok1.M();
19         bad1 := *ok;    // ERROR "assignment.*T"
20         bad2 := ok1;    // ERROR "assignment.*T"
21         *ok4 = ok1;     // ERROR "assignment.*T"
22         *ok4 = *ok2;    // ERROR "assignment.*T"
23         ok1 = *ok4;     // ERROR "assignment.*T"
24         _ = bad1;
25         _ = bad2;
26         _ = ok4;
27         _ = ok3;
28         _ = ok2;
29         _ = ok1;
30         _ = ok;
31 }