Author: zoltan
Date: 2008-01-24 11:39:16 -0500 (Thu, 24 Jan 2008)
New Revision: 93816
Modified:
trunk/mono/mono/mini/ChangeLog
trunk/mono/mono/mini/arrays.cs
trunk/mono/mono/mini/basic-calls.cs
trunk/mono/mono/mini/basic-long.cs
trunk/mono/mono/mini/basic.cs
trunk/mono/mono/mini/exceptions.cs
trunk/mono/mono/mini/objects.cs
Log:
2008-01-24 Zoltan Varga <[EMAIL PROTECTED]>
* *.cs: Add some tests from the linear-ir branch. Move structs tests to
objects.cs.
Modified: trunk/mono/mono/mini/ChangeLog
===================================================================
--- trunk/mono/mono/mini/ChangeLog 2008-01-24 16:31:08 UTC (rev 93815)
+++ trunk/mono/mono/mini/ChangeLog 2008-01-24 16:39:16 UTC (rev 93816)
@@ -1,5 +1,8 @@
2008-01-24 Zoltan Varga <[EMAIL PROTECTED]>
+ * *.cs: Add some tests from the linear-ir branch. Move structs tests to
+ objects.cs.
+
* driver.c (mono_main): Add a --break-at-bb command line argument for
JIT
debugging.
Modified: trunk/mono/mono/mini/arrays.cs
===================================================================
--- trunk/mono/mono/mini/arrays.cs 2008-01-24 16:31:08 UTC (rev 93815)
+++ trunk/mono/mono/mini/arrays.cs 2008-01-24 16:39:16 UTC (rev 93816)
@@ -476,6 +476,15 @@
return y;
}
+
+ public static int test_0_stelem_ref_null_opt () {
+ object[] arr = new Tests [1];
+
+ arr [0] = new Tests ();
+ arr [0] = null;
+
+ return arr [0] == null ? 0 : 1;
+ }
}
Modified: trunk/mono/mono/mini/basic-calls.cs
===================================================================
--- trunk/mono/mono/mini/basic-calls.cs 2008-01-24 16:31:08 UTC (rev 93815)
+++ trunk/mono/mono/mini/basic-calls.cs 2008-01-24 16:39:16 UTC (rev 93816)
@@ -265,112 +265,6 @@
return 0;
}
- // 64-bits, 32-bit aligned
- struct struct1 {
- public int a;
- public int b;
- };
-
- static int check_struct1(struct1 x) {
- if (x.a != 1)
- return 1;
- if (x.b != 2)
- return 2;
- return 0;
- }
-
- static int pass_struct1(int a, int b, struct1 x) {
- if (a != 3)
- return 3;
- if (b != 4)
- return 4;
- return check_struct1(x);
- }
-
- static int pass_struct1(int a, struct1 x) {
- if (a != 3)
- return 3;
- return check_struct1(x);
- }
-
- static int pass_struct1(struct1 x) {
- return check_struct1(x);
- }
-
- static int test_0_struct1_args () {
- int r;
- struct1 x;
-
- x.a = 1;
- x.b = 2;
- if ((r = check_struct1(x)) != 0)
- return r;
- if ((r = pass_struct1(x)) != 0)
- return r + 10;
- if ((r = pass_struct1(3, x)) != 0)
- return r + 20;
- if ((r = pass_struct1(3, 4, x)) != 0)
- return r + 30;
- return 0;
- }
-
- // 64-bits, 64-bit aligned
- struct struct2 {
- public long a;
- };
-
- static int check_struct2(struct2 x) {
- if (x.a != 1)
- return 1;
- return 0;
- }
-
- static int pass_struct2(int a, int b, int c, struct2 x) {
- if (a != 3)
- return 3;
- if (b != 4)
- return 4;
- if (c != 5)
- return 5;
- return check_struct2(x);
- }
-
- static int pass_struct2(int a, int b, struct2 x) {
- if (a != 3)
- return 3;
- if (b != 4)
- return 4;
- return check_struct2(x);
- }
-
- static int pass_struct2(int a, struct2 x) {
- if (a != 3)
- return 3;
- return check_struct2(x);
- }
-
- static int pass_struct2(struct2 x) {
- return check_struct2(x);
- }
-
- static int test_0_struct2_args () {
- int r;
- struct2 x;
-
- x.a = 1;
- if ((r = check_struct2(x)) != 0)
- return r;
- if ((r = pass_struct2(x)) != 0)
- return r + 10;
- if ((r = pass_struct2(3, x)) != 0)
- return r + 20;
- if ((r = pass_struct2(3, 4, x)) != 0)
- return r + 30;
- if ((r = pass_struct2(3, 4, 5, x)) != 0)
- return r + 40;
- return 0;
- }
-
static void doit (double value, out long m) {
m = (long) value;
}
Modified: trunk/mono/mono/mini/basic-long.cs
===================================================================
--- trunk/mono/mono/mini/basic-long.cs 2008-01-24 16:31:08 UTC (rev 93815)
+++ trunk/mono/mono/mini/basic-long.cs 2008-01-24 16:39:16 UTC (rev 93816)
@@ -1035,6 +1035,12 @@
u --;
return (u == 4257145736) ? 0 : 1;
}
+
+ public static int test_0_ulong_regress2 () {
+ int p2 = 31;
+ ulong sum_p = 2897079476 + (ulong) (1 << p2);
+ return (sum_p == 749595828) ? 0 : 1;
+ }
public static int test_0_assemble_long ()
{
Modified: trunk/mono/mono/mini/basic.cs
===================================================================
--- trunk/mono/mono/mini/basic.cs 2008-01-24 16:31:08 UTC (rev 93815)
+++ trunk/mono/mono/mini/basic.cs 2008-01-24 16:39:16 UTC (rev 93816)
@@ -1274,4 +1274,36 @@
return 0;
}
+
+ public static int cmov (int i) {
+ int j = 0;
+
+ if (i > 0)
+ j = 1;
+
+ return j;
+ }
+
+ public static int cmov2 (int i) {
+ int j = 0;
+
+ if (i <= 0)
+ ;
+ else
+ j = 1;
+
+ return j;
+ }
+
+ public static int test_0_branch_to_cmov_opt () {
+ if (cmov (0) != 0)
+ return 1;
+ if (cmov (1) != 1)
+ return 2;
+ if (cmov2 (0) != 0)
+ return 1;
+ if (cmov2 (1) != 1)
+ return 2;
+ return 0;
+ }
}
Modified: trunk/mono/mono/mini/exceptions.cs
===================================================================
--- trunk/mono/mono/mini/exceptions.cs 2008-01-24 16:31:08 UTC (rev 93815)
+++ trunk/mono/mono/mini/exceptions.cs 2008-01-24 16:39:16 UTC (rev 93816)
@@ -1,5 +1,6 @@
using System;
using System.Reflection;
+using System.Runtime.CompilerServices;
/*
* Regression tests for the mono JIT.
@@ -2352,6 +2353,24 @@
return 1;
}
+ public static int throw_only () {
+ throw new Exception ();
+ }
+
+ [MethodImpl(MethodImplOptions.NoInlining)]
+ public static int throw_only2 () {
+ return throw_only ();
+ }
+
+ public static int test_0_inline_throw_only () {
+ try {
+ return throw_only2 ();
+ }
+ catch (Exception ex) {
+ return 0;
+ }
+ }
+
// bug #78633
public static int test_0_throw_to_branch_opt_outer_clause () {
int i = 0;
Modified: trunk/mono/mono/mini/objects.cs
===================================================================
--- trunk/mono/mono/mini/objects.cs 2008-01-24 16:31:08 UTC (rev 93815)
+++ trunk/mono/mono/mini/objects.cs 2008-01-24 16:39:16 UTC (rev 93816)
@@ -273,6 +273,112 @@
return 5;
}
+ // 64-bits, 32-bit aligned
+ struct struct1 {
+ public int a;
+ public int b;
+ };
+
+ static int check_struct1(struct1 x) {
+ if (x.a != 1)
+ return 1;
+ if (x.b != 2)
+ return 2;
+ return 0;
+ }
+
+ static int pass_struct1(int a, int b, struct1 x) {
+ if (a != 3)
+ return 3;
+ if (b != 4)
+ return 4;
+ return check_struct1(x);
+ }
+
+ static int pass_struct1(int a, struct1 x) {
+ if (a != 3)
+ return 3;
+ return check_struct1(x);
+ }
+
+ static int pass_struct1(struct1 x) {
+ return check_struct1(x);
+ }
+
+ static int test_0_struct1_args () {
+ int r;
+ struct1 x;
+
+ x.a = 1;
+ x.b = 2;
+ if ((r = check_struct1(x)) != 0)
+ return r;
+ if ((r = pass_struct1(x)) != 0)
+ return r + 10;
+ if ((r = pass_struct1(3, x)) != 0)
+ return r + 20;
+ if ((r = pass_struct1(3, 4, x)) != 0)
+ return r + 30;
+ return 0;
+ }
+
+ // 64-bits, 64-bit aligned
+ struct struct2 {
+ public long a;
+ };
+
+ static int check_struct2(struct2 x) {
+ if (x.a != 1)
+ return 1;
+ return 0;
+ }
+
+ static int pass_struct2(int a, int b, int c, struct2 x) {
+ if (a != 3)
+ return 3;
+ if (b != 4)
+ return 4;
+ if (c != 5)
+ return 5;
+ return check_struct2(x);
+ }
+
+ static int pass_struct2(int a, int b, struct2 x) {
+ if (a != 3)
+ return 3;
+ if (b != 4)
+ return 4;
+ return check_struct2(x);
+ }
+
+ static int pass_struct2(int a, struct2 x) {
+ if (a != 3)
+ return 3;
+ return check_struct2(x);
+ }
+
+ static int pass_struct2(struct2 x) {
+ return check_struct2(x);
+ }
+
+ static int test_0_struct2_args () {
+ int r;
+ struct2 x;
+
+ x.a = 1;
+ if ((r = check_struct2(x)) != 0)
+ return r;
+ if ((r = pass_struct2(x)) != 0)
+ return r + 10;
+ if ((r = pass_struct2(3, x)) != 0)
+ return r + 20;
+ if ((r = pass_struct2(3, 4, x)) != 0)
+ return r + 30;
+ if ((r = pass_struct2(3, 4, 5, x)) != 0)
+ return r + 40;
+ return 0;
+ }
+
struct AStruct {
public int i;
@@ -1049,6 +1155,43 @@
return 0;
}
+ class Foo2 {
+ public virtual int foo () {
+ return 0;
+ }
+ }
+
+ sealed class Bar2 : Foo2 {
+ public override int foo () {
+ return 0;
+ }
+ }
+
+ static int test_0_abcrem_check_this_removal () {
+ Bar2 b = new Bar2 ();
+
+ // The check_this generated here by the JIT should be removed
+ b.foo ();
+
+ return 0;
+ }
+
+ static int invoke_twice (Bar2 b) {
+ b.foo ();
+ // The check_this generated here by the JIT should be removed
+ b.foo ();
+
+ return 0;
+ }
+
+ static int test_0_abcrem_check_this_removal2 () {
+ Bar2 b = new Bar2 ();
+
+ invoke_twice (b);
+
+ return 0;
+ }
+
/* #346563 */
static int test_0_array_access_64_bit () {
int[] arr2 = new int [10];
_______________________________________________
Mono-patches maillist - [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches