Author: zoltan
Date: 2007-12-03 11:29:26 -0500 (Mon, 03 Dec 2007)
New Revision: 90553
Added:
trunk/mono/mono/tests/custom-modifiers-lib.il
trunk/mono/mono/tests/custom-modifiers.2.cs
Modified:
trunk/mono/mono/tests/ChangeLog
trunk/mono/mono/tests/Makefile.am
Log:
2007-12-03 Zoltan Varga <[EMAIL PROTECTED]>
* custom-modifiers.2.cs custom-modifiers-il.cs: New test for the 2.0
GetRequiredCustomModifiers ()/GetOptionalCustomModifiers () methods.
Modified: trunk/mono/mono/tests/ChangeLog
===================================================================
--- trunk/mono/mono/tests/ChangeLog 2007-12-03 16:15:13 UTC (rev 90552)
+++ trunk/mono/mono/tests/ChangeLog 2007-12-03 16:29:26 UTC (rev 90553)
@@ -1,3 +1,8 @@
+2007-12-03 Zoltan Varga <[EMAIL PROTECTED]>
+
+ * custom-modifiers.2.cs custom-modifiers-il.cs: New test for the 2.0
+ GetRequiredCustomModifiers ()/GetOptionalCustomModifiers () methods.
+
2007-11-30 Zoltan Varga <[EMAIL PROTECTED]>
* stackframes-async.2.cs: Fix this test to work with the new delegate
optimization.
Modified: trunk/mono/mono/tests/Makefile.am
===================================================================
--- trunk/mono/mono/tests/Makefile.am 2007-12-03 16:15:13 UTC (rev 90552)
+++ trunk/mono/mono/tests/Makefile.am 2007-12-03 16:29:26 UTC (rev 90553)
@@ -364,7 +364,7 @@
if PLATFORM_WIN32
test: assemblyresolve/test/asm.dll testjit test-type-load
test-inline-call-stack test-bug-80307 test-bug-81673 test-bug-81691
test-bug-81466 test-bug-324535
else
-test: assemblyresolve/test/asm.dll testjit testbundle test-type-load
test-inline-call-stack test-iomap-regression test-bug-80307 test-bug-81673
test-bug-81691 test-bug-81466 test-bug-324535
+test: assemblyresolve/test/asm.dll testjit testbundle test-type-load
test-inline-call-stack test-iomap-regression test-bug-80307 test-bug-81673
test-bug-81691 test-bug-81466 test-bug-324535 custom-modifiers
endif
endif
@@ -645,6 +645,14 @@
imt_big_iface_test.cs: $(srcdir)/make_imt_test.sh
$(srcdir)/make_imt_test.sh > imt_big_iface_test.cs
+EXTRA_DIST += custom-modifiers-lib.il
+custom-modifiers-lib.dll: custom-modifiers-lib.il
+ $(ILASM) /dll /output:custom-modifiers-lib.dll
$(srcdir)/custom-modifiers-lib.il
+custom-modifiers.exe: custom-modifiers.2.cs custom-modifiers-lib.dll
+ $(GMCS) -r:custom-modifiers-lib.dll -out:custom-modifiers.exe
$(srcdir)/custom-modifiers.2.cs
+custom-modifiers: custom-modifiers.exe
+ $(RUNTIME2) custom-modifiers.exe
+
EXTRA_DIST += coreclr-security.cs
if INSTALL_2_1
Added: trunk/mono/mono/tests/custom-modifiers-lib.il
===================================================================
--- trunk/mono/mono/tests/custom-modifiers-lib.il 2007-12-03 16:15:13 UTC
(rev 90552)
+++ trunk/mono/mono/tests/custom-modifiers-lib.il 2007-12-03 16:29:26 UTC
(rev 90553)
@@ -0,0 +1,25 @@
+.assembly extern mscorlib
+{
+ .ver 2:0:0:0
+ .publickeytoken = (B7 7A 5C 56 19 34 E0 89 ) // .z\V.4..
+}
+.assembly 'custom-modifiers-lib'
+{
+ .custom instance void class
+[mscorlib]System.Runtime.CompilerServices.CompilationRelaxationsAttribute::.ctor(int32)
+= (01 00 08 00 00 00 00 00 ) // ........
+
+ .hash algorithm 0x00008004
+ .ver 0:0:0:0
+}
+.module 'custom-modifiers-lib'
+
+
+.class public auto ansi abstract sealed CustomModifiers
+extends [mscorlib]System.Object
+{
+ .field public int32
modreq([mscorlib]System.Runtime.CompilerServices.IsBoxed) field_1
+ .field public int32
modopt([mscorlib]System.Runtime.CompilerServices.IsVolatile) field_2
+} // end of class CustomModifiers
+
+
Added: trunk/mono/mono/tests/custom-modifiers.2.cs
===================================================================
--- trunk/mono/mono/tests/custom-modifiers.2.cs 2007-12-03 16:15:13 UTC (rev
90552)
+++ trunk/mono/mono/tests/custom-modifiers.2.cs 2007-12-03 16:29:26 UTC (rev
90553)
@@ -0,0 +1,35 @@
+//
+// This should be part of the mscorlib tests but there is no way to generate
custom
+// modifiers with C#.
+//
+using System;
+using System.Reflection;
+
+public class Tests {
+
+ public static int Main () {
+ Type[] arr;
+
+ arr = typeof (CustomModifiers).GetField
("field_1").GetRequiredCustomModifiers ();
+ if (arr.Length != 1)
+ return 1;
+ if (arr [0] != typeof (System.Runtime.CompilerServices.IsBoxed))
+ return 2;
+
+ arr = typeof (CustomModifiers).GetField
("field_1").GetOptionalCustomModifiers ();
+ if (arr.Length != 0)
+ return 3;
+
+ arr = typeof (CustomModifiers).GetField
("field_2").GetRequiredCustomModifiers ();
+ if (arr.Length != 0)
+ return 4;
+
+ arr = typeof (CustomModifiers).GetField
("field_2").GetOptionalCustomModifiers ();
+ if (arr.Length != 1)
+ return 5;
+ if (arr [0] != typeof
(System.Runtime.CompilerServices.IsVolatile))
+ return 6;
+
+ return 0;
+ }
+}
_______________________________________________
Mono-patches maillist - [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches