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

40
mcs/tests/gtest-352.cs Normal file
View File

@@ -0,0 +1,40 @@
// Compiler options: -o+
using System;
using System.Reflection;
struct D
{
public static D d1 = new D (1);
public int d2;
public D (int v)
{
d2 = 0;
}
}
class T
{
public static int Main ()
{
ConstructorInfo mi = typeof(D).GetConstructors (BindingFlags.Instance | BindingFlags.Public)[0];
MethodBody mb = mi.GetMethodBody();
Console.WriteLine (mb.GetILAsByteArray ().Length);
if (mb.GetILAsByteArray ().Length != 8) {
return 1;
}
mi = typeof (D).GetConstructors (BindingFlags.Static | BindingFlags.NonPublic) [0];
mb = mi.GetMethodBody ();
Console.WriteLine (mb.GetILAsByteArray ().Length);
if (mb.GetILAsByteArray ().Length != 12) {
return 2;
}
Console.WriteLine ("OK");
return 0;
}
}