comparison run/mini/nested8.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 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 }