Mercurial > projects > dstress
comparison run/mini/bug24.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 bug24; | |
2 extern(C) int printf(char*, ...); | |
3 | |
4 struct S | |
5 { | |
6 long l; | |
7 float f; | |
8 } | |
9 | |
10 void main() | |
11 { | |
12 S s = S(3L,2f); | |
13 delegate { | |
14 S t = S(4L, 1f); | |
15 delegate { | |
16 s.l += t.l; | |
17 s.f += t.f; | |
18 }(); | |
19 }(); | |
20 printf("%lu %f\n", s.l, s.f); | |
21 assert(s.l == 7 && s.f == 3); | |
22 } |