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

54
mcs/tests/test-anon-96.cs Normal file
View File

@@ -0,0 +1,54 @@
using System;
class P
{
public int A;
}
static class Program
{
static int Extra () { return 36; }
delegate int D ();
static D Get (int dummy)
{
var p = new P { A = 6 };
switch (dummy) {
case 0:
int extra = Extra ();
return () => p.A + extra;
case 1:
extra = 9;
return () => p.A * extra;
case 2:
return () => p.A * 2;
}
throw new NotSupportedException ();
}
static int Run (int i)
{
return Get (i) ();
}
public static int Main ()
{
if (Run (0) != 42)
return 1;
if (Run (1) != 54)
return 2;
if (Run (2) != 12)
return 3;
if (Run (1) != 54)
return 4;
if (Run (0) != 42)
return 5;
return 0;
}
}