Mercurial > projects > dstress
comparison run/mini/bug50.d @ 1628:c6ef09dfba4d
add mini test set from ldc project
author | Moritz Warning <moritzwarning@web.de> |
---|---|
date | Mon, 10 Jan 2011 19:47:18 +0100 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
1627:e1b954780837 | 1628:c6ef09dfba4d |
---|---|
1 module bug50; | |
2 extern(C) int printf(char*, ...); | |
3 | |
4 struct S | |
5 { | |
6 int i; | |
7 float f; | |
8 long l; | |
9 | |
10 void print() | |
11 { | |
12 printf("%d %f %lx\n", i, f, l); | |
13 } | |
14 } | |
15 | |
16 void main() | |
17 { | |
18 S s; | |
19 s.print(); | |
20 s = S(1,2,3); | |
21 s.print(); | |
22 | |
23 S[] arr; | |
24 {arr ~= s;} | |
25 {arr[0].print();} | |
26 {arr ~= S(1,2,3);} | |
27 {arr[1].print();} | |
28 } |