Merge pull request #5714 from alexischr/update_bockbuild
[mono.git] / mcs / tests / gtest-352.cs
1 // Compiler options: -o+
2
3 using System;
4 using System.Reflection;
5
6 struct D
7 {
8         public static D d1 = new D (1);
9         public int d2;
10
11         public D (int v)
12         {
13                 d2 = 0;
14         }
15 }
16
17 class T
18 {
19         public static int Main ()
20         {
21                 ConstructorInfo mi = typeof(D).GetConstructors (BindingFlags.Instance | BindingFlags.Public)[0];
22         MethodBody mb = mi.GetMethodBody();
23                 
24                 Console.WriteLine (mb.GetILAsByteArray ().Length);
25                 if (mb.GetILAsByteArray ().Length != 8) {
26                         return 1;
27                 }
28
29                 mi = typeof (D).GetConstructors (BindingFlags.Static | BindingFlags.NonPublic) [0];
30                 mb = mi.GetMethodBody ();
31
32                 Console.WriteLine (mb.GetILAsByteArray ().Length);
33                 if (mb.GetILAsByteArray ().Length != 12) {
34                         return 2;
35                 }
36                         
37                 Console.WriteLine ("OK");
38                 return 0;
39         }
40 }