annotate run/struct_initialization_06.d @ 1086:7e8e5013a030

gdc-0.19 review
author thomask
date Tue, 18 Jul 2006 22:51:49 +0000
parents 86e4b19bc26b
children 660f9196b52a
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
307
86e4b19bc26b array init
thomask
parents:
diff changeset
1 // $HeadURL$
86e4b19bc26b array init
thomask
parents:
diff changeset
2 // $Date$
86e4b19bc26b array init
thomask
parents:
diff changeset
3 // $Author$
86e4b19bc26b array init
thomask
parents:
diff changeset
4
86e4b19bc26b array init
thomask
parents:
diff changeset
5 // @author@ Andrew Fedoniouk <news@terrainformatica.com>
86e4b19bc26b array init
thomask
parents:
diff changeset
6 // @date@ 2005-03-10
86e4b19bc26b array init
thomask
parents:
diff changeset
7 // @uri@ news:d0otkq$1fsg$1@digitaldaemon.com
86e4b19bc26b array init
thomask
parents:
diff changeset
8 // @url@ nntp://news.digitalmars.com/digitalmars.D.bugs/3137
86e4b19bc26b array init
thomask
parents:
diff changeset
9
86e4b19bc26b array init
thomask
parents:
diff changeset
10 module dstress.run.struct_initialization_06;
86e4b19bc26b array init
thomask
parents:
diff changeset
11
86e4b19bc26b array init
thomask
parents:
diff changeset
12 struct A {
86e4b19bc26b array init
thomask
parents:
diff changeset
13 int one;
86e4b19bc26b array init
thomask
parents:
diff changeset
14 int two[4];
86e4b19bc26b array init
thomask
parents:
diff changeset
15 }
86e4b19bc26b array init
thomask
parents:
diff changeset
16
86e4b19bc26b array init
thomask
parents:
diff changeset
17 A a = { one:1, two:2 };
86e4b19bc26b array init
thomask
parents:
diff changeset
18
86e4b19bc26b array init
thomask
parents:
diff changeset
19 int main(){
1086
7e8e5013a030 gdc-0.19 review
thomask
parents: 307
diff changeset
20 if(a.one != 1){
7e8e5013a030 gdc-0.19 review
thomask
parents: 307
diff changeset
21 assert(0);
7e8e5013a030 gdc-0.19 review
thomask
parents: 307
diff changeset
22 }
7e8e5013a030 gdc-0.19 review
thomask
parents: 307
diff changeset
23 if(a.two[0] != 2){
7e8e5013a030 gdc-0.19 review
thomask
parents: 307
diff changeset
24 assert(0);
7e8e5013a030 gdc-0.19 review
thomask
parents: 307
diff changeset
25 }
7e8e5013a030 gdc-0.19 review
thomask
parents: 307
diff changeset
26 if(a.two[1] != 2){
7e8e5013a030 gdc-0.19 review
thomask
parents: 307
diff changeset
27 assert(0);
7e8e5013a030 gdc-0.19 review
thomask
parents: 307
diff changeset
28 }
7e8e5013a030 gdc-0.19 review
thomask
parents: 307
diff changeset
29 if(a.two[2] != 2){
7e8e5013a030 gdc-0.19 review
thomask
parents: 307
diff changeset
30 assert(0);
7e8e5013a030 gdc-0.19 review
thomask
parents: 307
diff changeset
31 }
7e8e5013a030 gdc-0.19 review
thomask
parents: 307
diff changeset
32 if(a.two[3] != 2){
7e8e5013a030 gdc-0.19 review
thomask
parents: 307
diff changeset
33 assert(0);
7e8e5013a030 gdc-0.19 review
thomask
parents: 307
diff changeset
34 }
307
86e4b19bc26b array init
thomask
parents:
diff changeset
35 return 0;
86e4b19bc26b array init
thomask
parents:
diff changeset
36 }