2010-05-19 Jb Evain <jbevain@novell.com>
[mcs.git] / tests / gtest-305.cs
blobb9f5cc62b0d6737f9091709570740a7f74705612
1 // No array static/dynamic initializers should be produced in this test
3 using System;
4 using System.Reflection;
6 class T
8 const byte c = 0;
9 const string s = null;
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) };
17 public static int Main ()
19 ConstructorInfo mi = typeof(T).GetConstructors ()[0];
20 MethodBody mb = mi.GetMethodBody();
22 if (mb.GetILAsByteArray ().Length > 90) {
23 Console.WriteLine("Optimization failed");
24 return 3;
27 return 0;