[mono/tests] Fix out of tree build.
[mono-project.git] / mcs / tests / gtest-352.cs
blob12af0893809383ef12eb66c773b29da5d572fa7c
1 // Compiler options: -o+
3 using System;
4 using System.Reflection;
6 struct D
8 public static D d1 = new D (1);
9 public int d2;
11 public D (int v)
13 d2 = 0;
17 class T
19 public static int Main ()
21 ConstructorInfo mi = typeof(D).GetConstructors (BindingFlags.Instance | BindingFlags.Public)[0];
22 MethodBody mb = mi.GetMethodBody();
24 Console.WriteLine (mb.GetILAsByteArray ().Length);
25 if (mb.GetILAsByteArray ().Length != 8) {
26 return 1;
29 mi = typeof (D).GetConstructors (BindingFlags.Static | BindingFlags.NonPublic) [0];
30 mb = mi.GetMethodBody ();
32 Console.WriteLine (mb.GetILAsByteArray ().Length);
33 if (mb.GetILAsByteArray ().Length != 12) {
34 return 2;
37 Console.WriteLine ("OK");
38 return 0;