Author: raja
Date: 2006-05-31 06:47:15 -0400 (Wed, 31 May 2006)
New Revision: 61309

Added:
   trunk/mono/mono/mini/il2tests.2.il
Modified:
   trunk/mono/mono/mini/ChangeLog
   trunk/mono/mono/mini/Makefile.am
Log:
* il2tests.2.il: New file for generics CIL tests.  Add test for #78019.
* Makefile.am: Update.


Modified: trunk/mono/mono/mini/ChangeLog
===================================================================
--- trunk/mono/mono/mini/ChangeLog      2006-05-31 10:08:42 UTC (rev 61308)
+++ trunk/mono/mono/mini/ChangeLog      2006-05-31 10:47:15 UTC (rev 61309)
@@ -1,5 +1,9 @@
 2006-05-31  Raja R Harinath  <[EMAIL PROTECTED]>
 
+       * il2tests.2.il: New file for generics CIL tests.  Add test for
+       #78019.
+       * Makefile.am: Update.
+
        Fix #78019
        * mini.c (mono_method_to_ir): Don't apply box+brtrue optimization
        to nullable types.

Modified: trunk/mono/mono/mini/Makefile.am
===================================================================
--- trunk/mono/mono/mini/Makefile.am    2006-05-31 10:08:42 UTC (rev 61308)
+++ trunk/mono/mono/mini/Makefile.am    2006-05-31 10:47:15 UTC (rev 61309)
@@ -38,8 +38,8 @@
 MCS = $(RUNTIME) $(CLASS1)/mcs.exe -unsafe -nowarn:0162
 GMCS = $(RUNTIME2) $(CLASS2)/gmcs.exe -unsafe -nowarn:0162
 ILASM = $(RUNTIME) $(CLASS1)/ilasm.exe
+ILASM2 = $(RUNTIME2) $(CLASS2)/ilasm.exe
 
-
 AM_CFLAGS = \
        -I$(top_srcdir)         \
        $(LIBGC_CFLAGS)         \
@@ -220,7 +220,7 @@
        iltests.il              \
        test.cs
 
-test_sources2 = generics.2.cs
+test_sources2 = generics.2.cs il2tests.2.il
 
 if MONO_DEBUGGER_SUPPORTED
 mono_debugger_sources = debug-debugger.c debug-debugger.h
@@ -229,7 +229,8 @@
 endif
 
 regtests=basic.exe arrays.exe basic-float.exe basic-math.exe basic-long.exe 
objects.exe basic-calls.exe iltests.exe exceptions.exe bench.exe
-regtests2=generics.exe
+regtests2=generics.exe il2tests.exe
+
 common_BURGSRC= $(srcdir)/inssel.brg $(srcdir)/inssel-float.brg
 
 if X86
@@ -328,6 +329,9 @@
 %.exe: %.cs TestDriver.dll
        $(MCS) -out:$@ -unsafe $< -r:TestDriver.dll
 
+%.exe: %.2.il
+       $(ILASM2) -output=$@ $<
+
 %.exe: %.il
        $(ILASM) -output=$@ $<
 

Added: trunk/mono/mono/mini/il2tests.2.il
===================================================================
--- trunk/mono/mono/mini/il2tests.2.il  2006-05-31 10:08:42 UTC (rev 61308)
+++ trunk/mono/mono/mini/il2tests.2.il  2006-05-31 10:47:15 UTC (rev 61309)
@@ -0,0 +1,37 @@
+.assembly il2tests {}
+.assembly extern TestDriver {}
+.assembly extern mscorlib {}
+
+.class public auto ansi sealed beforefieldinit Tests {
+
+       .method static public int32 Main(string[] args) cil managed {
+               .entrypoint
+               
+               ldtoken Tests
+               call       class [mscorlib]System.Type 
[mscorlib]System.Type::GetTypeFromHandle(valuetype 
[mscorlib]System.RuntimeTypeHandle)
+               ldarg.0
+               call       int32 [TestDriver]TestDriver::RunTests(class 
[mscorlib]System.Type, string[])
+               ret
+       }
+
+       .method private static hidebysig default int32 Foo<T> (!!T n)  cil 
managed {
+               ldarg.0
+               box !!0
+               brtrue HAS_VALUE
+               ldc.i4.0
+               ret
+HAS_VALUE:     ldc.i4.1
+               ret
+       }
+
+       // bug 78019
+       .method static public int32 test_0_nullable_box_brtrue () cil managed {
+
+               .locals init (valuetype [mscorlib]System.Nullable`1<int32> V_0)
+
+               ldloc.0
+               call int32 class Tests::Foo<valuetype 
[mscorlib]System.Nullable`1<int32>> (!!0)
+               ret
+       }
+}
+

_______________________________________________
Mono-patches maillist  -  [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches

Reply via email to