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