Mercurial > projects > ldc
comparison tests/mini/bug50.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/bug50.d@d9d5d59873d8 |
children | 44f08170f4ef |
comparison
equal
deleted
inserted
replaced
340:351c0077d0b3 | 341:1bb99290e03a |
---|---|
1 module bug50; | |
2 extern(C) int printf(char*, ...); | |
3 | |
4 pragma(LLVM_internal, "notypeinfo") | |
5 struct S | |
6 { | |
7 int i; | |
8 float f; | |
9 long l; | |
10 | |
11 void print() | |
12 { | |
13 printf("%d %f %lx\n", i, f, l); | |
14 } | |
15 } | |
16 | |
17 void main() | |
18 { | |
19 S s; | |
20 s.print(); | |
21 s = S(1,2,3); | |
22 s.print(); | |
23 | |
24 S[] arr; | |
25 {arr ~= s;} | |
26 {arr[0].print();} | |
27 {arr ~= S(1,2,3);} | |
28 {arr[1].print();} | |
29 } |