From 614ef7dd59cf46897dc493e818a545454c7a2c13 Mon Sep 17 00:00:00 2001 From: Mark Probst Date: Wed, 4 Jun 2008 20:33:42 +0000 Subject: [PATCH] 2008-06-04 Mark Probst * generic-array-exc.2.il: Test case for generic array type in catch clause. * Makefile.am: Test added. svn path=/trunk/mono/; revision=104926 --- mono/tests/ChangeLog | 7 ++ mono/tests/Makefile.am | 6 +- mono/tests/generic-array-exc.2.il | 187 ++++++++++++++++++++++++++++++ 3 files changed, 198 insertions(+), 2 deletions(-) create mode 100644 mono/tests/generic-array-exc.2.il diff --git a/mono/tests/ChangeLog b/mono/tests/ChangeLog index aaf88df44c9..5ba48866a3e 100644 --- a/mono/tests/ChangeLog +++ b/mono/tests/ChangeLog @@ -1,3 +1,10 @@ +2008-06-04 Mark Probst + + * generic-array-exc.2.il: Test case for generic array type in + catch clause. + + * Makefile.am: Test added. + 2008-06-04 Mark Probst * generic-tailcall2.2.il: Test case for tailcalls from non-generic diff --git a/mono/tests/Makefile.am b/mono/tests/Makefile.am index 54826c02f6c..d9b0ae778c1 100644 --- a/mono/tests/Makefile.am +++ b/mono/tests/Makefile.am @@ -373,7 +373,8 @@ TEST_IL_SRC= \ generic-ldtoken-method.2.il \ generic-ldtoken-field.2.il \ generic-tailcall.2.il \ - generic-tailcall2.2.il + generic-tailcall2.2.il \ + generic-array-exc.2.il # bug-318677.il @@ -699,7 +700,8 @@ test-generic-sharing : generics-sharing.2.exe shared-generic-methods.2.exe \ generic-virtual.2.exe generic-tailcall.2.exe \ generic-interface-methods.2.exe generic-array-type.2.exe \ generic-method-patching.2.exe \ - generic-null-call.2.exe generic-tailcall2.2.exe + generic-null-call.2.exe generic-tailcall2.2.exe \ + generic-array-exc.2.exe for fn in $+ ; do \ echo "Testing $$fn ..."; \ MONO_GENERIC_SHARING=all $(RUNTIME) -O=gshared,-inline $$fn || exit 1; \ diff --git a/mono/tests/generic-array-exc.2.il b/mono/tests/generic-array-exc.2.il new file mode 100644 index 00000000000..875c93ef90c --- /dev/null +++ b/mono/tests/generic-array-exc.2.il @@ -0,0 +1,187 @@ +.assembly extern mscorlib +{ + .ver 2:0:0:0 + .publickeytoken = (B7 7A 5C 56 19 34 E0 89 ) // .z\V.4.. +} +.assembly 'generic-array-exc.2' +{ + .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 'generic-array-exc.2.exe' // GUID = {770295FB-70A6-4755-9969-EFE664D15786} + + + .class public auto ansi beforefieldinit ClassA + extends [mscorlib]System.Object + { + + // method line 1 + .method public hidebysig specialname rtspecialname + instance default void .ctor () cil managed + { + // Method begins at RVA 0x20ec + // Code size 7 (0x7) + .maxstack 8 + IL_0000: ldarg.0 + IL_0001: call instance void object::.ctor() + IL_0006: ret + } // end of method ClassA::.ctor + + } // end of class ClassA + + .class public auto ansi beforefieldinit GenExc`1 + extends [mscorlib]System.Exception + { + + // method line 2 + .method public hidebysig specialname rtspecialname + instance default void .ctor () cil managed + { + // Method begins at RVA 0x20f4 + // Code size 7 (0x7) + .maxstack 8 + IL_0000: ldarg.0 + IL_0001: call instance void class [mscorlib]System.Exception::.ctor() + IL_0006: ret + } // end of method GenExc`1::.ctor + + } // end of class GenExc`1 + + .class public auto ansi beforefieldinit NonGen + extends [mscorlib]System.Object + { + + // method line 3 + .method public hidebysig specialname rtspecialname + instance default void .ctor () cil managed + { + // Method begins at RVA 0x20fc + // Code size 7 (0x7) + .maxstack 8 + IL_0000: ldarg.0 + IL_0001: call instance void object::.ctor() + IL_0006: ret + } // end of method NonGen::.ctor + + // method line 4 + .method public static hidebysig + default void doThrow () cil managed + { + // Method begins at RVA 0x2104 + // Code size 6 (0x6) + .maxstack 8 + IL_0000: ldc.i4.3 + IL_0001: newarr ClassA + IL_0005: throw + } // end of method NonGen::doThrow + + // method line 5 + .method public static hidebysig + default object newArr () cil managed + { + // Method begins at RVA 0x210c + // Code size 7 (0x7) + .maxstack 8 + IL_0000: ldc.i4.3 + IL_0001: newarr ClassA + IL_0006: ret + } // end of method NonGen::newArr + + } // end of class NonGen + + .class public auto ansi beforefieldinit Gen`1 + extends [mscorlib]System.Object + { + + // method line 6 + .method public hidebysig specialname rtspecialname + instance default void .ctor () cil managed + { + // Method begins at RVA 0x2114 + // Code size 7 (0x7) + .maxstack 8 + IL_0000: ldarg.0 + IL_0001: call instance void object::.ctor() + IL_0006: ret + } // end of method Gen`1::.ctor + + // method line 7 + .method public hidebysig + instance default void except () cil managed + { + // Method begins at RVA 0x211c + // Code size 17 (0x11) + .maxstack 1 + .try { // 0 + IL_0000: call void class NonGen::doThrow() + IL_0005: leave IL_0010 + + } // end .try 0 + catch !0[] { // 0 + IL_000a: pop + IL_000b: leave IL_0010 + + } // end handler 0 + IL_0010: ret + } // end of method Gen`1::except + + } // end of class Gen`1 + + .class public auto ansi beforefieldinit main + extends [mscorlib]System.Object + { + + // method line 8 + .method public hidebysig specialname rtspecialname + instance default void .ctor () cil managed + { + // Method begins at RVA 0x2158 + // Code size 7 (0x7) + .maxstack 8 + IL_0000: ldarg.0 + IL_0001: call instance void object::.ctor() + IL_0006: ret + } // end of method main::.ctor + + // method line 9 + .method public static hidebysig + default int32 Main () cil managed + { + // Method begins at RVA 0x2160 + .entrypoint + // Code size 44 (0x2c) + .maxstack 4 + .locals init ( + class Gen`1 V_0, + int32 V_1) + IL_0000: newobj instance void class Gen`1::.ctor() + IL_0005: stloc.0 + .try { // 0 + IL_0006: ldloc.0 + IL_0007: callvirt instance void class Gen`1::except() + IL_000c: leave IL_0028 + + } // end .try 0 + catch class ClassA[] { // 0 + IL_0011: pop + IL_0012: ldstr "exception not caught" + IL_0017: call void class [mscorlib]System.Console::WriteLine(string) + IL_001c: ldc.i4.1 + IL_001d: stloc.1 + IL_001e: leave IL_002a + + IL_0023: leave IL_0028 + + } // end handler 0 + IL_0028: ldc.i4.0 + IL_0029: ret + IL_002a: ldloc.1 + IL_002b: ret + } // end of method main::Main + + } // end of class main + -- 2.25.1