Mercurial > projects > dstress
comparison run/r/ref_01_A.d @ 1555:01c289574a6d
DMD-1.011: ref
author | thomask |
---|---|
date | Mon, 23 Jul 2007 18:45:40 +0000 |
parents | cf7719e0ef1b |
children |
comparison
equal
deleted
inserted
replaced
1554:d54c617fdab4 | 1555:01c289574a6d |
---|---|
2 // $Date$ | 2 // $Date$ |
3 // $Author$ | 3 // $Author$ |
4 | 4 |
5 module dstress.run.r.ref_01_A; | 5 module dstress.run.r.ref_01_A; |
6 | 6 |
7 void test(ref int i){ | 7 |
8 i++; | 8 void test(ref int x){ |
9 if(3 != x){ | |
10 assert(0); | |
11 } | |
12 x++; | |
9 } | 13 } |
10 | 14 |
11 int main(){ | 15 int main(){ |
12 int i = 2; | 16 int x = 3; |
13 test(i); | 17 test(x); |
14 if(3 != i){ | 18 if(4 != x){ |
15 assert(0); | 19 assert(0); |
16 } | 20 } |
17 | 21 |
18 return 0; | 22 return 0; |
19 } | 23 } |