(DISTFILES): Comment out a few missing files.
[mono-project.git] / mcs / tests / 2test-a9.cs
bloba951710c322b76958b588c34dca465fbeffc2672
1 //
2 // Tests capturing of double nested variables
3 //
4 delegate void S ();
5 using System;
7 class X {
8 static int Main ()
10 int i;
11 int a = 0;
12 S b = null;
14 for (i = 0; i < 10; i++){
15 int j = 0;
16 b = delegate {
17 Console.WriteLine ("i={0} j={1}", i, j);
18 i = i + 1;
19 j = j + 1;
20 a = j;
23 b ();
24 Console.WriteLine ("i = {0}", i);
25 if (!t (i, 11))
26 return 1;
27 b ();
28 if (!t (i, 12))
29 return 2;
30 Console.WriteLine ("i = {0}", i);
31 Console.WriteLine ("a = {0}", a);
32 if (!t (a, 2))
33 return 3;
35 return 0;
38 static bool t (int a, int b)
40 return a == b;