| // $G $D/$F.go && $L $F.$A && ./$A.out |
| // 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. |
| type x2 struct { a,b,c int; d int; }; |
| var g2 struct { a,b,c int; d x2; }; |
| var s2 *struct { a,b,c int; d x2; }; |
| var s3 struct { a,b,c int; d x2; }; |
| if(s1.c != 3) { panic s1.c; } |
| if(g1.c != 3) { panic g1.c; } |
| if(s2.d.c != 23) { panic s2.d.c; } |
| if(g2.d.c != 23) { panic g2.d.c; } |
| if(x != 130) { panic x; } |
| // test an automatic struct |
| if(s3.d.c != 23) { panic s3.d.c; } |
| if(x != 119) { panic x; } |