Merge pull request #5714 from alexischr/update_bockbuild
[mono.git] / mono / mini / objects.cs
index 005e276fbb18d565934733bc3d15e54b24c5fff2..ef796986cd5419e570167885a1b9220f2b6eace6 100644 (file)
@@ -473,7 +473,6 @@ class Tests {
                return o.GetHashCode ();
        }
 
-       [Category ("!INTERPRETER")]
        public static int test_0_unbox_trampoline2 () {
                int i = 12;
                object o = i;
@@ -623,7 +622,6 @@ class Tests {
                return 0;
        }
 
-       [Category ("!INTERPRETER")]
        public static int test_0_multi_array_cast () {
                Duper[,] d = new Duper [1, 1];
                object[,] o = d;
@@ -641,6 +639,7 @@ class Tests {
        public static int test_0_vector_array_cast () {
                Array arr1 = Array.CreateInstance (typeof (int), new int[] {1}, new int[] {0});
                Array arr2 = Array.CreateInstance (typeof (int), new int[] {1}, new int[] {10});
+               Array arr5 = Array.CreateInstance (typeof (string), new int[] {1}, new int[] {10});
 
                if (arr1.GetType () != typeof (int[]))
                        return 1;
@@ -661,6 +660,9 @@ class Tests {
 
                if (arr2 is int[])
                        return 4;
+               var as_object_arr = arr5 as object [];
+               if (as_object_arr != null)
+                       return 5;
 
                int [,] [] arr3 = new int [1, 1] [];
                object o = arr3;
@@ -919,7 +921,6 @@ class Tests {
                return f ();
        }
 
-       [Category ("!INTERPRETER")]
        public static int test_1_store_decimal () {
                decimal[,] a = {{1}};
 
@@ -1034,6 +1035,19 @@ class Tests {
                return 0;
        }
 
+       static Nullable<bool> s_nullb;
+       static AStruct s_struct1;
+
+       /* test if VES uses correct sizes for value type write to static field */
+       public static int test_0_static_nullable_bool () {
+               s_struct1 = new AStruct (0x1337dead);
+               s_nullb = true;
+               /* make sure that the write to s_nullb didn't smash the value after it */
+               if (s_struct1.i != 0x1337dead)
+                       return 2;
+               return 0;
+       }
+
        public static int test_71_long_shift_right () {
                ulong value = 38654838087;
                int x = 0;
@@ -1438,7 +1452,6 @@ ncells ) {
                return 0;
        }
 
-       [Category ("!INTERPRETER")]
        static int test_0_array_get_set_soft_float () {
                float[,] arr = new float [2, 2];
                arr [0, 0] = 256f;
@@ -1599,7 +1612,6 @@ ncells ) {
                return mInstance;
        }
 
-       [Category ("!INTERPRETER")]
        static int test_0_synchronized () {
                getInstance ();
                return 0;
@@ -1768,7 +1780,6 @@ ncells ) {
                }
        }
 
-       [Category ("!INTERPRETER")]
        public static int test_0_delegate_to_virtual_generic_on_ifaces () {
                IComparer2 c = new AClass ();
 
@@ -1791,7 +1802,6 @@ ncells ) {
 
        enum Mine { One, Two }
 
-       [Category ("!INTERPRETER")]
        public static int test_0_enum_gethashcode_opt () {
                int sum = 0;
         for (int i = 0; i < 1000000; ++i)
@@ -1799,6 +1809,25 @@ ncells ) {
 
         return 0;
     }
+
+       public static int test_0_typedref () {
+               int i = 5;
+               System.TypedReference r = __makeref(i);
+               System.Type t = __reftype(r);
+
+               if (t != typeof (int))
+                       return 1;
+               int j = __refvalue(r, int);
+               if (j != 5)
+                       return 2;
+
+               try {
+                       object o = __refvalue (r, object);
+               } catch (InvalidCastException) {
+               }
+
+               return 0;
+       }
 }
 
 #if __MOBILE__