Merge pull request #5714 from alexischr/update_bockbuild
[mono.git] / mcs / tests / gtest-305.cs
1 // No array static/dynamic initializers should be produced in this test
2
3 using System;
4 using System.Reflection;
5
6 class T
7 {
8         const byte c = 0;
9         const string s = null;
10
11         long [,,] a1 = new long [,,] {{{10,0}, {0,0}}, {{0,0}, {0,c}}}; 
12         byte [] a2 = new byte [] { 2 - 2, 0, c };
13         decimal [] a3 = new decimal [] { 2m - 2m, 0m, c };
14         string[,] a4 = new string[,] { {s, null}, { s, s }};
15         T[] a5 = new T[] { null, default (T) };
16
17         public static int Main ()
18         {
19                 ConstructorInfo mi = typeof(T).GetConstructors ()[0];
20                 MethodBody mb = mi.GetMethodBody();
21                 
22                 if (mb.GetILAsByteArray ().Length > 90) {
23                         Console.WriteLine("Optimization failed");
24                         return 3;
25                 }
26                         
27                 return 0;
28         }
29 }