Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

2007-12-03 Zoltan Varga <vargaz@gmail.com>

	* custom-modifiers.2.cs custom-modifiers-il.cs: New test for the 2.0
	GetRequiredCustomModifiers ()/GetOptionalCustomModifiers () methods.

svn path=/trunk/mono/; revision=90553
  • Loading branch information...
commit 664f5bcbf6fa2f409afc67d49ae5914abf397e67 1 parent ec61914
@vargaz vargaz authored
View
5 mono/tests/ChangeLog
@@ -1,3 +1,8 @@
+2007-12-03 Zoltan Varga <vargaz@gmail.com>
+
+ * custom-modifiers.2.cs custom-modifiers-il.cs: New test for the 2.0
+ GetRequiredCustomModifiers ()/GetOptionalCustomModifiers () methods.
+
2007-11-30 Zoltan Varga <vargaz@gmail.com>
* stackframes-async.2.cs: Fix this test to work with the new delegate optimization.
View
10 mono/tests/Makefile.am
@@ -364,7 +364,7 @@ else
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 @@ EXTRA_DIST += make_imt_test.sh
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
View
25 mono/tests/custom-modifiers-lib.il
@@ -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
+
+
View
35 mono/tests/custom-modifiers.2.cs
@@ -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;
+ }
+}
Please sign in to comment.
Something went wrong with that request. Please try again.