Author: kumpera
Date: 2007-12-11 19:46:59 -0500 (Tue, 11 Dec 2007)
New Revision: 91135

Added:
   trunk/mono/mono/tests/verifier/make_rethrow_test.sh
Modified:
   trunk/mono/mono/tests/verifier/ChangeLog
   trunk/mono/mono/tests/verifier/make_tests.sh
Log:
2007-12-11 Rodrigo Kumpera <[EMAIL PROTECTED]>

        * make_test.sh: added tests for rethrow
        * make_rethrow_test.sh: new test generator



Modified: trunk/mono/mono/tests/verifier/ChangeLog
===================================================================
--- trunk/mono/mono/tests/verifier/ChangeLog    2007-12-11 22:46:09 UTC (rev 
91134)
+++ trunk/mono/mono/tests/verifier/ChangeLog    2007-12-12 00:46:59 UTC (rev 
91135)
@@ -1,9 +1,13 @@
 2007-12-11 Rodrigo Kumpera <[EMAIL PROTECTED]>
 
+       * make_test.sh: added tests for rethrow
+       * make_rethrow_test.sh: new test generator
+
+2007-12-11 Rodrigo Kumpera <[EMAIL PROTECTED]>
+
        * make_test.sh: added tests for throw
        * make_throw_test.sh: new test generator
 
-
 2007-12-07 Rodrigo Kumpera <[EMAIL PROTECTED]>
 
        * make_test.sh: added tests for castclass and isinst

Added: trunk/mono/mono/tests/verifier/make_rethrow_test.sh
===================================================================
--- trunk/mono/mono/tests/verifier/make_rethrow_test.sh 2007-12-11 22:46:09 UTC 
(rev 91134)
+++ trunk/mono/mono/tests/verifier/make_rethrow_test.sh 2007-12-12 00:46:59 UTC 
(rev 91135)
@@ -0,0 +1,107 @@
+#! /bin/sh
+
+TEST_NAME=$1
+TEST_VALIDITY=$2
+TEST_POS=$3
+# Only 1 TEST_OP variable should be set.
+
+
+declare OPCODE_${TEST_POS}="rethrow"
+
+
+TEST_NAME=${TEST_VALIDITY}_${TEST_NAME}
+TEST_FILE=${TEST_NAME}_generated.il
+echo $TEST_FILE
+sed -e "s/VALIDITY/${TEST_VALIDITY}/g" -e "s/LOCAL/${TEST_LOCAL}/g" > 
$TEST_FILE <<//EOF
+// VALIDITY
+
+.assembly '${TEST_NAME}_generated'
+{
+  .hash algorithm 0x00008004
+  .ver  0:0:0:0
+}
+
+.method public static int32 Main() cil managed
+{
+       .entrypoint
+       .maxstack 2
+       ${OPCODE_1}
+       .try
+       {
+               nop
+               ${OPCODE_2}
+               leave END
+        }
+        catch [mscorlib]System.NullReferenceException 
+       {
+               pop
+               ${OPCODE_3}
+               .try
+               {
+                       nop
+                       ${OPCODE_4}
+                       leave END
+               }
+               catch [mscorlib]System.NullReferenceException 
+               {
+                       pop
+                       ${OPCODE_5}
+                       leave END
+               }
+
+
+               .try 
+               {
+                       nop
+                       leave END
+               }
+               filter
+               {
+                       pop
+                       ${OPCODE_6}
+                       ldc.i4.0
+                       endfilter
+               }
+               {
+                       nop
+                       ${OPCODE_7}
+                       leave END
+               }
+
+               leave END
+        }
+       .try
+       {
+               nop
+               leave END
+       }
+       finally
+       {
+               nop
+               ${OPCODE_8}
+               endfinally
+       }
+
+       .try 
+       {
+               nop
+               leave END
+       }
+       filter
+       {
+               pop
+               ${OPCODE_9}
+               ldc.i4.0
+               endfilter
+       }
+       {
+               nop
+               ${OPCODE_10}
+               leave END
+       }
+
+END:
+       ldc.i4.0
+       ret
+}
+//EOF


Property changes on: trunk/mono/mono/tests/verifier/make_rethrow_test.sh
___________________________________________________________________
Name: svn:executable
   + *

Modified: trunk/mono/mono/tests/verifier/make_tests.sh
===================================================================
--- trunk/mono/mono/tests/verifier/make_tests.sh        2007-12-11 22:46:09 UTC 
(rev 91134)
+++ trunk/mono/mono/tests/verifier/make_tests.sh        2007-12-12 00:46:59 UTC 
(rev 91135)
@@ -3158,3 +3158,16 @@
 done
 
 
+# Exception block branch tests (see 3.15)
+
+for I in {1..2};
+do
+       ./make_rethrow_test.sh rethrow_from_catch_${I} invalid ${I}
+done
+
+for I in {3..10};
+do
+       ./make_rethrow_test.sh rethrow_from_catch_${I} valid ${I}
+done
+
+

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

Reply via email to