From 3a9c1374eca8c593966543acd988c6f4485035a3 Mon Sep 17 00:00:00 2001 From: kumpera Date: Wed, 2 Jun 2010 14:34:25 +0000 Subject: [PATCH] 2010-06-02 Rodrigo Kumpera * invalid_generic_constraints_with_loop.il: * valid_dependent_generic_constraint_and_boxing.il: Regression tests for #610625. git-svn-id: svn+ssh://mono-cvs.ximian.com/source/trunk/mono@158343 e3ebcda4-bce8-0310-ba0a-eca2169e7518 --- mono/tests/verifier/ChangeLog | 6 + .../invalid_generic_constraints_with_loop.il | 125 +++++++++++++++++++++ ...alid_dependent_generic_constraint_and_boxing.il | 125 +++++++++++++++++++++ 3 files changed, 256 insertions(+) create mode 100644 mono/tests/verifier/invalid_generic_constraints_with_loop.il create mode 100644 mono/tests/verifier/valid_dependent_generic_constraint_and_boxing.il diff --git a/mono/tests/verifier/ChangeLog b/mono/tests/verifier/ChangeLog index f24213abf..2831d5566 100644 --- a/mono/tests/verifier/ChangeLog +++ b/mono/tests/verifier/ChangeLog @@ -1,3 +1,9 @@ +2010-06-02 Rodrigo Kumpera + + * invalid_generic_constraints_with_loop.il: + * valid_dependent_generic_constraint_and_boxing.il: + Regression tests for #610625. + 2010-04-09 Rodrigo Kumpera * valid_switch_with_value_on_stack.il: New test. diff --git a/mono/tests/verifier/invalid_generic_constraints_with_loop.il b/mono/tests/verifier/invalid_generic_constraints_with_loop.il new file mode 100644 index 000000000..f1809880c --- /dev/null +++ b/mono/tests/verifier/invalid_generic_constraints_with_loop.il @@ -0,0 +1,125 @@ +.assembly extern mscorlib +{ + .ver 2:0:0:0 + .publickeytoken = (B7 7A 5C 56 19 34 E0 89 ) // .z\V.4.. +} +.assembly 'gtest-514' +{ + .custom instance void class [mscorlib]System.Runtime.CompilerServices.RuntimeCompatibilityAttribute::'.ctor'() = ( + 01 00 01 00 54 02 16 57 72 61 70 4E 6F 6E 45 78 // ....T..WrapNonEx + 63 65 70 74 69 6F 6E 54 68 72 6F 77 73 01 ) // ceptionThrows. + + .hash algorithm 0x00008004 + .ver 0:0:0:0 +} +.module 'broken.exe' + + +.namespace test2 +{ +.class public auto ansi beforefieldinit Test`3< + .ctor (!U) T, + .ctor (!V) U, + .ctor (!T, class [mscorlib]System.IDisposable) V> + extends [mscorlib]System.Object +{ + .method public hidebysig specialname rtspecialname instance default void '.ctor' () cil managed + { + .maxstack 8 + ldarg.0 + call instance void object::'.ctor'() + ret + } + + .method public hidebysig + instance default void Method () cil managed + { + .maxstack 8 + .locals init ( + class [mscorlib]System.IDisposable V_0, + class [mscorlib]System.IDisposable V_1, + class [mscorlib]System.IDisposable V_2, + !T V_3, + !U V_4, + !V V_5) + ldloca.s 3 + initobj !0 + ldloc.3 + box !0 + brfalse L_0 + + ldloca.s 3 + initobj !0 + ldloc.3 + br.s L_1 + +L_0: + call !!0 class [mscorlib]System.Activator::CreateInstance () +L_1: + box !0 + stloc.0 + ldloca.s 4 + initobj !1 + ldloc.s 4 + box !1 + brfalse L_2 + + ldloca.s 4 + initobj !1 + ldloc.s 4 + br.s L_3 + +L_2: + call !!0 class [mscorlib]System.Activator::CreateInstance () +L_3: + box !1 + stloc.1 + ldloca.s 5 + initobj !2 + ldloc.s 5 + box !2 + brfalse L_4 + + ldloca.s 5 + initobj !2 + ldloc.s 5 + br.s L_5 + +L_4: + call !!0 class [mscorlib]System.Activator::CreateInstance () +L_5: + box !2 + stloc.2 + ret + } +} +} + +.namespace test2 +{ +.class private auto ansi beforefieldinit MainClass extends [mscorlib]System.Object implements [mscorlib]System.IDisposable { + .method public hidebysig specialname rtspecialname instance default void '.ctor' () cil managed + { + .maxstack 8 + ldarg.0 + call instance void object::'.ctor'() + ret + } + + .method public final virtual hidebysig newslot instance default void Dispose () cil managed + { + .maxstack 8 + ret + } + + .method private static hidebysig default void Main () cil managed + { + .entrypoint + .maxstack 8 + newobj instance void class test2.Test`3::'.ctor'() + callvirt instance void class test2.Test`3::Method() + ret + } +} +} + diff --git a/mono/tests/verifier/valid_dependent_generic_constraint_and_boxing.il b/mono/tests/verifier/valid_dependent_generic_constraint_and_boxing.il new file mode 100644 index 000000000..aff12b128 --- /dev/null +++ b/mono/tests/verifier/valid_dependent_generic_constraint_and_boxing.il @@ -0,0 +1,125 @@ +.assembly extern mscorlib +{ + .ver 2:0:0:0 + .publickeytoken = (B7 7A 5C 56 19 34 E0 89 ) // .z\V.4.. +} +.assembly 'gtest-514' +{ + .custom instance void class [mscorlib]System.Runtime.CompilerServices.RuntimeCompatibilityAttribute::'.ctor'() = ( + 01 00 01 00 54 02 16 57 72 61 70 4E 6F 6E 45 78 // ....T..WrapNonEx + 63 65 70 74 69 6F 6E 54 68 72 6F 77 73 01 ) // ceptionThrows. + + .hash algorithm 0x00008004 + .ver 0:0:0:0 +} +.module 'broken.exe' + + +.namespace test2 +{ +.class public auto ansi beforefieldinit Test`3< + .ctor (!U) T, + .ctor (!V) U, + .ctor (class [mscorlib]System.IDisposable) V> + extends [mscorlib]System.Object +{ + .method public hidebysig specialname rtspecialname instance default void '.ctor' () cil managed + { + .maxstack 8 + ldarg.0 + call instance void object::'.ctor'() + ret + } + + .method public hidebysig + instance default void Method () cil managed + { + .maxstack 8 + .locals init ( + class [mscorlib]System.IDisposable V_0, + class [mscorlib]System.IDisposable V_1, + class [mscorlib]System.IDisposable V_2, + !T V_3, + !U V_4, + !V V_5) + ldloca.s 3 + initobj !0 + ldloc.3 + box !0 + brfalse L_0 + + ldloca.s 3 + initobj !0 + ldloc.3 + br.s L_1 + +L_0: + call !!0 class [mscorlib]System.Activator::CreateInstance () +L_1: + box !0 + stloc.0 + ldloca.s 4 + initobj !1 + ldloc.s 4 + box !1 + brfalse L_2 + + ldloca.s 4 + initobj !1 + ldloc.s 4 + br.s L_3 + +L_2: + call !!0 class [mscorlib]System.Activator::CreateInstance () +L_3: + box !1 + stloc.1 + ldloca.s 5 + initobj !2 + ldloc.s 5 + box !2 + brfalse L_4 + + ldloca.s 5 + initobj !2 + ldloc.s 5 + br.s L_5 + +L_4: + call !!0 class [mscorlib]System.Activator::CreateInstance () +L_5: + box !2 + stloc.2 + ret + } +} +} + +.namespace test2 +{ +.class private auto ansi beforefieldinit MainClass extends [mscorlib]System.Object implements [mscorlib]System.IDisposable { + .method public hidebysig specialname rtspecialname instance default void '.ctor' () cil managed + { + .maxstack 8 + ldarg.0 + call instance void object::'.ctor'() + ret + } + + .method public final virtual hidebysig newslot instance default void Dispose () cil managed + { + .maxstack 8 + ret + } + + .method private static hidebysig default void Main () cil managed + { + .entrypoint + .maxstack 8 + newobj instance void class test2.Test`3::'.ctor'() + callvirt instance void class test2.Test`3::Method() + ret + } +} +} + -- 2.11.4.GIT