annotate test/structs3.d @ 108:288fe1029e1f trunk

[svn r112] Fixed 'case 1,2,3:' style case statements. Fixed a bunch of bugs with return/break/continue in loops. Fixed support for the DMDFE hidden implicit return value variable. This can be needed for some foreach statements where the loop body is converted to a nested delegate, but also possibly returns from the function. Added std.math to phobos. Added AA runtime support code, done ground work for implementing AAs. Several other bugfixes.
author lindquist
date Tue, 20 Nov 2007 05:29:20 +0100
parents 5e69b77a5c51
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
7
7a155ba88c53 [svn r11] added another struct sample
lindquist
parents:
diff changeset
1 module structs3;
7a155ba88c53 [svn r11] added another struct sample
lindquist
parents:
diff changeset
2
7a155ba88c53 [svn r11] added another struct sample
lindquist
parents:
diff changeset
3 struct S
7a155ba88c53 [svn r11] added another struct sample
lindquist
parents:
diff changeset
4 {
7a155ba88c53 [svn r11] added another struct sample
lindquist
parents:
diff changeset
5 char c;
8
5e69b77a5c51 [svn r12] fixed accessing aggregate fields of aggregates
lindquist
parents: 7
diff changeset
6 float f;
7
7a155ba88c53 [svn r11] added another struct sample
lindquist
parents:
diff changeset
7 }
7a155ba88c53 [svn r11] added another struct sample
lindquist
parents:
diff changeset
8
7a155ba88c53 [svn r11] added another struct sample
lindquist
parents:
diff changeset
9 struct T
7a155ba88c53 [svn r11] added another struct sample
lindquist
parents:
diff changeset
10 {
7a155ba88c53 [svn r11] added another struct sample
lindquist
parents:
diff changeset
11 S s;
7a155ba88c53 [svn r11] added another struct sample
lindquist
parents:
diff changeset
12 long l;
7a155ba88c53 [svn r11] added another struct sample
lindquist
parents:
diff changeset
13 }
7a155ba88c53 [svn r11] added another struct sample
lindquist
parents:
diff changeset
14
7a155ba88c53 [svn r11] added another struct sample
lindquist
parents:
diff changeset
15 void main()
7a155ba88c53 [svn r11] added another struct sample
lindquist
parents:
diff changeset
16 {
8
5e69b77a5c51 [svn r12] fixed accessing aggregate fields of aggregates
lindquist
parents: 7
diff changeset
17 T t;
5e69b77a5c51 [svn r12] fixed accessing aggregate fields of aggregates
lindquist
parents: 7
diff changeset
18 float f = void;
5e69b77a5c51 [svn r12] fixed accessing aggregate fields of aggregates
lindquist
parents: 7
diff changeset
19 float* fp = void;
5e69b77a5c51 [svn r12] fixed accessing aggregate fields of aggregates
lindquist
parents: 7
diff changeset
20 {f = t.s.f;}
5e69b77a5c51 [svn r12] fixed accessing aggregate fields of aggregates
lindquist
parents: 7
diff changeset
21 {t.s.f = 0.0;}
5e69b77a5c51 [svn r12] fixed accessing aggregate fields of aggregates
lindquist
parents: 7
diff changeset
22 {fp = &t.s.f;}
5e69b77a5c51 [svn r12] fixed accessing aggregate fields of aggregates
lindquist
parents: 7
diff changeset
23 {*fp = 1.0;}
5e69b77a5c51 [svn r12] fixed accessing aggregate fields of aggregates
lindquist
parents: 7
diff changeset
24 {assert(t.s.f == 1.0);}
5e69b77a5c51 [svn r12] fixed accessing aggregate fields of aggregates
lindquist
parents: 7
diff changeset
25 {assert(*(&t.s.f) == 1.0);}
5e69b77a5c51 [svn r12] fixed accessing aggregate fields of aggregates
lindquist
parents: 7
diff changeset
26 {t.s.c = 'a';}
5e69b77a5c51 [svn r12] fixed accessing aggregate fields of aggregates
lindquist
parents: 7
diff changeset
27 {assert(t.s.c == 'a');}
5e69b77a5c51 [svn r12] fixed accessing aggregate fields of aggregates
lindquist
parents: 7
diff changeset
28 {t.l = 64;}
5e69b77a5c51 [svn r12] fixed accessing aggregate fields of aggregates
lindquist
parents: 7
diff changeset
29 {assert(t.l == 64);}
7
7a155ba88c53 [svn r11] added another struct sample
lindquist
parents:
diff changeset
30 }