[amd64] Make inline function in header static
[mono-project.git] / mcs / tests / test-anon-05.cs
blob632007e70bcd0802e38e40cc78cfab1e755b8246
1 //
2 // Tests capturing of double nested variables
3 //
4 using System;
5 delegate void S ();
7 class X {
8 public static int Main ()
10 int i;
11 S b = null;
13 for (i = 0; i < 10; i++){
14 int j = 0;
15 b = delegate {
16 Console.WriteLine ("i={0} j={1}", i, j);
17 i = i + 1;
18 j = j + 1;
21 Console.WriteLine ("i = {0}", i);
22 b ();
23 Console.WriteLine ("i = {0}", i);
24 if (!t (i, 11))
25 return 1;
26 b ();
27 if (!t (i, 12))
28 return 2;
29 Console.WriteLine ("i = {0}", i);
30 Console.WriteLine ("Test is OK");
31 return 0;
34 static bool t (int a, int b)
36 return a == b;