OLD | NEW |
1 // $G -S $D/$F.go | egrep initdone >/dev/null && echo FAIL || true | 1 // $G -S $D/$F.go | egrep initdone >/dev/null && echo FAIL || true |
2 | 2 |
3 // Copyright 2010 The Go Authors. All rights reserved. | 3 // Copyright 2010 The Go Authors. All rights reserved. |
4 // Use of this source code is governed by a BSD-style | 4 // Use of this source code is governed by a BSD-style |
5 // license that can be found in the LICENSE file. | 5 // license that can be found in the LICENSE file. |
6 | 6 |
7 package p | 7 package p |
8 | 8 |
9 // Should be no init func in the assembly. | 9 // Should be no init func in the assembly. |
10 // All these initializations should be done at link time. | 10 // All these initializations should be done at link time. |
11 | 11 |
12 type» S» struct{ a,b,c int }; | 12 type» S» struct{ a,b,c int } |
13 type» SS» struct{ aa,bb,cc S }; | 13 type» SS» struct{ aa,bb,cc S } |
14 type» SA» struct{ a,b,c [3]int }; | 14 type» SA» struct{ a,b,c [3]int } |
15 type» SC» struct{ a,b,c []int }; | 15 type» SC» struct{ a,b,c []int } |
16 | 16 |
17 var ( | 17 var ( |
18 zero = 2 | 18 zero = 2 |
19 one = 1 | 19 one = 1 |
20 pi = 3.14 | 20 pi = 3.14 |
21 slice = []byte{1,2,3} | 21 slice = []byte{1,2,3} |
22 sliceInt = []int{1,2,3} | 22 sliceInt = []int{1,2,3} |
23 hello = "hello, world" | 23 hello = "hello, world" |
24 bytes = []byte("hello, world") | 24 bytes = []byte("hello, world") |
25 four, five = 4, 5 | 25 four, five = 4, 5 |
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
91 5107, 5108, 5109, | 91 5107, 5108, 5109, |
92 3003, 3006, 3009, | 92 3003, 3006, 3009, |
93 3203, 3206, 3209, | 93 3203, 3206, 3209, |
94 3303, 3306, 3309, | 94 3303, 3306, 3309, |
95 | 95 |
96 // [2][j] | 96 // [2][j] |
97 2007, 2207, 2307, 4007, 4207, 4307, 5007, 5207, 5307, | 97 2007, 2207, 2307, 4007, 4207, 4307, 5007, 5207, 5307, |
98 2008, 2208, 2308, 4008, 4208, 4308, 5008, 5208, 5308, | 98 2008, 2208, 2308, 4008, 4208, 4308, 5008, 5208, 5308, |
99 2009, 2209, 2309, 4009, 4209, 4309, 5009, 5209, 5309, | 99 2009, 2209, 2309, 4009, 4209, 4309, 5009, 5209, 5309, |
100 } | 100 } |
OLD | NEW |