Imported Upstream version 3.6.0

Former-commit-id: da6be194a6b1221998fc28233f2503bd61dd9d14
This commit is contained in:
Jo Shields
2014-08-13 10:39:27 +01:00
commit a575963da9
50588 changed files with 8155799 additions and 0 deletions

48
mcs/tests/test-anon-57.cs Normal file
View File

@@ -0,0 +1,48 @@
using System;
public class X
{
public delegate void TestDelegate ();
static long sum_i, sum_k;
public static int Test ()
{
TestDelegate d = null;
for (int i = 1; i <= 5; i++) {
int k = i;
TestDelegate temp = delegate {
Console.WriteLine ("i = {0}, k = {1}", i, k);
sum_i += 1 << i;
sum_k += 1 << k;
};
temp ();
d += temp;
}
Console.WriteLine ("SUM i = {0}, k = {1}", sum_i, sum_k);
Console.WriteLine ();
if (sum_i != 62)
return 1;
if (sum_k != 62)
return 2;
sum_i = sum_k = 0;
d();
Console.WriteLine ("SUM i = {0}, k = {1}", sum_i, sum_k);
Console.WriteLine ();
if (sum_i != 320)
return 3;
if (sum_k != 62)
return 4;
return 0;
}
public static int Main ()
{
int result = Test ();
if (result != 0)
Console.WriteLine ("ERROR: {0}", result);
else
Console.WriteLine ("OK");
return result;
}
}