Mercurial > projects > ldc
comparison tests/mini/nested10.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/nested10.d@25fa34e899e9 |
children |
comparison
equal
deleted
inserted
replaced
340:351c0077d0b3 | 341:1bb99290e03a |
---|---|
1 module nested10; | |
2 | |
3 extern(C) int printf(char*, ...); | |
4 | |
5 void main() | |
6 { | |
7 int j = 3; | |
8 void F() | |
9 { | |
10 int i = j; | |
11 printf("F: i = %d, j = %d\n", i, j); | |
12 void G() | |
13 { | |
14 printf("G: i = %d, j = %d\n", i, j); | |
15 j += i; | |
16 } | |
17 G(); | |
18 } | |
19 F(); | |
20 printf("6 = %d\n", j); | |
21 assert(j == 6); | |
22 } |