3
// Copyright 2009 The Go Authors. All rights reserved.
4
// Use of this source code is governed by a BSD-style
5
// license that can be found in the LICENSE file.
7
// Test struct-valued variables (not pointers).
11
type x2 struct { a,b,c int; d int; };
13
var g2 struct { a,b,c int; d x2; };
19
var s2 *struct { a,b,c int; d x2; };
20
var s3 struct { a,b,c int; d x2; };
30
if(s1.c != 3) { panic(s1.c); }
31
if(g1.c != 3) { panic(g1.c); }
41
if(s2.d.c != 23) { panic(s2.d.c); }
42
if(g2.d.c != 23) { panic(g2.d.c); }
57
if(x != 130) { panic(x); }
59
// test an automatic struct
68
if(s3.d.c != 23) { panic(s3.d.c); }
78
if(x != 119) { panic(x); }