Mercurial > projects > ldc
annotate test/classes5.d @ 31:2841234d2aea trunk
[svn r35] * Attributes on struct fields/methods now work
* Updated object.d to 1.021
* Added -novalidate command line option. this is sometimes useful when debugging as it may let you read the .ll even if it's invalid.
author | lindquist |
---|---|
date | Thu, 04 Oct 2007 16:44:07 +0200 |
parents | 5e69b77a5c51 |
children | d9d5d59873d8 |
rev | line source |
---|---|
6 | 1 module classes5; |
2 | |
3 struct S | |
4 { | |
5 long l; | |
6 } | |
7 | |
8 class C | |
9 { | |
10 C c; | |
11 S s; | |
12 } | |
13 | |
14 void main() | |
15 { | |
8
5e69b77a5c51
[svn r12] fixed accessing aggregate fields of aggregates
lindquist
parents:
6
diff
changeset
|
16 C c = new C; |
5e69b77a5c51
[svn r12] fixed accessing aggregate fields of aggregates
lindquist
parents:
6
diff
changeset
|
17 long* lp = void; |
5e69b77a5c51
[svn r12] fixed accessing aggregate fields of aggregates
lindquist
parents:
6
diff
changeset
|
18 {c.s.l = 64;} |
5e69b77a5c51
[svn r12] fixed accessing aggregate fields of aggregates
lindquist
parents:
6
diff
changeset
|
19 {assert(c.s.l == 64);} |
5e69b77a5c51
[svn r12] fixed accessing aggregate fields of aggregates
lindquist
parents:
6
diff
changeset
|
20 {lp = &c.s.l;} |
5e69b77a5c51
[svn r12] fixed accessing aggregate fields of aggregates
lindquist
parents:
6
diff
changeset
|
21 {assert(*lp == 64);} |
5e69b77a5c51
[svn r12] fixed accessing aggregate fields of aggregates
lindquist
parents:
6
diff
changeset
|
22 printf("classes5 success\n"); |
6 | 23 } |