Author: zoltan
Date: 2005-05-12 19:11:58 -0400 (Thu, 12 May 2005)
New Revision: 44480
Modified:
trunk/mono/mono/mini/ChangeLog
trunk/mono/mono/mini/basic-long.cs
trunk/mono/mono/mini/exceptions.cs
trunk/mono/mono/mini/inssel-long.brg
trunk/mono/mono/mini/mini-amd64.c
Log:
2005-05-13 Zoltan Varga <[EMAIL PROTECTED]>
* inssel-long.brg: Add missing ulong->{i1, i2} checked conversions.
Fixes #74925.
* basic-long.cs exceptions.cs: Add new tests. Fix some warnings.
* mini-amd64.c: Fix a warning.
Modified: trunk/mono/mono/mini/ChangeLog
===================================================================
--- trunk/mono/mono/mini/ChangeLog 2005-05-12 22:13:53 UTC (rev 44479)
+++ trunk/mono/mono/mini/ChangeLog 2005-05-12 23:11:58 UTC (rev 44480)
@@ -1,3 +1,12 @@
+2005-05-13 Zoltan Varga <[EMAIL PROTECTED]>
+
+ * inssel-long.brg: Add missing ulong->{i1, i2} checked conversions.
+ Fixes #74925.
+
+ * basic-long.cs exceptions.cs: Add new tests. Fix some warnings.
+
+ * mini-amd64.c: Fix a warning.
+
2005-05-10 Zoltan Varga <[EMAIL PROTECTED]>
* mini-amd64.c (mono_arch_output_basic_block): Fix stack space leakage
Modified: trunk/mono/mono/mini/basic-long.cs
===================================================================
--- trunk/mono/mono/mini/basic-long.cs 2005-05-12 22:13:53 UTC (rev 44479)
+++ trunk/mono/mono/mini/basic-long.cs 2005-05-12 23:11:58 UTC (rev 44480)
@@ -6,7 +6,7 @@
*
* Each test needs to be of the form:
*
- * static int test_<result>_<name> ();
+ * public static int test_<result>_<name> ();
*
* where <result> is an integer (the value that needs to be returned by
* the method to make it pass.
@@ -25,16 +25,16 @@
class Tests {
- static int Main () {
+ public static int Main () {
return TestDriver.RunTests (typeof (Tests));
}
- static int test_10_simple_cast () {
+ public static int test_10_simple_cast () {
long a = 10;
return (int)a;
}
- static int test_1_bigmul1 () {
+ public static int test_1_bigmul1 () {
int a;
int b;
long c;
@@ -46,7 +46,7 @@
return 0;
}
- static int test_1_bigmul2 () {
+ public static int test_1_bigmul2 () {
int a = System.Int32.MaxValue, b = System.Int32.MaxValue;
long s = System.Int64.MinValue;
long c;
@@ -56,7 +56,7 @@
return 0;
}
- static int test_1_bigmul3 () {
+ public static int test_1_bigmul3 () {
int a = 10, b = 10;
ulong c;
c = (ulong) a * (ulong) b;
@@ -65,7 +65,7 @@
return 0;
}
- static int test_1_bigmul4 () {
+ public static int test_1_bigmul4 () {
int a = System.Int32.MaxValue, b = System.Int32.MaxValue;
ulong c;
c = (ulong) a * (ulong) b;
@@ -74,7 +74,7 @@
return 0;
}
- static int test_1_bigmul5 () {
+ public static int test_1_bigmul5 () {
int a = System.Int32.MaxValue, b = System.Int32.MinValue;
long c;
c = (long) a * (long) b;
@@ -83,7 +83,7 @@
return 0;
}
- static int test_1_bigmul6 () {
+ public static int test_1_bigmul6 () {
uint a = System.UInt32.MaxValue, b =
System.UInt32.MaxValue/(uint)2;
ulong c;
c = (ulong) a * (ulong) b;
@@ -92,75 +92,75 @@
return 0;
}
- static int test_0_beq () {
+ public static int test_0_beq () {
long a = 0xffffffffff;
if (a != 0xffffffffff)
return 1;
return 0;
}
- static int test_0_bne_un () {
+ public static int test_0_bne_un () {
long a = 0xffffffffff;
if (a == 0xfffffffffe)
return 1;
return 0;
}
- static int test_0_ble () {
+ public static int test_0_ble () {
long a = 0xffffffffff;
if (a > 0xffffffffff)
return 1;
return 0;
}
- static int test_0_ble_un () {
+ public static int test_0_ble_un () {
ulong a = 0xffffffffff;
if (a > 0xffffffffff)
return 1;
return 0;
}
- static int test_0_bge () {
+ public static int test_0_bge () {
long a = 0xffffffffff;
if (a < 0xffffffffff)
return 1;
return 0;
}
- static int test_0_bge_un () {
+ public static int test_0_bge_un () {
ulong a = 0xffffffffff;
if (a < 0xffffffffff)
return 1;
return 0;
}
- static int test_0_blt () {
+ public static int test_0_blt () {
long a = 0xfffffffffe;
if (a >= 0xffffffffff)
return 1;
return 0;
}
- static int test_0_blt_un () {
+ public static int test_0_blt_un () {
ulong a = 0xfffffffffe;
if (a >= 0xffffffffff)
return 1;
return 0;
}
- static int test_0_bgt () {
+ public static int test_0_bgt () {
long a = 0xffffffffff;
if (a <= 0xfffffffffe)
return 1;
return 0;
}
- static int test_0_conv_to_i4 () {
+ public static int test_0_conv_to_i4 () {
long a = 0;
return (int)a;
}
- static int test_0_conv_from_i4 () {
+ public static int test_0_conv_from_i4 () {
long a = 2;
if (a != 2)
return 1;
@@ -172,7 +172,7 @@
return 0;
}
- static int test_0_conv_from_i4_negative () {
+ public static int test_0_conv_from_i4_negative () {
long a = -2;
if (a != -2)
return 1;
@@ -185,7 +185,7 @@
}
/*
- static int test_0_conv_from_r8 () {
+ public static int test_0_conv_from_r8 () {
double b = 2.0;
long a = (long)b;
@@ -194,7 +194,7 @@
return 0;
}
- static int test_0_conv_from_r4 () {
+ public static int test_0_conv_from_r4 () {
float b = 2.0F;
long a = (long)b;
@@ -204,56 +204,56 @@
}
*/
- static int test_8_and () {
+ public static int test_8_and () {
long a = 0xffffffffff;
long b = 8;
return (int)(a & b);
}
- static int test_8_and_imm () {
+ public static int test_8_and_imm () {
long a = 0xffffffffff;
return (int)(a & 8);
}
- static int test_10_or () {
+ public static int test_10_or () {
long a = 8;
long b = 2;
return (int)(a | b);
}
- static int test_10_or_imm () {
+ public static int test_10_or_imm () {
long a = 8;
return (int)(a | 2);
}
- static int test_5_xor () {
+ public static int test_5_xor () {
long a = 7;
long b = 2;
return (int)(a ^ b);
}
- static int test_5_xor_imm () {
+ public static int test_5_xor_imm () {
long a = 7;
return (int)(a ^ 2);
}
- static int test_5_add () {
+ public static int test_5_add () {
long a = 2;
long b = 3;
return (int)(a + b);
}
- static int test_5_add_imm () {
+ public static int test_5_add_imm () {
long a = 2;
return (int)(a + 3);
}
- static int test_0_add_imm_carry () {
+ public static int test_0_add_imm_carry () {
long a = -1;
return (int)(a + 1);
}
- static int test_0_add_imm_no_inc () {
+ public static int test_0_add_imm_no_inc () {
// we can't blindly convert an add x, 1 to an inc x
long a = 0x1ffffffff;
long c;
@@ -263,34 +263,34 @@
return 1;
}
- static int test_4_addcc_imm () {
+ public static int test_4_addcc_imm () {
long a = 3;
long b = 0;
return (int)(a - b + 1);
}
- static int test_5_sub () {
+ public static int test_5_sub () {
long a = 8;
long b = 3;
return (int)(a - b);
}
- static int test_5_sub_imm () {
+ public static int test_5_sub_imm () {
long a = 8;
return (int)(a - 3);
}
- static int test_0_sub_imm_carry () {
+ public static int test_0_sub_imm_carry () {
long a = 0;
return (int)((a - 1) + 1);
}
- static int test_2_neg () {
+ public static int test_2_neg () {
long a = -2;
return (int)(-a);
}
- static int test_0_neg_large () {
+ public static int test_0_neg_large () {
long min = -9223372036854775808;
unchecked {
ulong ul = (ulong)min;
@@ -298,7 +298,7 @@
}
}
- static int test_0_shl () {
+ public static int test_0_shl () {
long a = 9;
int b = 1;
@@ -309,7 +309,7 @@
return 0;
}
- static int test_1_rshift ()
+ public static int test_1_rshift ()
{
long a = 9;
int b = 1;
@@ -319,7 +319,7 @@
return 1;
}
- static int test_5_shift ()
+ public static int test_5_shift ()
{
long a = 9;
int b = 1;
@@ -349,10 +349,9 @@
return count;
}
- static int test_1_shift_u ()
+ public static int test_1_shift_u ()
{
ulong a;
- int b;
int count = 0;
// The JIT optimizes this
@@ -364,7 +363,7 @@
return count;
}
- static int test_1_simple_neg () {
+ public static int test_1_simple_neg () {
long a = 9;
if (-a != -9)
@@ -372,7 +371,7 @@
return 1;
}
- static int test_2_compare () {
+ public static int test_2_compare () {
long a = 1;
long b = 1;
@@ -381,7 +380,7 @@
return 2;
}
- static int test_9_alu ()
+ public static int test_9_alu ()
{
long a = 9, b = 6;
int count = 0;
@@ -426,13 +425,13 @@
return count;
}
- static int test_24_mul () {
+ public static int test_24_mul () {
long a = 8;
long b = 3;
return (int)(a * b);
}
- static int test_24_mul_ovf () {
+ public static int test_24_mul_ovf () {
long a = 8;
long b = 3;
long res;
@@ -443,13 +442,13 @@
return (int)res;
}
- static int test_24_mul_un () {
+ public static int test_24_mul_un () {
ulong a = 8;
ulong b = 3;
return (int)(a * b);
}
- static int test_24_mul_ovf_un () {
+ public static int test_24_mul_ovf_un () {
ulong a = 8;
ulong b = 3;
ulong res;
@@ -460,20 +459,20 @@
return (int)res;
}
- static int test_4_divun () {
+ public static int test_4_divun () {
uint b = 12;
int a = 3;
return (int)(b / a);
}
- static int test_1431655764_bigdivun_imm () {
+ public static int test_1431655764_bigdivun_imm () {
unchecked {
uint b = (uint)-2;
return (int)(b / 3);
}
}
- static int test_1431655764_bigdivun () {
+ public static int test_1431655764_bigdivun () {
unchecked {
uint b = (uint)-2;
int a = 3;
@@ -481,13 +480,13 @@
}
}
- static int test_1_remun () {
+ public static int test_1_remun () {
uint b = 13;
int a = 3;
return (int)(b % a);
}
- static int test_2_bigremun () {
+ public static int test_2_bigremun () {
unchecked {
uint b = (uint)-2;
int a = 3;
@@ -495,7 +494,7 @@
}
}
- static int test_0_ceq () {
+ public static int test_0_ceq () {
long a = 2;
long b = 2;
long c = 3;
@@ -516,7 +515,7 @@
return 0;
}
- static int test_0_ceq_complex () {
+ public static int test_0_ceq_complex () {
long l = 1, ll = 2;
if (l < 0 != ll < 0)
@@ -525,7 +524,7 @@
return 0;
}
- static int test_0_clt () {
+ public static int test_0_clt () {
long a = 2;
long b = 2;
long c = 3;
@@ -555,7 +554,7 @@
return 0;
}
- static int test_0_clt_un () {
+ public static int test_0_clt_un () {
ulong a = 2;
ulong b = 2;
ulong c = 3;
@@ -581,7 +580,7 @@
return 0;
}
- static int test_0_cgt () {
+ public static int test_0_cgt () {
long a = 2;
long b = 2;
long c = 3;
@@ -611,7 +610,7 @@
return 0;
}
- static int test_0_cgt_un () {
+ public static int test_0_cgt_un () {
ulong a = 2;
ulong b = 2;
ulong c = 3;
@@ -645,19 +644,19 @@
return 0x500000000;
}
- static int test_3_long_ret () {
+ public static int test_3_long_ret () {
long val = return_5low ();
return (int) (val - 2);
}
- static int test_1_long_ret2 () {
+ public static int test_1_long_ret2 () {
long val = return_5high ();
if (val > 0xffffffff)
return 1;
return 0;
}
- static int test_3_byte_cast () {
+ public static int test_3_byte_cast () {
ulong val = 0xff00ff00f0f0f0f0;
byte b;
b = (byte) (val & 0xFF);
@@ -667,7 +666,7 @@
return 3;
}
- static int test_4_ushort_cast () {
+ public static int test_4_ushort_cast () {
ulong val = 0xff00ff00f0f0f0f0;
ushort b;
b = (ushort) (val & 0xFFFF);
@@ -676,7 +675,7 @@
return 4;
}
- static int test_500_mul_div () {
+ public static int test_500_mul_div () {
long val = 1000;
long exp = 10;
long maxexp = 20;
@@ -687,7 +686,7 @@
static long position = 0;
- static int test_4_static_inc_long () {
+ public static int test_4_static_inc_long () {
int count = 4;
@@ -702,7 +701,7 @@
m = (long) value;
}
- static int test_3_checked_cast_un () {
+ public static int test_3_checked_cast_un () {
ulong i = 2;
long j;
@@ -713,7 +712,7 @@
return 3;
}
- static int test_4_checked_cast () {
+ public static int test_4_checked_cast () {
long i = 3;
ulong j;
@@ -724,7 +723,23 @@
return 4;
}
- static int test_1234_checked_i2_cast () {
+ public static int test_12_checked_i1_cast () {
+ long l = 12;
+
+ checked {
+ return (sbyte)l;
+ }
+ }
+
+ public static int test_127_checked_i1_cast_un () {
+ ulong l = 127;
+
+ checked {
+ return (sbyte)l;
+ }
+ }
+
+ public static int test_1234_checked_i2_cast () {
long l = 1234;
checked {
@@ -732,7 +747,15 @@
}
}
- static int test_1234_checked_i4_cast () {
+ public static int test_32767_checked_i2_cast_un () {
+ ulong l = 32767;
+
+ checked {
+ return (ushort)l;
+ }
+ }
+
+ public static int test_1234_checked_i4_cast () {
ulong ul = 1234;
checked {
@@ -740,7 +763,7 @@
}
}
- static int test_10_int_uint_compare () {
+ public static int test_10_int_uint_compare () {
uint size = 10;
int j = 0;
for (int i = 0; i < size; ++i) {
@@ -749,7 +772,7 @@
return j;
}
- static int test_0_ftol_clobber () {
+ public static int test_0_ftol_clobber () {
long m;
doit (1.3, out m);
if (m != 1)
@@ -757,7 +780,7 @@
return 0;
}
- static int test_71_long_shift_right () {
+ public static int test_71_long_shift_right () {
ulong value = 38654838087;
int x = 0;
byte [] buffer = new byte [1];
@@ -765,14 +788,14 @@
return buffer [x];
}
- static int test_0_ulong_regress () {
+ public static int test_0_ulong_regress () {
ulong u = 4257145737;
u --;
return (u == 4257145736) ? 0 : 1;
}
static long x;
- static int test_0_addsub_mem ()
+ public static int test_0_addsub_mem ()
{
x = 0;
x += 5;
@@ -789,7 +812,7 @@
}
static ulong y;
- static int test_0_sh32_mem ()
+ public static int test_0_sh32_mem ()
{
y = 0x0102130405060708;
y >>= 32;
@@ -812,7 +835,7 @@
return 0;
}
- static int test_0_assemble_long ()
+ public static int test_0_assemble_long ()
{
uint a = 5;
ulong x = 0x12345678;
@@ -827,7 +850,7 @@
return 0;
}
- static int test_0_hash ()
+ public static int test_0_hash ()
{
ulong x = 0x1234567887654321;
int h = (int)(x & 0xffffffff) ^ (int)(x >> 32);
@@ -837,7 +860,7 @@
}
- static int test_0_shift_regress () {
+ public static int test_0_shift_regress () {
long a = 0;
int b = 6;
UInt16 c = 3;
Modified: trunk/mono/mono/mini/exceptions.cs
===================================================================
--- trunk/mono/mono/mini/exceptions.cs 2005-05-12 22:13:53 UTC (rev 44479)
+++ trunk/mono/mono/mini/exceptions.cs 2005-05-12 23:11:58 UTC (rev 44480)
@@ -6,7 +6,7 @@
*
* Each test needs to be of the form:
*
- * static int test_<result>_<name> ();
+ * public static int test_<result>_<name> ();
*
* where <result> is an integer (the value that needs to be returned by
* the method to make it pass.
@@ -25,11 +25,11 @@
class Tests {
- static int Main () {
+ public static int Main () {
return TestDriver.RunTests (typeof (Tests));
}
- static int test_0_catch () {
+ public static int test_0_catch () {
Exception x = new Exception ();
try {
@@ -41,7 +41,7 @@
return 1;
}
- static int test_0_finally_without_exc () {
+ public static int test_0_finally_without_exc () {
int x;
try {
@@ -55,7 +55,7 @@
return x;
}
- static int test_0_finally () {
+ public static int test_0_finally () {
int x = 1;
try {
@@ -68,7 +68,7 @@
return x;
}
- static int test_0_nested_finally () {
+ public static int test_0_nested_finally () {
int a;
try {
@@ -83,7 +83,7 @@
return a;
}
- static int test_0_byte_cast () {
+ public static int test_0_byte_cast () {
int a;
long l;
ulong ul;
@@ -277,7 +277,7 @@
return 0;
}
- static int test_0_sbyte_cast () {
+ public static int test_0_sbyte_cast () {
int a;
long l;
sbyte b = 0;
@@ -563,10 +563,25 @@
if (b != 127)
return -20;
+ try {
+ ulong ul = 128;
+ failed = true;
+ checked {
+ b = (sbyte)ul;
+ }
+ }
+ catch (OverflowException) {
+ failed = false;
+ }
+ if (failed)
+ return 21;
+ if (b != 127)
+ return -21;
+
return 0;
}
- static int test_0_ushort_cast () {
+ public static int test_0_ushort_cast () {
int a;
long l;
ulong ul;
@@ -732,7 +747,7 @@
return 0;
}
- static int test_0_short_cast () {
+ public static int test_0_short_cast () {
int a;
long l;
short b;
@@ -943,10 +958,22 @@
if (failed)
return 17;
+ try {
+ ulong ul = 32768;
+ failed = true;
+ checked {
+ b = (short)ul;
+ }
+ } catch (OverflowException) {
+ failed = false;
+ }
+ if (failed)
+ return 18;
+
return 0;
}
- static int test_0_int_cast () {
+ public static int test_0_int_cast () {
int a;
long l;
bool failed;
@@ -1089,7 +1116,7 @@
return 0;
}
- static int test_0_uint_cast () {
+ public static int test_0_uint_cast () {
uint a;
long l;
bool failed;
@@ -1214,7 +1241,7 @@
return 0;
}
- static int test_0_long_cast () {
+ public static int test_0_long_cast () {
long a;
bool failed;
@@ -1277,7 +1304,7 @@
return 0;
}
- static int test_0_ulong_cast () {
+ public static int test_0_ulong_cast () {
ulong a;
bool failed;
@@ -1373,7 +1400,7 @@
return 0;
}
- static int test_0_simple_double_casts () {
+ public static int test_0_simple_double_casts () {
double d = 0xffffffff;
@@ -1408,7 +1435,7 @@
return 0;
}
- static int test_0_div_zero () {
+ public static int test_0_div_zero () {
int d = 1;
int q = 0;
int val;
@@ -1461,11 +1488,11 @@
return 0;
}
- static int return_55 () {
+ public static int return_55 () {
return 55;
}
- static int test_0_cfold_div_zero () {
+ public static int test_0_cfold_div_zero () {
// Test that constant folding doesn't cause division by zero
exceptions
if (return_55 () != return_55 ()) {
int d = 1;
@@ -1486,7 +1513,7 @@
return 0;
}
- static int test_0_udiv_zero () {
+ public static int test_0_udiv_zero () {
uint d = 1;
uint q = 0;
uint val;
@@ -1513,7 +1540,7 @@
return 0;
}
- static int test_0_long_div_zero () {
+ public static int test_0_long_div_zero () {
long d = 1;
long q = 0;
long val;
@@ -1566,7 +1593,7 @@
return 0;
}
- static int test_0_ulong_div_zero () {
+ public static int test_0_ulong_div_zero () {
ulong d = 1;
ulong q = 0;
ulong val;
@@ -1593,7 +1620,7 @@
return 0;
}
- static int test_0_float_div_zero () {
+ public static int test_0_float_div_zero () {
double d = 1;
double q = 0;
double val;
@@ -1620,7 +1647,7 @@
return 0;
}
- static int test_0_invalid_unbox () {
+ public static int test_0_invalid_unbox () {
int i = 123;
object o = "Some string";
@@ -1638,7 +1665,7 @@
}
// Test that double[] can't be cast to double (bug #46027)
- static int test_0_invalid_unbox_arrays () {
+ public static int test_0_invalid_unbox_arrays () {
double[] d1 = { 1.0 };
double[][] d2 = { d1 };
Array a = d2;
@@ -1657,7 +1684,7 @@
* jumps out of multiple exception clauses: we used to execute just
* one enclosing finally block.
*/
- static int finally_level;
+ public static int finally_level;
static void do_something () {
int a = 0;
try {
@@ -1671,7 +1698,7 @@
}
}
- static int test_2_multiple_finally_clauses () {
+ public static int test_2_multiple_finally_clauses () {
finally_level = 0;
do_something ();
if (finally_level == 1)
@@ -1679,7 +1706,7 @@
return 0;
}
- static int test_3_checked_cast_un () {
+ public static int test_3_checked_cast_un () {
ulong i = 0x8000000034000000;
long j;
@@ -1694,7 +1721,7 @@
return 3;
}
- static int test_4_checked_cast () {
+ public static int test_4_checked_cast () {
long i;
ulong j;
@@ -1721,7 +1748,7 @@
7, 0, 7, 1, 7, 2, 7, 3, 7, 4, 7, 5, 7, 6, 7, 7, 7, 8,
};
- static int test_0_multi_dim_array_access () {
+ public static int test_0_multi_dim_array_access () {
int [,] a = System.Array.CreateInstance (typeof (int),
new int [] {3,6}, new int [] {2,2 }) as int[,];
int x, y;
@@ -1757,7 +1784,7 @@
o = "buddy";
}
- static int test_2_array_mismatch () {
+ public static int test_2_array_mismatch () {
string[] a = { "hello", "world" };
object[] b = a;
bool passed = false;
@@ -1775,7 +1802,7 @@
return 2;
}
- static int test_0_ovf () {
+ public static int test_0_ovf () {
int ocount = 0;
checked {
@@ -2013,7 +2040,7 @@
}
class Broken {
- static int i;
+ public static int i;
static Broken () {
throw new Exception ("Ugh!");
@@ -2024,7 +2051,7 @@
}
}
- static int test_0_exception_in_cctor () {
+ public static int test_0_exception_in_cctor () {
try {
Broken.DoSomething ();
}
@@ -2034,7 +2061,7 @@
return 0;
}
- static int test_5_regalloc () {
+ public static int test_5_regalloc () {
int i = 0;
try {
@@ -2087,7 +2114,7 @@
}
}
- static int test_0_rethrow_stacktrace () {
+ public static int test_0_rethrow_stacktrace () {
// Check that rethrowing an exception preserves the original
stack trace
try {
try {
@@ -2117,7 +2144,7 @@
interface IFace {}
class Face : IFace {}
- static int test_1_array_mismatch_2 () {
+ public static int test_1_array_mismatch_2 () {
try {
object [] o = new Face [1];
o [0] = 1;
@@ -2127,7 +2154,7 @@
}
}
- static int test_1_array_mismatch_3 () {
+ public static int test_1_array_mismatch_3 () {
try {
object [] o = new IFace [1];
o [0] = 1;
@@ -2137,7 +2164,7 @@
}
}
- static int test_1_array_mismatch_4 () {
+ public static int test_1_array_mismatch_4 () {
try {
object [][] o = new Face [5] [];
o [0] = new object [5];
@@ -2148,7 +2175,7 @@
}
}
- static int test_0_array_size () {
+ public static int test_0_array_size () {
bool failed;
try {
@@ -2186,7 +2213,7 @@
}
/* Test that arguments are correctly popped off the stack during
unwinding */
- static int test_0_stack_unwind () {
+ public static int test_0_stack_unwind () {
addr = new IntPtr [1000];
S s = new S ();
for (int j = 0; j < 1000; j++) {
@@ -2199,7 +2226,7 @@
return (addr [0].ToInt64 () - addr [100].ToInt64 () < 100) ? 0
: 1;
}
- static int test_0_regress_73242 () {
+ public static int test_0_regress_73242 () {
int [] arr = new int [10];
for (int i = 0; i < 10; ++i)
arr [i] = 0;
@@ -2211,7 +2238,7 @@
return 0;
}
- static int test_0_nullref () {
+ public static int test_0_nullref () {
try {
Array foo = null;
foo.Clone();
Modified: trunk/mono/mono/mini/inssel-long.brg
===================================================================
--- trunk/mono/mono/mini/inssel-long.brg 2005-05-12 22:13:53 UTC (rev
44479)
+++ trunk/mono/mono/mini/inssel-long.brg 2005-05-12 23:11:58 UTC (rev
44480)
@@ -218,7 +218,6 @@
MONO_EMIT_UNALU (s, tree, CEE_CONV_U2, state->reg1, state->left->reg1);
}
-
reg: OP_LCONV_TO_OVF_I1 (reg) {
MONO_EMIT_NEW_COMPARE_IMM (s, state->left->reg1, 127);
MONO_EMIT_NEW_COND_EXC (s, GT, "OverflowException");
@@ -227,6 +226,12 @@
MONO_EMIT_UNALU (s, tree, CEE_CONV_I1, state->reg1, state->left->reg1);
}
+reg: OP_LCONV_TO_OVF_I1_UN (reg) {
+ MONO_EMIT_NEW_COMPARE_IMM (s, state->left->reg1, 127);
+ MONO_EMIT_NEW_COND_EXC (s, GT_UN, "OverflowException");
+ MONO_EMIT_UNALU (s, tree, CEE_CONV_I1, state->reg1, state->left->reg1);
+}
+
reg: OP_LCONV_TO_OVF_U1 (reg) {
/* probe value to be within 0 to 255 */
MONO_EMIT_NEW_COMPARE_IMM (s, state->left->reg1, 255);
@@ -250,6 +255,13 @@
MONO_EMIT_UNALU (s, tree, CEE_CONV_I2, state->reg1, state->left->reg1);
}
+reg: OP_LCONV_TO_OVF_I2_UN (reg) {
+ /* Probe value to be within 0 and 32767 */
+ MONO_EMIT_NEW_COMPARE_IMM (s, state->left->reg1, 32767);
+ MONO_EMIT_NEW_COND_EXC (s, GT_UN, "OverflowException");
+ MONO_EMIT_UNALU (s, tree, CEE_CONV_I2, state->reg1, state->left->reg1);
+}
+
reg: OP_LCONV_TO_OVF_U2 (reg) {
/* Probe value to be within 0 and 65535 */
MONO_EMIT_NEW_COMPARE_IMM (s, state->left->reg1, 0xffff);
@@ -278,12 +290,6 @@
MONO_EMIT_UNALU (s, tree, OP_MOVE, state->reg1, state->left->reg1);
}
-reg: OP_LCONV_TO_OVF_U4_UN (reg) {
- MONO_EMIT_NEW_COMPARE_IMM (s, state->left->reg1, 0xffffffff);
- MONO_EMIT_NEW_COND_EXC (s, GT_UN, "OverflowException");
- MONO_EMIT_UNALU (s, tree, OP_MOVE, state->reg1, state->left->reg1);
-}
-
reg: OP_LCONV_TO_OVF_U4 (reg) {
MONO_EMIT_NEW_COMPARE_IMM (s, state->left->reg1, 0xffffffffUL);
MONO_EMIT_NEW_COND_EXC (s, GT, "OverflowException");
@@ -292,6 +298,12 @@
MONO_EMIT_UNALU (s, tree, OP_MOVE, state->reg1, state->left->reg1);
}
+reg: OP_LCONV_TO_OVF_U4_UN (reg) {
+ MONO_EMIT_NEW_COMPARE_IMM (s, state->left->reg1, 0xffffffff);
+ MONO_EMIT_NEW_COND_EXC (s, GT_UN, "OverflowException");
+ MONO_EMIT_UNALU (s, tree, OP_MOVE, state->reg1, state->left->reg1);
+}
+
reg: OP_LCONV_TO_OVF_I_UN (reg),
reg: OP_LCONV_TO_OVF_I8_UN (reg) {
MONO_EMIT_NEW_BIALU_IMM (s, OP_COMPARE_IMM, -1, state->left->reg1, 0);
Modified: trunk/mono/mono/mini/mini-amd64.c
===================================================================
--- trunk/mono/mono/mini/mini-amd64.c 2005-05-12 22:13:53 UTC (rev 44479)
+++ trunk/mono/mono/mini/mini-amd64.c 2005-05-12 23:11:58 UTC (rev 44480)
@@ -102,7 +102,7 @@
"xmm9", "xmm10", "xmm11", "xmm12", "xmm13", "xmm14", "xmm15"
};
-static const char*
+const char*
mono_arch_fregname (int reg)
{
if (reg < AMD64_XMM_NREG)
_______________________________________________
Mono-patches maillist - [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches