Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mono/mono.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarek Safar <marek.safar@gmail.com>2010-04-29 14:45:23 +0400
committerMarek Safar <marek.safar@gmail.com>2010-04-29 14:45:23 +0400
commitf2e8a0187ba1eb5f717b1c2b419b834e4e973ad0 (patch)
tree5fbfd845e3858d42fe04f2f494e6b1137888eed1 /mcs/tests/gtest-499.cs
parent5c1a938cec0bf91e0248de8c383d37b91621099c (diff)
New tests.
svn path=/trunk/mcs/; revision=156410
Diffstat (limited to 'mcs/tests/gtest-499.cs')
-rw-r--r--mcs/tests/gtest-499.cs35
1 files changed, 35 insertions, 0 deletions
diff --git a/mcs/tests/gtest-499.cs b/mcs/tests/gtest-499.cs
new file mode 100644
index 00000000000..3435c4bee7f
--- /dev/null
+++ b/mcs/tests/gtest-499.cs
@@ -0,0 +1,35 @@
+using System;
+using System.Reflection;
+
+public class C
+{
+ public static int Test<T> (T[] t)
+ {
+ // Has to include readonly. prefix
+ return t[0].GetHashCode ();
+ }
+
+ public static int TestExtra<T> (T[,] t)
+ {
+ // Has to include readonly. prefix
+ return t[0, 0].GetHashCode ();
+ }
+
+ public static int Main ()
+ {
+ Test (new[] { 2.1, 4.5 });
+ Test (new[] { "b" });
+
+ var body = typeof (C).GetMethod ("Test").GetMethodBody ();
+
+ // Check for readonly. (0xFE1E)
+ var array = body.GetILAsByteArray ();
+ if (array[2] != 0xFE)
+ return 1;
+
+ if (array[3] != 0x1E)
+ return 1;
+
+ return 0;
+ }
+}