Mercurial > projects > ldc
comparison tests/mini/structs3.d @ 341:1bb99290e03a trunk
[svn r362] Started merging the old 'test' dir as well as the newer 'tangotests' dir into 'tests/mini' and 'tests/minicomplex'.
author | lindquist |
---|---|
date | Sun, 13 Jul 2008 02:51:19 +0200 |
parents | test/structs3.d@5e69b77a5c51 |
children |
comparison
equal
deleted
inserted
replaced
340:351c0077d0b3 | 341:1bb99290e03a |
---|---|
1 module structs3; | |
2 | |
3 struct S | |
4 { | |
5 char c; | |
6 float f; | |
7 } | |
8 | |
9 struct T | |
10 { | |
11 S s; | |
12 long l; | |
13 } | |
14 | |
15 void main() | |
16 { | |
17 T t; | |
18 float f = void; | |
19 float* fp = void; | |
20 {f = t.s.f;} | |
21 {t.s.f = 0.0;} | |
22 {fp = &t.s.f;} | |
23 {*fp = 1.0;} | |
24 {assert(t.s.f == 1.0);} | |
25 {assert(*(&t.s.f) == 1.0);} | |
26 {t.s.c = 'a';} | |
27 {assert(t.s.c == 'a');} | |
28 {t.l = 64;} | |
29 {assert(t.l == 64);} | |
30 } |