* Makefile.am: Update.
svn path=/trunk/mono/; revision=61309
2006-05-31 Raja R Harinath <rharinath@novell.com>
+ * 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.
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) \
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
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
%.exe: %.cs TestDriver.dll
$(MCS) -out:$@ -unsafe $< -r:TestDriver.dll
+%.exe: %.2.il
+ $(ILASM2) -output=$@ $<
+
%.exe: %.il
$(ILASM) -output=$@ $<
--- /dev/null
+.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
+ }
+}
+