2010-05-19 Jb Evain <jbevain@novell.com>
[mcs.git] / tests / gtest-499.cs
blob3435c4bee7ff0579e9bbd344e2e850901c00e286
1 using System;
2 using System.Reflection;
4 public class C
6 public static int Test<T> (T[] t)
8 // Has to include readonly. prefix
9 return t[0].GetHashCode ();
12 public static int TestExtra<T> (T[,] t)
14 // Has to include readonly. prefix
15 return t[0, 0].GetHashCode ();
18 public static int Main ()
20 Test (new[] { 2.1, 4.5 });
21 Test (new[] { "b" });
23 var body = typeof (C).GetMethod ("Test").GetMethodBody ();
25 // Check for readonly. (0xFE1E)
26 var array = body.GetILAsByteArray ();
27 if (array[2] != 0xFE)
28 return 1;
30 if (array[3] != 0x1E)
31 return 1;
33 return 0;