Author: kumpera
Date: 2007-12-20 07:37:27 -0500 (Thu, 20 Dec 2007)
New Revision: 91697

Added:
   trunk/mono/mono/tests/verifier/valid_exception_sequence.il
Modified:
   trunk/mono/mono/tests/verifier/ChangeLog
Log:
2007-12-20 Rodrigo Kumpera <[EMAIL PROTECTED]>

        *valid_exception_sequence.il: new test
        for what blocks take an exception on
        stack at the begin.



Modified: trunk/mono/mono/tests/verifier/ChangeLog
===================================================================
--- trunk/mono/mono/tests/verifier/ChangeLog    2007-12-20 12:28:19 UTC (rev 
91696)
+++ trunk/mono/mono/tests/verifier/ChangeLog    2007-12-20 12:37:27 UTC (rev 
91697)
@@ -1,3 +1,9 @@
+2007-12-20 Rodrigo Kumpera <[EMAIL PROTECTED]>
+
+       *valid_exception_sequence.il: new test
+       for what blocks take an exception on
+       stack at the begin.
+
 2007-12-19 Rodrigo Kumpera <[EMAIL PROTECTED]>
 
        * invalid_empty_catch_block.il

Added: trunk/mono/mono/tests/verifier/valid_exception_sequence.il
===================================================================
--- trunk/mono/mono/tests/verifier/valid_exception_sequence.il  2007-12-20 
12:28:19 UTC (rev 91696)
+++ trunk/mono/mono/tests/verifier/valid_exception_sequence.il  2007-12-20 
12:37:27 UTC (rev 91697)
@@ -0,0 +1,115 @@
+
+// valid CIL which breaks the ECMA-335 rules. 
+// this CIL should fail verification by a conforming CLI verifier.
+
+.assembly 'valid_branch_inside_same_block_1_generated'
+{
+  .hash algorithm 0x00008004
+  .ver  0:0:0:0
+}
+
+.class ClassA
+       extends [mscorlib]System.Object
+{
+}
+
+.class sealed MyValueType
+       extends [mscorlib]System.ValueType
+{
+       .field private int32 v
+}
+
+.class public Template`1<T>
+       extends [mscorlib]System.Object
+{
+}
+
+.class sealed public ValueTypeTemplate`1<T>
+       extends [mscorlib]System.ValueType
+{
+       .field private int32 v
+}
+
+.method public static int32 Main() cil managed
+{
+        .entrypoint
+        .maxstack 8
+       .locals init (object _X0)
+ 
+       br BLOCK_1
+        ldc.i4 0x7FFFFFFF
+       pop
+
+BLOCK_1:
+       nop
+       .try {
+               nop
+               newobj instance void class [mscorlib]System.Exception::.ctor()
+               throw
+               nop
+IN_TRY:
+BLOCK_2:
+               leave END
+       } catch [mscorlib]System.Exception {
+               stloc.0
+               ldstr "----catch {0}"
+               ldloc.0
+               call void class [mscorlib]System.Console::WriteLine(string, 
object)
+               
+               nop
+IN_CATCH:
+BLOCK_3:
+               nop
+               leave HERE
+       }
+
+HERE:
+       .try {
+               leave HERE_2
+       } finally {
+               nop
+               
+               nop
+IN_FINALLY:
+BLOCK_4:
+               nop
+               endfinally
+       }
+
+HERE_2:
+       .try {
+               newobj instance void class [mscorlib]System.Exception::.ctor()
+               throw
+               leave END
+       } filter {
+               stloc.0
+               ldstr "---filter {0}"
+               ldloc.0
+               call void class [mscorlib]System.Console::WriteLine(string, 
object)
+               nop
+               
+               nop
+IN_FILTER:
+BLOCK_5:
+               nop
+               ldc.i4.1
+               endfilter
+       }
+       {
+               stloc.0
+               ldstr "---handler {0}"
+               ldloc.0
+               call void class [mscorlib]System.Console::WriteLine(string, 
object)
+               nop
+               
+               nop
+IN_HANDLER:
+BLOCK_6:
+               nop
+               leave END
+       }
+
+END:
+        ldc.i4.0
+        ret
+}

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

Reply via email to