Author: kumpera
Date: 2008-02-06 20:08:41 -0500 (Wed, 06 Feb 2008)
New Revision: 95104
Added:
trunk/mono/mono/tests/verifier/valid_boxed_enum_is_compatible_with_system_enum.cs
trunk/mono/mono/tests/verifier/valid_merge_boxed_type.cs
trunk/mono/mono/tests/verifier/valid_merge_boxed_type_2.cs
trunk/mono/mono/tests/verifier/valid_stelem_ref_boxed_type.cs
Modified:
trunk/mono/mono/tests/verifier/ChangeLog
trunk/mono/mono/tests/verifier/make_ldelem_test.sh
trunk/mono/mono/tests/verifier/make_tests.sh
Log:
2008-02-06 Rodrigo Kumpera <[EMAIL PROTECTED]>
* valid_boxed_enum_is_compatible_with_system_enum.cs: Added.
Test if an enum is compatible with System.Enum.
* valid_merge_boxed_type.cs: Added. Test merging
a boxed int32 with a reference type.
* valid_merge_boxed_type_2.cs: Same.
* make_ldelem_test.sh: Added some enums to be used by the tests.
* make_tests.sh: New tests for ldelem compatibility between enums
and their base type. Marked some tests as strict.
Modified: trunk/mono/mono/tests/verifier/ChangeLog
===================================================================
--- trunk/mono/mono/tests/verifier/ChangeLog 2008-02-07 00:57:16 UTC (rev
95103)
+++ trunk/mono/mono/tests/verifier/ChangeLog 2008-02-07 01:08:41 UTC (rev
95104)
@@ -1,4 +1,20 @@
2008-02-06 Rodrigo Kumpera <[EMAIL PROTECTED]>
+
+ * valid_boxed_enum_is_compatible_with_system_enum.cs: Added.
+ Test if an enum is compatible with System.Enum.
+
+ * valid_merge_boxed_type.cs: Added. Test merging
+ a boxed int32 with a reference type.
+
+ * valid_merge_boxed_type_2.cs: Same.
+
+ * make_ldelem_test.sh: Added some enums to be used by the tests.
+
+ * make_tests.sh: New tests for ldelem compatibility between enums
+ and their base type. Marked some tests as strict.
+
+2008-02-06 Rodrigo Kumpera <[EMAIL PROTECTED]>
+
* valid_merge_base_type.cs
* valid_merge_first_value_is_base_type.cs:
* valid_merge_interface_type_3.cs:
Modified: trunk/mono/mono/tests/verifier/make_ldelem_test.sh
===================================================================
--- trunk/mono/mono/tests/verifier/make_ldelem_test.sh 2008-02-07 00:57:16 UTC
(rev 95103)
+++ trunk/mono/mono/tests/verifier/make_ldelem_test.sh 2008-02-07 01:08:41 UTC
(rev 95104)
@@ -30,11 +30,57 @@
}
.class public auto ansi sealed MyStruct
- extends [mscorlib]System.ValueType
+ extends [mscorlib]System.ValueType
{
.field public int32 foo
}
+.class public auto ansi sealed ByteEnum
+ extends [mscorlib]System.Enum
+{
+ .field public specialname rtspecialname unsigned int8 value__
+
+ .field public static literal valuetype ByteEnum V_0 = int8(0x00)
+ .field public static literal valuetype ByteEnum V_1 = int8(0x01)
+}
+
+.class public auto ansi sealed ShortEnum
+ extends [mscorlib]System.Enum
+{
+ .field public specialname rtspecialname unsigned int16 value__
+
+ .field public static literal valuetype ShortEnum V_0 = int16(0x00)
+ .field public static literal valuetype ShortEnum V_1 = int16(0x01)
+}
+
+.class public auto ansi sealed IntEnum
+ extends [mscorlib]System.Enum
+{
+ .field public specialname rtspecialname unsigned int32 value__
+
+ .field public static literal valuetype IntEnum V_0 = int32(0x00)
+ .field public static literal valuetype IntEnum V_1 = int32(0x01)
+}
+
+.class public auto ansi sealed LongEnum
+ extends [mscorlib]System.Enum
+{
+ .field public specialname rtspecialname unsigned int64 value__
+
+ .field public static literal valuetype LongEnum V_0 = int64(0x00)
+ .field public static literal valuetype LongEnum V_1 = int64(0x01)
+}
+
+.class public auto ansi sealed NativeIntEnum
+ extends [mscorlib]System.Enum
+{
+ .field public specialname rtspecialname native int value__
+
+ .field public static literal valuetype NativeIntEnum V_0 = int32(0x00)
+ .field public static literal valuetype NativeIntEnum V_1 = int32(0x01)
+}
+
+
.method public static void foo() cil managed
{
.maxstack 2
Modified: trunk/mono/mono/tests/verifier/make_tests.sh
===================================================================
--- trunk/mono/mono/tests/verifier/make_tests.sh 2008-02-07 00:57:16 UTC
(rev 95103)
+++ trunk/mono/mono/tests/verifier/make_tests.sh 2008-02-07 01:08:41 UTC
(rev 95104)
@@ -2765,7 +2765,7 @@
I=1
-for ARR in "int8" "bool" "unsigned int8"
+for ARR in "int8" "bool" "unsigned int8" "ByteEnum"
do
./make_ldelem_test.sh ldelem_base_types_i_${I} valid "newarr ${ARR}"
"ldc.i4.0" "ldelem.i1"
./make_ldelem_test.sh ldelem_base_types_u_${I} valid "newarr ${ARR}"
"ldc.i4.0" "ldelem.u1"
@@ -2780,7 +2780,7 @@
done
-for ARR in "int16" "char" "unsigned int16"
+for ARR in "int16" "char" "unsigned int16" "ShortEnum"
do
./make_ldelem_test.sh ldelem_base_types_i_${I} valid "newarr ${ARR}"
"ldc.i4.0" "ldelem.i2"
./make_ldelem_test.sh ldelem_base_types_u_${I} valid "newarr ${ARR}"
"ldc.i4.0" "ldelem.u2"
@@ -2794,11 +2794,18 @@
I=`expr $I + 1`
done
-
-for ARR in "int32" "unsigned int32" "native int" "native unsigned int"
+for ARR in "int32" "unsigned int32" "IntEnum"
do
./make_ldelem_test.sh ldelem_base_types_i_${I} valid "newarr ${ARR}"
"ldc.i4.0" "ldelem.i4"
./make_ldelem_test.sh ldelem_base_types_u_${I} valid "newarr ${ARR}"
"ldc.i4.0" "ldelem.u4"
+ ./make_ldelem_test.sh ldelem_base_types_n_${I} strict "newarr ${ARR}"
"ldc.i4.0" "ldelem.i"
+ I=`expr $I + 1`
+done
+
+for ARR in "native int" "native unsigned int" "NativeIntEnum"
+do
+ ./make_ldelem_test.sh ldelem_base_types_i_${I} strict "newarr ${ARR}"
"ldc.i4.0" "ldelem.i4"
+ ./make_ldelem_test.sh ldelem_base_types_u_${I} strict "newarr ${ARR}"
"ldc.i4.0" "ldelem.u4"
./make_ldelem_test.sh ldelem_base_types_n_${I} valid "newarr ${ARR}"
"ldc.i4.0" "ldelem.i"
I=`expr $I + 1`
done
@@ -2812,7 +2819,7 @@
done
-for ARR in "int64" "unsigned int64"
+for ARR in "int64" "unsigned int64" "LongEnum"
do
./make_ldelem_test.sh ldelem_base_types_i_${I} valid "newarr ${ARR}"
"ldc.i4.0" "ldelem.i8"
./make_ldelem_test.sh ldelem_base_types_u_${I} valid "newarr ${ARR}"
"ldc.i4.0" "ldelem.u8"
Added:
trunk/mono/mono/tests/verifier/valid_boxed_enum_is_compatible_with_system_enum.cs
===================================================================
---
trunk/mono/mono/tests/verifier/valid_boxed_enum_is_compatible_with_system_enum.cs
2008-02-07 00:57:16 UTC (rev 95103)
+++
trunk/mono/mono/tests/verifier/valid_boxed_enum_is_compatible_with_system_enum.cs
2008-02-07 01:08:41 UTC (rev 95104)
@@ -0,0 +1,13 @@
+using System;
+
+public enum TestEnum {
+ A, B, C
+}
+
+class Driver {
+ public static int Main (string[] args) {
+ TestEnum te = TestEnum.A;
+ te.ToString ();
+ return 1;
+ }
+}
Added: trunk/mono/mono/tests/verifier/valid_merge_boxed_type.cs
===================================================================
--- trunk/mono/mono/tests/verifier/valid_merge_boxed_type.cs 2008-02-07
00:57:16 UTC (rev 95103)
+++ trunk/mono/mono/tests/verifier/valid_merge_boxed_type.cs 2008-02-07
01:08:41 UTC (rev 95104)
@@ -0,0 +1,11 @@
+using System;
+using System.Reflection;
+using System.Reflection.Emit;
+
+class Driver {
+ public static int Main (string[] args) {
+ object o;
+ o = args == null ? new object () : (object)1;
+ return 1;
+ }
+}
Added: trunk/mono/mono/tests/verifier/valid_merge_boxed_type_2.cs
===================================================================
--- trunk/mono/mono/tests/verifier/valid_merge_boxed_type_2.cs 2008-02-07
00:57:16 UTC (rev 95103)
+++ trunk/mono/mono/tests/verifier/valid_merge_boxed_type_2.cs 2008-02-07
01:08:41 UTC (rev 95104)
@@ -0,0 +1,11 @@
+using System;
+using System.Reflection;
+using System.Reflection.Emit;
+
+class Driver {
+ public static int Main (string[] args) {
+ object[] o = new object[10];
+ o[5] = args == null ? (object)1 : new object ();
+ return 1;
+ }
+}
Added: trunk/mono/mono/tests/verifier/valid_stelem_ref_boxed_type.cs
===================================================================
--- trunk/mono/mono/tests/verifier/valid_stelem_ref_boxed_type.cs
2008-02-07 00:57:16 UTC (rev 95103)
+++ trunk/mono/mono/tests/verifier/valid_stelem_ref_boxed_type.cs
2008-02-07 01:08:41 UTC (rev 95104)
@@ -0,0 +1,11 @@
+using System;
+using System.Reflection;
+using System.Reflection.Emit;
+
+class Driver {
+ public static int Main (string[] args) {
+ object[] o = new object[10];
+ o[5] = args == null ? (object)1 : new object ();
+ return 1;
+ }
+}
_______________________________________________
Mono-patches maillist - [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches