Author: zoltan
Date: 2005-12-09 08:17:53 -0500 (Fri, 09 Dec 2005)
New Revision: 54163

Modified:
   trunk/mono/mono/mini/ChangeLog
   trunk/mono/mono/mini/objects.cs
Log:
2005-12-09  Zoltan Varga  <[EMAIL PROTECTED]>

        * objects.cs: Add tests for JIT intrinsic.


Modified: trunk/mono/mono/mini/ChangeLog
===================================================================
--- trunk/mono/mono/mini/ChangeLog      2005-12-09 13:16:11 UTC (rev 54162)
+++ trunk/mono/mono/mini/ChangeLog      2005-12-09 13:17:53 UTC (rev 54163)
@@ -1,5 +1,7 @@
 2005-12-09  Zoltan Varga  <[EMAIL PROTECTED]>
 
+       * objects.cs: Add tests for JIT intrinsic.
+
        * mini.c (mini_get_inst_for_method): Resurrect the array Rank/Length
        optimizations lost by a mistake.
 

Modified: trunk/mono/mono/mini/objects.cs
===================================================================
--- trunk/mono/mono/mini/objects.cs     2005-12-09 13:16:11 UTC (rev 54162)
+++ trunk/mono/mono/mini/objects.cs     2005-12-09 13:17:53 UTC (rev 54163)
@@ -1,6 +1,7 @@
 using System;
 using System.Reflection;
 using System.Runtime.InteropServices;
+using System.Runtime.CompilerServices;
 
 /*
  * Regression tests for the mono JIT.
@@ -941,5 +942,57 @@
                }
                return 0;
        }
+
+       static int test_0_intrins_string_length () {
+               string s = "ABC";
+
+               return (s.Length == 3) ? 0 : 1;
+       }
+
+       static int test_0_intrins_string_chars () {
+               string s = "ABC";
+
+               return (s [0] == 'A' && s [1] == 'B' && s [2] == 'C') ? 0 : 1;
+       }
+
+       static int test_0_intrins_object_gettype () {
+               object o = 1;
+
+               return (o.GetType () == typeof (int)) ? 0 : 1;
+       }
+
+       static int test_0_intrins_object_gethashcode () {
+               object o = new Object ();
+
+               return (o.GetHashCode () == o.GetHashCode ()) ? 0 : 1;
+       }
+
+       class FooClass {
+       }
+
+       static int test_0_intrins_object_ctor () {
+               object o = new FooClass ();
+
+               return (o != null) ? 0 : 1;
+       }
+
+       static int test_0_intrins_array_rank () {
+               int[,] a = new int [10, 10];
+
+               return (a.Rank == 2) ? 0 : 1;
+       }
+
+       static int test_0_intrins_array_length () {
+               int[,] a = new int [10, 10];
+               Array a2 = a;
+
+               return (a2.Length == 100) ? 0 : 1;
+       }
+
+       static int test_0_intrins_runtimehelpers_offset_to_string_data () {
+               int i = RuntimeHelpers.OffsetToStringData;
+               
+               return i - i;
+       }
 }
 

_______________________________________________
Mono-patches maillist  -  [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches

Reply via email to