2008-06-04 Mark Probst <mark.probst@gmail.com>
authorMark Probst <mark.probst@gmail.com>
Wed, 4 Jun 2008 20:33:42 +0000 (20:33 -0000)
committerMark Probst <mark.probst@gmail.com>
Wed, 4 Jun 2008 20:33:42 +0000 (20:33 -0000)
* 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
mono/tests/Makefile.am
mono/tests/generic-array-exc.2.il [new file with mode: 0644]

index aaf88df44c9aeb00710fa694b9f020390424f270..5ba48866a3e56fcb241003957d47937a03a9fad8 100644 (file)
@@ -1,3 +1,10 @@
+2008-06-04  Mark Probst  <mark.probst@gmail.com>
+
+       * generic-array-exc.2.il: Test case for generic array type in
+       catch clause.
+
+       * Makefile.am: Test added.
+
 2008-06-04  Mark Probst  <mark.probst@gmail.com>
 
        * generic-tailcall2.2.il: Test case for tailcalls from non-generic
index 54826c02f6c815b563ea32fe5d37ecf2e4570ffd..d9b0ae778c19a87db656f95518e27fb95fe562bc 100644 (file)
@@ -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 (file)
index 0000000..875c93e
--- /dev/null
@@ -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<T>
+       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<T>
+       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<class ClassA>       V_0,
+               int32   V_1)
+       IL_0000:  newobj instance void class Gen`1<class ClassA>::.ctor()
+       IL_0005:  stloc.0 
+       .try { // 0
+         IL_0006:  ldloc.0 
+         IL_0007:  callvirt instance void class Gen`1<class ClassA>::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
+