[tests/verifier] Fix a few issues in the Makefile
[mono.git] / mono / tests / verifier / make_tests.sh
index 8ba3f2d253536e4816c52e2958e564700efbc21e..25dd54a92576e995e679a27356d15ee6c9f19bea 100755 (executable)
@@ -25,7 +25,7 @@ done
 I=1
 for OP in add div mul rem sub
 do
-  if [ "$OP" == "div" ] || [ "$OP" == "rem" ]; then
+  if [ "$OP" = "div" ] || [ "$OP" = "rem" ]; then
        INIT="yes";
   else
        INIT="no";
@@ -92,7 +92,7 @@ done
 I=1
 for OP in div mul rem
 do
-  if [ "$OP" == "div" ] || [ "$OP" == "div" ]; then
+  if [ "$OP" = "div" ] || [ "$OP" = "div" ]; then
        INIT="yes";
   else
        INIT="no";
@@ -112,7 +112,7 @@ done
 I=1
 for OP in div mul rem add
 do
-  if [ "$OP" == "div" ] || [ "$OP" == "div" ]; then
+  if [ "$OP" = "div" ] || [ "$OP" = "div" ]; then
        INIT="yes";
   else
        INIT="no";
@@ -189,6 +189,7 @@ do
        ./make_bin_test.sh bin_cgt_un_a_${I} unverifiable 'cgt.un' "${TYPE}" 'object'
        ./make_bin_test.sh bin_cgt_un_b_${I} unverifiable 'cgt.un' 'object' "${TYPE}"
   I=`expr $I + 1`
+done
 
 for OP in ceq
 do
@@ -320,15 +321,19 @@ do
     I=`expr $I + 1`
   done
 
-  for TYPE in 'object' 'string' 'class Class' 'valuetype MyStruct' 'int32[]' 'int32[,]' 'typedref' 'int32*' 'method int32 *(int32)' 'class Template`1<object>' 'int8&' 'bool&' 'unsigned int8&' 'int16&' 'char&' 'unsigned int16&' 'int32&' 'unsigned int32&' 'int64&' 'unsigned int64&' 'float32&' 'float64&' 'native int&' 'native unsigned int&' 'object&' 'string&' 'class Class&' 'valuetype MyStruct&' 'int32[]&' 'int32[,]&' 'typedref&'  'class Template`1<object>&'
+  for TYPE in 'object' 'string' 'class Class' 'valuetype MyStruct' 'int32[]' 'int32[,]' 'typedref' 'int32*' 'method int32 *(int32)' 'class Template`1<object>' 'int8&' 'bool&' 'unsigned int8&' 'int16&' 'char&' 'unsigned int16&' 'int32&' 'unsigned int32&' 'int64&' 'unsigned int64&' 'float32&' 'float64&' 'native int&' 'native unsigned int&' 'object&' 'string&' 'class Class&' 'valuetype MyStruct&' 'int32[]&' 'int32[,]&' 'class Template`1<object>&'
   do
     ./make_unary_test.sh conv_op_${J}_${I} unverifiable $OP "$TYPE"
     I=`expr $I + 1`
   done
+
+  ./make_unary_test.sh conv_op_${J}_${I} invalid $OP "typedref&"
   J=`expr $J + 1`
   I=1
 done
 
+
+
 #local and argument store with invalid values lead to unverifiable code
 I=1
 for OP in stloc.0 "stloc.s 0" "starg 0" "starg.s 0"
@@ -430,7 +435,7 @@ do
   ./make_store_test.sh coercion_78_${I} unverifiable "$OP" typedref 'native int'
   ./make_store_test.sh coercion_89_${I} unverifiable "$OP" typedref int64
   ./make_store_test.sh coercion_80_${I} unverifiable "$OP" typedref float64
-  ./make_store_test.sh coercion_81_${I} unverifiable "$OP" typedref 'typedref&'
+  ./make_store_test.sh coercion_81_${I} invalid "$OP" typedref 'typedref&'
   ./make_store_test.sh coercion_82_${I} unverifiable "$OP" typedref object
   I=`expr $I + 1`
 done
@@ -498,9 +503,9 @@ function fix () {
                A=$1;
        fi
 
-       if [ "$A" == "bool&" ]; then
+       if [ "$A" = "bool&" ]; then
                A="int8&";
-       elif [ "$A" == "char&" ]; then
+       elif [ "$A" = "char&" ]; then
                A="int16&";
        fi
 
@@ -517,11 +522,11 @@ do
                do
                        TA="$(fix $TYPE1)"
                        TB="$(fix $TYPE2)"
-                       if [ "$TA" == "$TB" ]; then
+                       if [ "$TA" = "$TB" ]; then
                                ./make_store_test.sh ref_coercion_${I} valid "$OP" "$TYPE1" "$TYPE2"
-                       elif [ "$TA" == "int32&" ] && [ "$TB" == "int&" ]; then
+                       elif [ "$TA" = "int32&" ] && [ "$TB" = "int&" ]; then
                                ./make_store_test.sh ref_coercion_${I} valid "$OP" "$TYPE1" "$TYPE2"
-                       elif [ "$TA" == "int&" ] && [ "$TB" == "int32&" ]; then
+                       elif [ "$TA" = "int&" ] && [ "$TB" = "int32&" ]; then
                                ./make_store_test.sh ref_coercion_${I} valid "$OP" "$TYPE1" "$TYPE2"
                        else
                                ./make_store_test.sh ref_coercion_${I} unverifiable "$OP" "$TYPE1" "$TYPE2"
@@ -540,7 +545,7 @@ do
                do
                        TA="$(fix $TYPE1)"
                        TB="$(fix $TYPE2)"
-                       if [ "$TA" == "$TB" ]; then
+                       if [ "$TA" = "$TB" ]; then
                                ./make_store_test.sh ref_coercion_${I} valid "$OP" "$TYPE1" "$TYPE2"
                        else
                                ./make_store_test.sh ref_coercion_${I} unverifiable "$OP" "$TYPE1" "$TYPE2"
@@ -556,7 +561,7 @@ do
        do
                for TYPE2 in 'class ClassA&' 'class ClassB&' 'class InterfaceA&' 'class InterfaceB&' 'class ValueType&'
                do
-                       if [ "$TYPE1" == "$TYPE2" ]; then
+                       if [ "$TYPE1" = "$TYPE2" ]; then
                                ./make_store_test.sh ref_coercion_${I} valid "$OP" "$TYPE1" "$TYPE2"
                        else
                                ./make_store_test.sh ref_coercion_${I} unverifiable "$OP" "$TYPE1" "$TYPE2"
@@ -786,17 +791,17 @@ do
        ZZ=`echo $TYPE2 | grep "*";`
        T2_PTR=$?
        
-    if (($T1_PTR == 0  ||  $T2_PTR == 0)); then
+    if [ $T1_PTR -eq 0 ] || [ $T2_PTR -eq 0 ]; then
                ./make_stack_merge_test.sh stack_merge_${I} unverifiable "$TYPE1" "$TYPE2"
-    elif [ "$TYPE1" == "$TYPE2" ]; then
+    elif [ "$TYPE1" = "$TYPE2" ]; then
                ./make_stack_merge_test.sh stack_merge_${I} valid "$TYPE1" "$TYPE2"
-       elif [ "$TYPE1" == "int32" ] && [ "$TYPE2" == "native int" ]; then
+       elif [ "$TYPE1" = "int32" ] && [ "$TYPE2" = "native int" ]; then
                ./make_stack_merge_test.sh stack_merge_${I} valid "$TYPE1" "$TYPE2"
-       elif [ "$TYPE1" == "native int" ] && [ "$TYPE2" == "int32" ]; then
+       elif [ "$TYPE1" = "native int" ] && [ "$TYPE2" = "int32" ]; then
                ./make_stack_merge_test.sh stack_merge_${I} valid "$TYPE1" "$TYPE2"
-       elif [ "$TYPE1" == "int32&" ] && [ "$TYPE2" == "native int&" ]; then
+       elif [ "$TYPE1" = "int32&" ] && [ "$TYPE2" = "native int&" ]; then
                ./make_stack_merge_test.sh stack_merge_${I} valid "$TYPE1" "$TYPE2"
-       elif [ "$TYPE1" == "native int&" ] && [ "$TYPE2" == "int32&" ]; then
+       elif [ "$TYPE1" = "native int&" ] && [ "$TYPE2" = "int32&" ]; then
                ./make_stack_merge_test.sh stack_merge_${I} valid "$TYPE1" "$TYPE2"
        else
                ./make_stack_merge_test.sh stack_merge_${I} unverifiable "$TYPE1" "$TYPE2"
@@ -1047,7 +1052,7 @@ done
 ./make_ret_test.sh ret_coercion_78 unverifiable typedref 'native int'
 ./make_ret_test.sh ret_coercion_79 unverifiable typedref int64
 ./make_ret_test.sh ret_coercion_80 unverifiable typedref float64
-./make_ret_test.sh ret_coercion_81 unverifiable typedref 'typedref&'
+./make_ret_test.sh ret_coercion_81 badmd typedref 'typedref&'
 ./make_ret_test.sh ret_coercion_82 unverifiable typedref object
 
 ./make_ret_test.sh ret_coercion_83 valid int32 "native int"
@@ -1330,7 +1335,7 @@ do
        MAX_PARAM_RESULT="unverifiable"
        POPS="pop\npop\npop\npop\npop\npop\npop\npop\n"
        
-       if [ "$OP" == "ldloc" ]; then
+       if [ "$OP" = "ldloc" ]; then
                MAX_PARAM_RESULT="invalid"
 
                LOCALS_1=$ARGS_1
@@ -1887,7 +1892,7 @@ function create_nesting_test_same_result () {
       do
         for LOAD in yes no
         do
-          if ! ( [ "$NESTED" == "no" ] && [ "$LOAD" == "yes" ] ) ; then
+          if ! ( [ "$NESTED" = "no" ] && [ "$LOAD" = "yes" ] ) ; then
             ./make_double_nesting_test.sh double_nesting_access_check_${K}_$I $2 "$OP" $3 $4 $5 "$BASE" "$NESTED" "$LOAD"
             K=`expr $K + 1`
           fi
@@ -1905,9 +1910,9 @@ function create_nesting_test_only_first_ok () {
       do
         for LOAD in yes no
         do
-          if ! ( [ "$NESTED" == "no" ] && [ "$LOAD" == "yes" ] ) ; then
+          if ! ( [ "$NESTED" = "no" ] && [ "$LOAD" = "yes" ] ) ; then
               EXPECT=unverifiable
-           if [ "$FIRST" == "$K" ]; then
+           if [ "$FIRST" = "$K" ]; then
               EXPECT=valid
            fi
            ./make_double_nesting_test.sh double_nesting_access_check_${K}_$I $EXPECT "$OP" $2 $3 $4 "$BASE" "$NESTED" "$LOAD"
@@ -2060,7 +2065,7 @@ function create_nesting_test_strips_result_static () {
     for NESTED in yes no
       do
         EXPECT=unverifiable
-        if [ "$NESTED" == "yes" ]; then
+        if [ "$NESTED" = "yes" ]; then
           EXPECT=valid
         fi
         ./make_double_nesting_test.sh double_nesting_access_check_${K}_$I $EXPECT "$OP" $2 $3 $4 "$BASE" "$NESTED" yes
@@ -2183,9 +2188,9 @@ function fix_ldobj () {
                A=$1;
        fi
 
-       if [ "$A" == "bool" ]; then
+       if [ "$A" = "bool" ]; then
                A="int8";
-       elif [ "$A" == "char" ]; then
+       elif [ "$A" = "char" ]; then
                A="int16";
        fi
 
@@ -2202,7 +2207,7 @@ do
        do
                TYPE1="$(fix_ldobj $T1)"
                TYPE2="$(fix_ldobj $T2)"
-               if [ "$TYPE1" == "$TYPE2" ] ; then
+               if [ "$TYPE1" = "$TYPE2" ] ; then
                        ./make_ldobj_test.sh ldobj_${I} valid "${T1}\&" "${T2}"
                else
                        ./make_ldobj_test.sh ldobj_${I} unverifiable "${T1}\&" "${T2}"
@@ -2217,13 +2222,18 @@ done
 #for T1 in "int8" "int64" "float64" "object" "string" "class Class" "int32[]" "int32[,]" "valuetype MyStruct" "valuetype MyStruct2" "int32 *" "valuetype MyStruct *" "method int32 *(int32)"
 for T1 in "native int" "int8*" "typedref" 
 do
-       for T2 in "int8" "int64" "float64" "object" "string" "class Class" "int32[]" "int32[,]" "valuetype MyStruct" "valuetype MyStruct2"   "int32 *" "valuetype MyStruct *" "method int32 *(int32)" "native int"  "typedref" "typedref\&" "class Template\`1<object>" "valuetype StructTemplate\`1<object>" "valuetype StructTemplate2\`1<object>"
+       for T2 in "int8" "int64" "float64" "object" "string" "class Class" "int32[]" "int32[,]" "valuetype MyStruct" "valuetype MyStruct2"   "int32 *" "valuetype MyStruct *" "method int32 *(int32)" "native int"  "typedref" "class Template\`1<object>" "valuetype StructTemplate\`1<object>" "valuetype StructTemplate2\`1<object>"
        do 
                ./make_ldobj_test.sh ldobj_${I} unverifiable "${T1}" "${T2}"
                I=`expr $I + 1`
        done
 done
 
+for T1 in "native int" "int8*" "typedref" 
+do
+       ./make_ldobj_test.sh ldobj_${I} invalid "${T1}" "typedref\&"
+       I=`expr $I + 1`
+done
 
 
 
@@ -2554,7 +2564,7 @@ I=1
 for TYPE1 in "int8" "bool" "int16" "char" "int32" "int64" "float64" "native int" "object" "string" "class Class" "valuetype MyStruct"  "int32[]" "int32[,]" "int32*" "method int32 *(int32)"  "class Template\`1<object>"
 do
        ./make_store_indirect_test.sh indirect_store_bad_addr_r4_${I} unverifiable "stind.r4" "${TYPE1}\&" "float32"
-       if [ "$TYPE1" == "float64" ]; then
+       if [ "$TYPE1" = "float64" ]; then
                ./make_store_indirect_test.sh indirect_store_good_val_r4_${I} valid "stind.r4" "float32\&" "${TYPE1}"
        else
                ./make_store_indirect_test.sh indirect_store_bad_val_r4_${I} unverifiable "stind.r4" "float32\&" "${TYPE1}"
@@ -2567,7 +2577,7 @@ I=1
 for TYPE1 in "int8" "bool" "int16" "char" "int32" "int64" "float32" "native int" "object" "string" "class Class" "valuetype MyStruct"  "int32[]" "int32[,]" "int32*" "method int32 *(int32)"  "class Template\`1<object>"
 do
        ./make_store_indirect_test.sh indirect_store_bad_addr_r8_${I} unverifiable "stind.r8" "${TYPE1}\&" "float64"
-       if [ "$TYPE1" == "float32" ]; then
+       if [ "$TYPE1" = "float32" ]; then
                ./make_store_indirect_test.sh indirect_store_good_val_r8_${I} valid "stind.r8" "float64\&" "${TYPE1}";
        else
                ./make_store_indirect_test.sh indirect_store_bad_val_r8_${I} unverifiable "stind.r8" "float64\&" "${TYPE1}";
@@ -3153,13 +3163,20 @@ done
 #token
 
 I=1
-for TOKEN in int32 int64 float32 float64 "valuetype MyStruct" "int32*" "typedref" "int32[]" "string" "method int32 *(int32)"
+for TOKEN in int32 int64 float32 float64 "valuetype MyStruct" "int32[]" "string"
 do
        ./make_cast_test.sh cast_token_${I} valid "object" "ldloc.0" "castclass $TOKEN"
        ./make_cast_test.sh isinst_token_${I} valid "object" "ldloc.0" "isinst $TOKEN"
        I=`expr $I + 1`
 done
 
+for TOKEN in "int32*" "method int32 *(int32)" "typedref"
+do
+       ./make_cast_test.sh cast_token_${I} unverifiable "object" "ldloc.0" "castclass $TOKEN"
+       ./make_cast_test.sh isinst_token_${I} unverifiable "object" "ldloc.0" "isinst $TOKEN"
+       I=`expr $I + 1`
+done
+
 for TOKEN in "int32\&"
 do
        ./make_cast_test.sh cast_token_${I} invalid "object" "ldloc.0" "castclass $TOKEN"
@@ -3206,30 +3223,34 @@ done
 
 # Exception block branch tests (see 2.19)
 
-for I in {1..2};
+I=1; while [ $I -le 2 ]
 do
        ./make_rethrow_test.sh rethrow_from_catch_${I} invalid ${I}
+       I=$((I + 1))
 done
 
-for I in {3..10};
+I=3; while [ $I -le 10 ]
 do
        ./make_rethrow_test.sh rethrow_from_catch_${I} valid ${I}
+       I=$((I + 1))
 done
 
 
 
 # endfinally / endfault
 
-for I in {1..7};
+I=1; while [ $I -le 7 ]
 do
        ./make_endfinally_test.sh endfinally_block_${I} invalid finally ${I}
        ./make_endfinally_test.sh endfault_block_${I} invalid fault ${I}
+       I=$((I + 1))
 done
 
-for I in {8..9};
+I=8; while [ $I -le 9 ]
 do
        ./make_endfinally_test.sh endfinally_block_${I} valid finally ${I}
        ./make_endfinally_test.sh endfault_block_${I} valid fault ${I}
+       I=$((I + 1))
 done
 
 #stack can have stuff and endfinally or endfault will just empty it
@@ -3251,7 +3272,7 @@ done
 ./make_endfilter_test.sh endfilter_inside_protected_block_3 invalid 3 "ldc.i4.1\n\t\tendfilter"
 ./make_endfilter_test.sh endfilter_inside_protected_block_5 strict 5 "ldc.i4.1\n\t\tendfilter"
 
-for I in {2,4,6};
+for I in 2 4 6;
 do
        ./make_endfilter_test.sh endfilter_inside_protected_block_${I} unverifiable ${I} "ldc.i4.1\n\t\tendfilter"
 done
@@ -3285,9 +3306,9 @@ EXTRA="ldloc.0\n\tbrfalse END"
 ./make_leave_test.sh "filter_block_test_1" valid "1" "leave END" "$EXTRA"
 
 #but not ok to leave finally or filter
-for I in {2..3};
-do
+I=2; while [ $I -le 3 ]; do
        ./make_leave_test.sh "filter_block_test_${I}" unverifiable "${I}" "leave END" "${EXTRA}_${I}"
+       I=$((I + 1))
 done
 
 #neither is to branch to invalid regions of code
@@ -3297,24 +3318,27 @@ done
 
 # br.X
 #valid tests
-for I in {1..6}; do
+I=1; while [ $I -le 6 ]; do
        ./make_branch_test.sh branch_inside_same_block_${I} valid ${I} "br BLOCK_${I}";
        ./make_branch_test.sh branch_inside_same_block_${I}_s valid ${I} "br.s BLOCK_${I}";
+       I=$((I + 1))
 done
 
 #branching outside of the protected block
-for I in {2..6}; do
+I=2; while [ $I -le 6 ]; do
        ./make_branch_test.sh branch_outside_protected_block_${I} unverifiable ${I} "br END";
+       I=$((I + 1))
 done
 
 #branching to a protected block from the outside
-for I in {2..6}; do
-       if [ "$I" == "4" ]; then
+I=2; while [ $I -le 6 ]; do
+       if [ $I -eq 4 ]; then
                ./make_branch_test.sh branch_inside_protected_block_from_outside_${I}_finally invalid 1 "br BLOCK_${I}" "finally";
                ./make_branch_test.sh branch_inside_protected_block_from_outside_${I}_fault invalid 1 "br BLOCK_${I}" "fault";
        else
                ./make_branch_test.sh branch_inside_protected_block_from_outside_${I} unverifiable 1 "br BLOCK_${I}";
        fi
+       I=$((I + 1))
 done
 
 
@@ -3332,25 +3356,28 @@ done
 #TODO test the encoding of the switch table
 # switch
 #valid tests
-for I in {1..6}; do
+I=1; while [ $I -le 6 ]; do
        ./make_switch_test.sh switch_inside_same_block_${I} valid ${I} "ldloc.0" "switch (BLOCK_${I}, BLOCK_${I}_B)";
+       I=$((I + 1))
 done
 
 ./make_switch_test.sh switch_with_native_int_on_stack valid 1 "ldloc.1" "switch (BLOCK_1, BLOCK_1_B)";
 
 #branching outside of the protected block
-for I in {2..6}; do
+I=2; while [ $I -le 6 ]; do
        ./make_switch_test.sh switch_outside_protected_block_${I} unverifiable ${I} "ldloc.0" "switch (END, BLOCK_1, BLOCK_1_B)";
+       I=$((I + 1))
 done
 
 #branching to a protected block from the outside
-for I in {2..6}; do
-       if [ "$I" == "4" ]; then
+I=2; while [ $I -le 6 ]; do
+       if [ $I -eq 4 ]; then
                ./make_switch_test.sh switch_inside_protected_block_from_outside_${I}_finally invalid 1 "ldloc.0" "switch (BLOCK_${I}, BLOCK_${I}_B)" "finally";
                ./make_switch_test.sh switch_inside_protected_block_from_outside_${I}_fault invalid 1 "ldloc.0" "switch (BLOCK_${I}, BLOCK_${I}_B)" "fault";
        else
                ./make_switch_test.sh switch_inside_protected_block_from_outside_${I} unverifiable 1 "ldloc.0" "switch (BLOCK_${I}, BLOCK_${I}_B)";
        fi
+       I=$((I + 1))
 done
 
 #TODO branching out of range (FIX ilasm first)
@@ -3660,13 +3687,13 @@ do
 done
 
 
-for TYPE in "int32*" "typedref" "method int32 *(int32)"
+for TYPE in "int32*" "method int32 *(int32)"
 do
        ./make_stobj_test.sh stobj_simple_${I} unverifiable "$TYPE" "$TYPE\&" "$TYPE" 
        I=`expr $I + 1`
 done
 
-for TYPE in "int32\&" "void"
+for TYPE in "int32\&" "void" "typedref"
 do
        ./make_stobj_test.sh stobj_simple_${I} invalid "$TYPE" "$TYPE\&" "$TYPE" 
        I=`expr $I + 1`
@@ -3784,14 +3811,14 @@ do
 done
 
 #should be able to use unmanaged types
-for TYPE in "int32*" "typedref" "method int32 *(int32)"
+for TYPE in "int32*" "method int32 *(int32)"
 do
        ./make_cpobj_test.sh cpobj_simple_${I} unverifiable "${TYPE}\&" "${TYPE}\&" "${TYPE}"
        I=`expr $I + 1`
 done
 
 #should be able to use invalid types
-for TYPE in "int32\&" "void"
+for TYPE in "int32\&" "void" "typedref"
 do
        ./make_cpobj_test.sh cpobj_simple_${I} invalid "${TYPE}\&" "${TYPE}\&" "${TYPE}"
        I=`expr $I + 1`
@@ -3824,12 +3851,14 @@ done
 
 #bad token type
 I=1
-for TYPE in "int32\&" "void"
+for TYPE in "int32\&"
 do
        ./make_cpobj_test.sh cpobj_bad_token_type_${I} invalid "int32\&" "int32\&" "${TYPE}"
        I=`expr $I + 1`
 done
 
+./make_cpobj_test.sh cpobj_bad_token_type_2 badmd "int32\&" "int32\&" "void"
+
 #src compat to token
 ./make_cpobj_test.sh cpobj_src_compat_1 valid "int32\&" "int32\&" "native int"
 ./make_cpobj_test.sh cpobj_src_compat_2 valid "native int\&" "int32\&" "int32"
@@ -3957,7 +3986,8 @@ do
 
        ./make_call_test.sh call_${I}_non_virtual_compat_this_1 valid "${CTYPE} instance void ClassA::Method1()" "newobj instance void ClassC::.ctor()"
        ./make_call_test.sh call_${I}_non_virtual_compat_this_2 valid "${CTYPE} instance void ClassC::Method1()" "newobj instance void ClassC::.ctor()"
-       ./make_call_test.sh call_${I}_non_virtual_compat_this_3 unverifiable "${CTYPE} instance void ClassC::Method1()" "newobj instance void ClassA::.ctor()"
+#This test passes peverify but fails under MS runtime due to a bug on their implementation of method token resolution.
+       ./make_call_test.sh call_${I}_non_virtual_compat_this_3 valid "${CTYPE} instance void ClassC::Method1()" "newobj instance void ClassA::.ctor()"
 
        ./make_call_test.sh call_${I}_final_virtual_method_1 valid "${CTYPE} instance void ClassC::VirtMethod()" "newobj instance void ClassC::.ctor()"
 
@@ -4134,7 +4164,8 @@ done
 
 #call conv
 ./make_delegate_compat_test.sh delegate_bad_cconv_1 unverifiable int32 int32 int32 int32 "default" "vararg"
-./make_delegate_compat_test.sh delegate_bad_cconv_2 unverifiable int32 int32 int32 int32 "vararg" "    "
+#This is invalid because we don't properly decode memberref signatures
+./make_delegate_compat_test.sh delegate_bad_cconv_2 invalid int32 int32 int32 int32 "vararg" " "
 
 #return type
 
@@ -4356,6 +4387,10 @@ for TYPE in object ClassNoDefaultCtor AbstractClass ClassWithDefaultCtorNotVisib
 do
        ./make_type_constraint_test.sh type_constraint_no_ct_$I valid "$TYPE" ""
        ./make_type_constraint_test.sh type_constraint_object_ct_$I valid "$TYPE" "(class [mscorlib]System.Object)"
+
+       ./make_method_constraint_test.sh method_constraint_no_ct_$I valid "$TYPE" ""
+       ./make_method_constraint_test.sh method_constraint_object_ct_$I valid "$TYPE" "(class [mscorlib]System.Object)"
+
        I=`expr $I + 1`
 done
 
@@ -4365,6 +4400,10 @@ for TYPE in object ClassNoDefaultCtor AbstractClass ClassWithDefaultCtorNotVisib
 do
        ./make_type_constraint_test.sh type_constraint_class_ct_$I valid "$TYPE" "class "
        ./make_type_constraint_test.sh type_constraint_class_object_ct_$I valid "$TYPE" "class (class [mscorlib]System.Object)"
+
+       ./make_method_constraint_test.sh method_constraint_class_ct_$I valid "$TYPE" "class "
+       ./make_method_constraint_test.sh method_constraint_class_object_ct_$I valid "$TYPE" "class (class [mscorlib]System.Object)"
+
        I=`expr $I + 1`
 done
 
@@ -4372,6 +4411,10 @@ for TYPE in "valuetype MyValueType" "valuetype [mscorlib]System.Nullable\`1<valu
 do
        ./make_type_constraint_test.sh type_constraint_class_ct_$I invalid "$TYPE" "class "
        ./make_type_constraint_test.sh type_constraint_class_object_ct_$I invalid "$TYPE" "class (class [mscorlib]System.Object)"
+
+       ./make_method_constraint_test.sh method_constraint_class_ct_$I invalid "$TYPE" "class "
+       ./make_method_constraint_test.sh method_constraint_class_object_ct_$I invalid "$TYPE" "class (class [mscorlib]System.Object)"
+
        I=`expr $I + 1`
 done
 
@@ -4381,6 +4424,10 @@ for TYPE in object AbstractClass ClassWithDefaultCtor IFaceImpl
 do
        ./make_type_constraint_test.sh type_constraint_class_ctor_ct_$I valid "$TYPE" "class .ctor"
        ./make_type_constraint_test.sh type_constraint_class_ctor_object_ct_$I valid "$TYPE" "class .ctor(class [mscorlib]System.Object)"
+
+       ./make_method_constraint_test.sh method_constraint_class_ctor_ct_$I valid "$TYPE" "class .ctor"
+       ./make_method_constraint_test.sh method_constraint_class_ctor_object_ct_$I valid "$TYPE" "class .ctor(class [mscorlib]System.Object)"
+
        I=`expr $I + 1`
 done
 
@@ -4388,6 +4435,10 @@ for TYPE in ClassNoDefaultCtor ClassWithDefaultCtorNotVisible "valuetype MyValue
 do
        ./make_type_constraint_test.sh type_constraint_class_ctor_ct_$I invalid "$TYPE" "class .ctor"
        ./make_type_constraint_test.sh type_constraint_class_ctor_object_ct_$I invalid "$TYPE" "class .ctor(class [mscorlib]System.Object)"
+
+       ./make_method_constraint_test.sh method_constraint_class_ctor_ct_$I invalid "$TYPE" "class .ctor"
+       ./make_method_constraint_test.sh method_constraint_class_ctor_object_ct_$I invalid "$TYPE" "class .ctor(class [mscorlib]System.Object)"
+
        I=`expr $I + 1`
 done
 
@@ -4397,6 +4448,10 @@ for TYPE in object ClassNoDefaultCtor AbstractClass ClassWithDefaultCtorNotVisib
 do
        ./make_type_constraint_test.sh type_constraint_vt_ct_$I invalid "$TYPE" "valuetype"
        ./make_type_constraint_test.sh type_constraint_vt_object_ct_$I invalid "$TYPE" "valuetype(class [mscorlib]System.Object)"
+
+       ./make_method_constraint_test.sh method_constraint_vt_ct_$I invalid "$TYPE" "valuetype"
+       ./make_method_constraint_test.sh method_constraint_vt_object_ct_$I invalid "$TYPE" "valuetype(class [mscorlib]System.Object)"
+
        I=`expr $I + 1`
 done
 
@@ -4404,6 +4459,10 @@ for TYPE in "valuetype MyValueType" "valuetype MyEnum"
 do
        ./make_type_constraint_test.sh type_constraint_vt_ct_$I valid "$TYPE" "valuetype"
        ./make_type_constraint_test.sh type_constraint_vt_object_ct_$I valid "$TYPE" "valuetype(class [mscorlib]System.Object)"
+
+       ./make_method_constraint_test.sh method_constraint_vt_ct_$I valid "$TYPE" "valuetype"
+       ./make_method_constraint_test.sh method_constraint_vt_object_ct_$I valid "$TYPE" "valuetype(class [mscorlib]System.Object)"
+
        I=`expr $I + 1`
 done
 
@@ -4413,6 +4472,10 @@ for TYPE in object ClassNoDefaultCtor AbstractClass ClassWithDefaultCtorNotVisib
 do
        ./make_type_constraint_test.sh type_constraint_vt_ctor_ct_$I invalid "$TYPE"  "valuetype .ctor"
        ./make_type_constraint_test.sh type_constraint_vt_ctor_object_ct_$I invalid "$TYPE"  "valuetype .ctor(class [mscorlib]System.Object)"
+
+       ./make_method_constraint_test.sh method_constraint_vt_ctor_ct_$I invalid "$TYPE"  "valuetype .ctor"
+       ./make_method_constraint_test.sh method_constraint_vt_ctor_object_ct_$I invalid "$TYPE"  "valuetype .ctor(class [mscorlib]System.Object)"
+
        I=`expr $I + 1`
 done
 
@@ -4420,6 +4483,10 @@ for TYPE in "valuetype MyValueType" "valuetype MyEnum"
 do
        ./make_type_constraint_test.sh type_constraint_vt_ctor_ct_$I valid "$TYPE"  "valuetype .ctor"
        ./make_type_constraint_test.sh type_constraint_vt_ctor_object_ct_$I valid "$TYPE"  "valuetype .ctor(class [mscorlib]System.Object)"
+
+       ./make_method_constraint_test.sh method_constraint_vt_ctor_ct_$I valid "$TYPE"  "valuetype .ctor"
+       ./make_method_constraint_test.sh method_constraint_vt_ctor_object_ct_$I valid "$TYPE"  "valuetype .ctor(class [mscorlib]System.Object)"
+
        I=`expr $I + 1`
 done
 
@@ -4429,6 +4496,10 @@ for TYPE in object AbstractClass ClassWithDefaultCtor "valuetype MyValueType" "v
 do
        ./make_type_constraint_test.sh type_constraint_ctor_ct_$I valid "$TYPE" ".ctor"
        ./make_type_constraint_test.sh type_constraint_ctor_object_ct_$I valid "$TYPE" ".ctor(class [mscorlib]System.Object)"
+
+       ./make_method_constraint_test.sh method_constraint_ctor_ct_$I valid "$TYPE" ".ctor"
+       ./make_method_constraint_test.sh method_constraint_ctor_object_ct_$I valid "$TYPE" ".ctor(class [mscorlib]System.Object)"
+
        I=`expr $I + 1`
 done
 
@@ -4436,6 +4507,10 @@ for TYPE in ClassNoDefaultCtor ClassWithDefaultCtorNotVisible "[mscorlib]System.
 do
        ./make_type_constraint_test.sh type_constraint_ctor_ct_$I invalid "$TYPE" ".ctor"
        ./make_type_constraint_test.sh type_constraint_ctor_object_ct_$I invalid "$TYPE" ".ctor(class [mscorlib]System.Object)"
+
+       ./make_method_constraint_test.sh method_constraint_ctor_ct_$I invalid "$TYPE" ".ctor"
+       ./make_method_constraint_test.sh method_constraint_ctor_object_ct_$I invalid "$TYPE" ".ctor(class [mscorlib]System.Object)"
+
        I=`expr $I + 1`
 done
 
@@ -4445,6 +4520,10 @@ for TYPE in object ClassNoDefaultCtor AbstractClass ClassWithDefaultCtorNotVisib
 do
        ./make_type_constraint_test.sh type_constraint_class_vt_ct_$I invalid "$TYPE" "class valuetype"
        ./make_type_constraint_test.sh type_constraint_class_vt_object_ct_$I invalid "$TYPE" "class valuetype(class [mscorlib]System.Object)"
+
+       ./make_method_constraint_test.sh method_constraint_class_vt_ct_$I invalid "$TYPE" "class valuetype"
+       ./make_method_constraint_test.sh method_constraint_class_vt_object_ct_$I invalid "$TYPE" "class valuetype(class [mscorlib]System.Object)"
+
        I=`expr $I + 1`
 done
 
@@ -4453,6 +4532,10 @@ for TYPE in ClassNoDefaultCtor AbstractClass ClassWithDefaultCtorNotVisible "[ms
 do
        ./make_type_constraint_test.sh type_constraint_class_vt_ctor_ct_$I invalid "$TYPE" "class valuetype .ctor"
        ./make_type_constraint_test.sh type_constraint_class_vt_ctor_object_ct_$I invalid "$TYPE" "class valuetype .ctor(class [mscorlib]System.Object)"
+
+       ./make_method_constraint_test.sh method_constraint_class_vt_ctor_ct_$I invalid "$TYPE" "class valuetype .ctor"
+       ./make_method_constraint_test.sh method_constraint_class_vt_ctor_object_ct_$I invalid "$TYPE" "class valuetype .ctor(class [mscorlib]System.Object)"
+
        I=`expr $I + 1`
 done
 
@@ -4462,12 +4545,18 @@ I=1
 for TYPE in "valuetype MyValueType" "valuetype [mscorlib]System.Nullable\`1<valuetype MyValueType>" "valuetype MyEnum"
 do
        ./make_type_constraint_test.sh type_constraint_system_valuetype_ctor_ct_$I valid "$TYPE" ".ctor (class [mscorlib]System.ValueType)"
+
+       ./make_method_constraint_test.sh method_constraint_system_valuetype_ctor_ct_$I valid "$TYPE" ".ctor (class [mscorlib]System.ValueType)"
+
        I=`expr $I + 1`
 done
 
 for TYPE in object ClassNoDefaultCtor AbstractClass ClassWithDefaultCtorNotVisible ClassWithDefaultCtor "[mscorlib]System.ValueType" "[mscorlib]System.Enum" IFace IFaceImpl
 do
        ./make_type_constraint_test.sh type_constraint_system_valuetype_ctor_ct_$I invalid "$TYPE" ".ctor (class [mscorlib]System.ValueType)"
+
+       ./make_method_constraint_test.sh method_constraint_system_valuetype_ctor_ct_$I invalid "$TYPE" ".ctor (class [mscorlib]System.ValueType)"
+
        I=`expr $I + 1`
 done
 
@@ -4476,12 +4565,18 @@ I=1
 for TYPE in "valuetype MyValueType" "valuetype MyEnum"
 do
        ./make_type_constraint_test.sh type_constraint_system_valuetype_vt_ct_$I valid "$TYPE" "valuetype(class [mscorlib]System.ValueType)"
+
+       ./make_method_constraint_test.sh method_constraint_system_valuetype_vt_ct_$I valid "$TYPE" "valuetype(class [mscorlib]System.ValueType)"
+
        I=`expr $I + 1`
 done
 
 for TYPE in object ClassNoDefaultCtor AbstractClass ClassWithDefaultCtorNotVisible ClassWithDefaultCtor  "valuetype [mscorlib]System.Nullable\`1<valuetype MyValueType>" "[mscorlib]System.ValueType" "[mscorlib]System.Enum" IFace IFaceImpl
 do
        ./make_type_constraint_test.sh type_constraint_system_valuetype_vt_ct_$I invalid "$TYPE" "valuetype(class [mscorlib]System.ValueType)"
+
+       ./make_method_constraint_test.sh method_constraint_system_valuetype_vt_ct_$I invalid "$TYPE" "valuetype(class [mscorlib]System.ValueType)"
+
        I=`expr $I + 1`
 done
 
@@ -4490,12 +4585,18 @@ I=1
 for TYPE in "valuetype MyValueType" "valuetype MyEnum"
 do
        ./make_type_constraint_test.sh type_constraint_system_valuetype_vt_ctor_ct_$I valid "$TYPE" "valuetype .ctor(class [mscorlib]System.ValueType)"
+
+       ./make_method_constraint_test.sh method_constraint_system_valuetype_vt_ctor_ct_$I valid "$TYPE" "valuetype .ctor(class [mscorlib]System.ValueType)"
+
        I=`expr $I + 1`
 done
 
 for TYPE in object ClassNoDefaultCtor AbstractClass ClassWithDefaultCtorNotVisible ClassWithDefaultCtor "valuetype [mscorlib]System.Nullable\`1<valuetype MyValueType>" "[mscorlib]System.ValueType" "[mscorlib]System.Enum" IFace IFaceImpl
 do
        ./make_type_constraint_test.sh type_constraint_system_valuetype_vt_ctor_ct_$I invalid "$TYPE" "valuetype .ctor(class [mscorlib]System.ValueType)"
+
+       ./make_method_constraint_test.sh method_constraint_system_valuetype_vt_ctor_ct_$I invalid "$TYPE" "valuetype .ctor(class [mscorlib]System.ValueType)"
+
        I=`expr $I + 1`
 done
 
@@ -4504,12 +4605,18 @@ I=1
 for TYPE in "valuetype MyValueType" "valuetype [mscorlib]System.Nullable\`1<valuetype MyValueType>" "[mscorlib]System.ValueType" "[mscorlib]System.Enum"  "valuetype MyEnum"
 do
        ./make_type_constraint_test.sh type_constraint_system_valuetype_ct_$I valid "$TYPE" "(class [mscorlib]System.ValueType)"
+
+       ./make_method_constraint_test.sh method_constraint_system_valuetype_ct_$I valid "$TYPE" "(class [mscorlib]System.ValueType)"
+
        I=`expr $I + 1`
 done
 
 for TYPE in object ClassNoDefaultCtor AbstractClass ClassWithDefaultCtorNotVisible ClassWithDefaultCtor IFace IFaceImpl
 do
        ./make_type_constraint_test.sh type_constraint_system_valuetype_ct_$I invalid "$TYPE" "(class [mscorlib]System.ValueType)"
+
+       ./make_method_constraint_test.sh method_constraint_system_valuetype_ct_$I invalid "$TYPE" "(class [mscorlib]System.ValueType)"
+
        I=`expr $I + 1`
 done
 
@@ -4518,12 +4625,18 @@ I=1
 for TYPE in object ClassNoDefaultCtor AbstractClass ClassWithDefaultCtorNotVisible ClassWithDefaultCtor "valuetype MyValueType" "valuetype [mscorlib]System.Nullable\`1<valuetype MyValueType>" IFace IFaceImpl "valuetype MyEnum"
 do
        ./make_type_constraint_test.sh type_constraint_system_valuetype_class_ct_$I invalid "$TYPE" "class (class [mscorlib]System.ValueType)"
+
+       ./make_method_constraint_test.sh method_constraint_system_valuetype_class_ct_$I invalid "$TYPE" "class (class [mscorlib]System.ValueType)"
+
        I=`expr $I + 1`
 done
 
 for TYPE in "[mscorlib]System.ValueType" "[mscorlib]System.Enum"
 do
        ./make_type_constraint_test.sh type_constraint_system_valuetype_class_ct_$I valid "$TYPE" "class (class [mscorlib]System.ValueType)"
+
+       ./make_method_constraint_test.sh method_constraint_system_valuetype_class_ct_$I valid "$TYPE" "class (class [mscorlib]System.ValueType)"
+
        I=`expr $I + 1`
 done
 
@@ -4532,6 +4645,9 @@ I=1
 for TYPE in object ClassNoDefaultCtor AbstractClass ClassWithDefaultCtorNotVisible ClassWithDefaultCtor "valuetype MyValueType" "valuetype [mscorlib]System.Nullable\`1<valuetype MyValueType>" "[mscorlib]System.ValueType" "[mscorlib]System.Enum" IFace IFaceImpl "valuetype MyEnum"
 do
        ./make_type_constraint_test.sh type_constraint_system_valuetype_class_ctor_ct_$I invalid "$TYPE" "class .ctor(class [mscorlib]System.ValueType)"
+
+       ./make_method_constraint_test.sh method_constraint_system_valuetype_class_ctor_ct_$I invalid "$TYPE" "class .ctor(class [mscorlib]System.ValueType)"
+
        I=`expr $I + 1`
 done
 
@@ -4543,6 +4659,11 @@ do
        ./make_type_constraint_test.sh type_constraint_system_enum_ctor_ct_$I valid "$TYPE" ".ctor (class [mscorlib]System.Enum)"
        ./make_type_constraint_test.sh type_constraint_system_enum_vt_ct_$I valid "$TYPE" "valuetype (class [mscorlib]System.Enum)"
        ./make_type_constraint_test.sh type_constraint_system_enum_vt_ctor_ct_$I valid "$TYPE" "valuetype .ctor(class [mscorlib]System.Enum)"
+
+       ./make_method_constraint_test.sh method_constraint_system_enum_ctor_ct_$I valid "$TYPE" ".ctor (class [mscorlib]System.Enum)"
+       ./make_method_constraint_test.sh method_constraint_system_enum_vt_ct_$I valid "$TYPE" "valuetype (class [mscorlib]System.Enum)"
+       ./make_method_constraint_test.sh method_constraint_system_enum_vt_ctor_ct_$I valid "$TYPE" "valuetype .ctor(class [mscorlib]System.Enum)"
+
        I=`expr $I + 1`
 done
 
@@ -4551,6 +4672,11 @@ do
        ./make_type_constraint_test.sh type_constraint_system_enum_ctor_ct_$I invalid "$TYPE" ".ctor (class [mscorlib]System.Enum)"
        ./make_type_constraint_test.sh type_constraint_system_enum_vt_ct_$I invalid "$TYPE" "valuetype (class [mscorlib]System.Enum)"
        ./make_type_constraint_test.sh type_constraint_system_enum_vt_ctor_ct_$I invalid "$TYPE" "valuetype .ctor(class [mscorlib]System.Enum)"
+
+       ./make_method_constraint_test.sh method_constraint_system_enum_ctor_ct_$I invalid "$TYPE" ".ctor (class [mscorlib]System.Enum)"
+       ./make_method_constraint_test.sh method_constraint_system_enum_vt_ct_$I invalid "$TYPE" "valuetype (class [mscorlib]System.Enum)"
+       ./make_method_constraint_test.sh method_constraint_system_enum_vt_ctor_ct_$I invalid "$TYPE" "valuetype .ctor(class [mscorlib]System.Enum)"
+
        I=`expr $I + 1`
 done
 
@@ -4559,12 +4685,18 @@ I=1
 for TYPE in "[mscorlib]System.Enum" "valuetype MyEnum"
 do
        ./make_type_constraint_test.sh type_constraint_system_enum_ct_$I valid "$TYPE" "(class [mscorlib]System.Enum)"
+
+       ./make_method_constraint_test.sh method_constraint_system_enum_ct_$I valid "$TYPE" "(class [mscorlib]System.Enum)"
+
        I=`expr $I + 1`
 done
 
 for TYPE in object ClassNoDefaultCtor AbstractClass ClassWithDefaultCtorNotVisible ClassWithDefaultCtor "valuetype MyValueType" "valuetype [mscorlib]System.Nullable\`1<valuetype MyValueType>" "[mscorlib]System.ValueType" IFace IFaceImpl
 do
        ./make_type_constraint_test.sh type_constraint_system_enum_ct_$I invalid "$TYPE" "(class [mscorlib]System.Enum)"
+
+       ./make_method_constraint_test.sh method_constraint_system_enum_ct_$I invalid "$TYPE" "(class [mscorlib]System.Enum)"
+
        I=`expr $I + 1`
 done
 
@@ -4573,12 +4705,18 @@ I=1
 for TYPE in "[mscorlib]System.Enum"
 do
        ./make_type_constraint_test.sh type_constraint_system_enum_class_ct_$I valid "$TYPE" "class (class [mscorlib]System.Enum)"
+
+       ./make_method_constraint_test.sh method_constraint_system_enum_class_ct_$I valid "$TYPE" "class (class [mscorlib]System.Enum)"
+
        I=`expr $I + 1`
 done
 
 for TYPE in object ClassNoDefaultCtor AbstractClass ClassWithDefaultCtorNotVisible ClassWithDefaultCtor "valuetype MyValueType" "valuetype [mscorlib]System.Nullable\`1<valuetype MyValueType>" "[mscorlib]System.ValueType" IFace IFaceImpl "valuetype MyEnum"
 do
        ./make_type_constraint_test.sh type_constraint_system_enum_class_ct_$I invalid "$TYPE" "class (class [mscorlib]System.Enum)"
+
+       ./make_method_constraint_test.sh method_constraint_system_enum_class_ct_$I invalid "$TYPE" "class (class [mscorlib]System.Enum)"
+
        I=`expr $I + 1`
 done
 
@@ -4587,6 +4725,9 @@ I=1
 for TYPE in object ClassNoDefaultCtor AbstractClass ClassWithDefaultCtorNotVisible ClassWithDefaultCtor "valuetype MyValueType" "valuetype [mscorlib]System.Nullable\`1<valuetype MyValueType>" "[mscorlib]System.ValueType" "[mscorlib]System.Enum" IFace IFaceImpl "valuetype MyEnum"
 do
        ./make_type_constraint_test.sh type_constraint_system_enum_class_ctor_ct_$I invalid "$TYPE" "class .ctor(class [mscorlib]System.Enum)"
+
+       ./make_method_constraint_test.sh method_constraint_system_enum_class_ctor_ct_$I invalid "$TYPE" "class .ctor(class [mscorlib]System.Enum)"
+
        I=`expr $I + 1`
 done
 
@@ -4595,12 +4736,18 @@ I=1
 for TYPE in IFace IFaceImpl
 do
        ./make_type_constraint_test.sh type_constraint_iface_ct_$I valid "$TYPE" "(IFace)"
+
+       ./make_method_constraint_test.sh method_constraint_iface_ct_$I valid "$TYPE" "(IFace)"
+
        I=`expr $I + 1`
 done
 
 for TYPE in object ClassNoDefaultCtor AbstractClass ClassWithDefaultCtorNotVisible ClassWithDefaultCtor "valuetype MyValueType" "valuetype [mscorlib]System.Nullable\`1<valuetype MyValueType>" "[mscorlib]System.ValueType" "[mscorlib]System.Enum" "valuetype MyEnum"
 do
        ./make_type_constraint_test.sh type_constraint_iface_ct_$I invalid "$TYPE" "(IFace)"
+
+       ./make_method_constraint_test.sh method_constraint_iface_ct_$I invalid "$TYPE" "(IFace)"
+
        I=`expr $I + 1`
 done
 
@@ -4748,3 +4895,271 @@ do
        ./make_overlapped_test.sh int_bad_aligned_$I valid 0 4 $I
 done
 
+#Tests for aligned overllaping reference fields.
+./make_overlapped_test.sh ref_only_overlapping_1 typeunverifiable 0 0 8 object
+./make_overlapped_test.sh ref_only_overlapping_2 invalid 0 1 8 object
+./make_overlapped_test.sh ref_only_overlapping_3 invalid 0 2 8 object
+./make_overlapped_test.sh ref_only_overlapping_4 typeunverifiable 0 0 8 "int8[]"
+./make_overlapped_test.sh ref_only_overlapping_5 invalid 0 0 8 int32
+
+#invalid opcodes
+I=166; while [ $I -le 178 ]
+do
+       ./make_bad_op_test.sh bad_op_$I invalid $I
+       I=$((I + 1))
+done
+
+
+I=187; while [ $I -le 193 ]
+do
+       ./make_bad_op_test.sh bad_op_$I invalid $I
+       I=$((I + 1))
+done
+
+I=196; while [ $I -le 207 ]
+do
+       ./make_bad_op_test.sh bad_op_$I invalid $I
+       I=$((I + 1))
+done
+
+I=225; while [ $I -le 253 ]
+do
+       ./make_bad_op_test.sh bad_op_$I invalid $I
+       I=$((I + 1))
+done
+
+./make_bad_op_test.sh bad_op_xff invalid 255
+
+
+I=35; while [ $I -le 255 ]
+do
+       ./make_bad_op_test.sh bad_op_with_prefix_$I invalid 0xFE $I
+       I=$((I + 1))
+done
+
+
+
+
+#interaction between boxed generic arguments and its constraints
+./make_boxed_genarg_test.sh boxed_genarg_cnstr_obj valid "constrained. !0 callvirt instance int32 object::GetHashCode()" "ldloca 0"
+./make_boxed_genarg_test.sh boxed_genarg_cnstr_iface valid "constrained. !0 callvirt instance void class IFace::Tst()" "ldloca 0"
+
+./make_boxed_genarg_test.sh boxed_genarg_delegate valid "ldvirtftn instance void class IFace::Tst()\n\tnewobj instance void class TstDelegate::'.ctor'(object, native int)" "ldloc.0\n\tbox !T\n\tdup"
+
+./make_boxed_genarg_test.sh boxed_genarg_stfld_arg valid "stfld IFace class DriverClass<!0>::ifField" "ldarg.0\n\tldloc.0\n\tbox !T"
+
+./make_boxed_genarg_test.sh boxed_genarg_stfld_this_1 valid "stfld int32 class BaseClass::fld" "ldloc.0\n\tbox !T\n\tldc.i4.1" "BaseClass"
+
+./make_boxed_genarg_test.sh boxed_genarg_stfld_this_2 unverifiable "stfld int32 class BaseClass::fld" "ldloc.0\n\tldc.i4.1" "BaseClass"
+
+./make_boxed_genarg_test.sh boxed_genarg_ldfld_1 valid "ldfld int32 class BaseClass::fld" "ldloc.0\n\tbox !T" "BaseClass"
+
+./make_boxed_genarg_test.sh boxed_genarg_ldfld_2 unverifiable "ldfld int32 class BaseClass::fld" "ldloc.0" "BaseClass"
+
+
+./make_boxed_genarg_test.sh boxed_genarg_initobj_1 unverifiable "initobj IFace" "ldloca 0"
+./make_boxed_genarg_test.sh boxed_genarg_initobj_2 unverifiable "initobj !0" "ldloca 1"
+
+./make_boxed_genarg_test.sh boxed_genarg_stobj_1 unverifiable "stobj IFace" "ldloca 0\n\tldloc.0\n\tbox !T"
+./make_boxed_genarg_test.sh boxed_genarg_stobj_2 unverifiable "stobj !0" "ldloca 0\n\tldloc.0\n\tbox !T"
+./make_boxed_genarg_test.sh boxed_genarg_stobj_3 valid "stobj IFace" "ldloca 1\n\tldloc.0\n\tbox !T"
+./make_boxed_genarg_test.sh boxed_genarg_stobj_4 unverifiable "stobj !0" "ldloca 1\n\tldloc.0\n\tbox !T"
+./make_boxed_genarg_test.sh boxed_genarg_stobj_5 valid "stobj !0" "ldloca 0\n\tldloc.0"
+
+./make_stobj_test.sh stobj_boxing_test_1 valid "int32" "int32\&" "int32" ""
+./make_stobj_test.sh stobj_boxing_test_2 unverifiable "int32" "int32\&" "int32" "box int32"
+./make_stobj_test.sh stobj_boxing_test_3 valid "object" "object\&" "object" "box object"
+
+./make_boxed_genarg_test.sh boxed_genarg_stind_ref_1 unverifiable "stind.ref" "ldloca 0\n\tldloc.0"
+./make_boxed_genarg_test.sh boxed_genarg_stind_ref_2 unverifiable "stind.ref" "ldloca 0\n\tldloc.0\n\tbox !T"
+
+./make_boxed_genarg_test.sh boxed_genarg_stind_ref_3 unverifiable "stind.ref" "ldloca 1\n\tldloc.0"
+./make_boxed_genarg_test.sh boxed_genarg_stind_ref_4 valid "stind.ref" "ldloca 1\n\tldloc.0\n\tbox !T"
+
+./make_boxed_genarg_test.sh boxed_genarg_stelem_1 unverifiable "stelem IFace" "ldloc.2\n\tldc.i4.0\n\tldloc.0\n\tbox !T"
+./make_boxed_genarg_test.sh boxed_genarg_stelem_2 unverifiable "stelem !0" "ldloc.2\n\tldc.i4.0\n\tldloc.0\n\tbox !T"
+
+./make_boxed_genarg_test.sh boxed_genarg_stelem_3 unverifiable "stelem IFace" "ldloc.2\n\tldc.i4.0\n\tldloc.1"
+./make_boxed_genarg_test.sh boxed_genarg_stelem_4 unverifiable "stelem !0" "ldloc.2\n\tldc.i4.0\n\tldloc.1"
+
+./make_boxed_genarg_test.sh boxed_genarg_stelem_5 valid "stelem IFace" "ldloc.3\n\tldc.i4.0\n\tldloc.0\n\tbox !T"
+./make_boxed_genarg_test.sh boxed_genarg_stelem_6 unverifiable "stelem !0" "ldloc.3\n\tldc.i4.0\n\tldloc.0\n\tbox !T"
+
+./make_boxed_genarg_test.sh boxed_genarg_stelem_7 valid "stelem IFace" "ldloc.3\n\tldc.i4.0\n\tldloc.1"
+./make_boxed_genarg_test.sh boxed_genarg_stelem_8 unverifiable "stelem !0" "ldloc.3\n\tldc.i4.0\n\tldloc.1"
+
+./make_boxed_genarg_test.sh boxed_genarg_stelem_9 unverifiable "stelem IFace" "ldloc.2\n\tldc.i4.0\n\tldloc.0"
+./make_boxed_genarg_test.sh boxed_genarg_stelem_10 valid "stelem !0" "ldloc.2\n\tldc.i4.0\n\tldloc.0"
+
+./make_boxed_genarg_test.sh boxed_genarg_stelem_11 unverifiable "stelem IFace" "ldloc.3\n\tldc.i4.0\n\tldloc.0"
+./make_boxed_genarg_test.sh boxed_genarg_stelem_12 unverifiable "stelem !0" "ldloc.3\n\tldc.i4.0\n\tldloc.0"
+
+
+./make_boxed_genarg_test.sh boxed_genarg_stack_merge_1 valid "pop\n\tldloc.1" "ldloc.1\n\tnewobj instance void object::.ctor()\n\tcallvirt instance int32 object::GetHashCode()\n\tbrtrue TARGET"
+
+
+./make_boxed_genarg_test.sh boxed_genarg_stack_merge_2 unverifiable "pop\n\tldloc.1" "ldloc.0\n\tnewobj instance void object::.ctor()\n\tcallvirt instance int32 object::GetHashCode()\n\tbrtrue TARGET"
+
+./make_boxed_genarg_test.sh boxed_genarg_stack_merge_3 valid "pop\n\tldloc.1" "ldloc.0\n\tbox !T\n\tnewobj instance void object::.ctor()\n\tcallvirt instance int32 object::GetHashCode()\n\tbrtrue TARGET"
+
+./make_boxed_genarg_test.sh boxed_genarg_stack_merge_4 unverifiable "pop\n\tldloc.1" "ldloc.0\n\tbox IFace\n\tnewobj instance void object::.ctor()\n\tcallvirt instance int32 object::GetHashCode()\n\tbrtrue TARGET"
+
+
+./make_boxed_genarg_test.sh boxed_genarg_stack_merge_5 unverifiable "pop\n\tldloc.0" "ldloc.1\n\tnewobj instance void object::.ctor()\n\tcallvirt instance int32 object::GetHashCode()\n\tbrtrue TARGET"
+
+./make_boxed_genarg_test.sh boxed_genarg_stack_merge_6 valid "pop\n\tldloc.0\n\tbox !T" "ldloc.1\n\tnewobj instance void object::.ctor()\n\tcallvirt instance int32 object::GetHashCode()\n\tbrtrue TARGET"
+
+./make_boxed_genarg_test.sh boxed_genarg_stack_merge_7 unverifiable "pop\n\tldloc.0\n\tbox IFace" "ldloc.1\n\tnewobj instance void object::.ctor()\n\tcallvirt instance int32 object::GetHashCode()\n\tbrtrue TARGET"
+
+
+
+#test for IL overflow
+
+for I in 0x0E 0x0F 0x10 0x11 0x12 0x13 0x1F 0x2B 0x2C 0x2D 0x2E 0x2F 0x30 0x31 0x32 0x33 0x34 0x35 0x36 0x37 0xDE 0xFE
+do
+       ./make_il_overflow_test.sh incomplete_op_${I} invalid $I
+done
+
+for I in 0x20 0x21 0x22 0x23 0x28 0x29 0x38 0x39 0x3A 0x3B 0x3C 0x3D 0x3E 0x3F 0x40 0x41 0x42 0x43 0x44 0x6F 0x70 0x71 0x72 0x73 0x74 0x75 0x79 0x7B 0x7C 0x7D 0x7E 0x7F 0x80 0x81 0x8D 0x8C 0x8F 0xA3 0xA4 0xA5 0xC2 0xC6 0xD0 0xDD
+do
+       ./make_il_overflow_test.sh incomplete_op_${I} invalid $I
+       ./make_il_overflow_test.sh incomplete_op_${I}_0x00 invalid $I 0x00
+       ./make_il_overflow_test.sh incomplete_op_${I}_0x00_0x00 invalid $I 0x00 0x00
+       ./make_il_overflow_test.sh incomplete_op_${I}_0x00_0x00_0x00 invalid $I 0x00 0x00
+done
+
+
+for I in 0x06 0x07 0x09 0x0A 0x0E 0x0B 0x0C 0x0D 0x12 0x15 0x16 0x19 0x1C
+do
+       ./make_il_overflow_test.sh incomplete_op_0xFE_${I} invalid 0xFE $I
+       ./make_il_overflow_test.sh incomplete_op_0xFE_${I}_0x00 invalid 0xFE $I 0x00
+done
+
+#switch
+./make_il_overflow_test.sh incomplete_switch_1 invalid 0x45
+./make_il_overflow_test.sh incomplete_switch_2 invalid 0x45 0x00
+./make_il_overflow_test.sh incomplete_switch_3 invalid 0x45 0x00 0x00
+./make_il_overflow_test.sh incomplete_switch_4 invalid 0x45 0x00 0x00
+
+./make_il_overflow_test.sh incomplete_switch_arg_1 invalid 0x45 0x00 0x00 0x00 0x01
+./make_il_overflow_test.sh incomplete_switch_arg_2 invalid 0x45 0x00 0x00 0x00 0x01 0x00
+
+
+
+#tests for visibility of instantiated generic types and methods
+./make_type_visibility_test.sh type_vis_gist_1 valid "newobj instance void class Foo<[test_lib]ClassC>::.ctor()"
+./make_type_visibility_test.sh type_vis_gist_2 unverifiable "newobj instance void class Foo<[test_lib]NotExportedA>::.ctor()"
+
+
+./make_type_visibility_test.sh type_vis_cast_1 valid "castclass class [test_lib]ClassC"
+./make_type_visibility_test.sh type_vis_cast_2 valid "castclass class [test_lib]NotExportedA"
+./make_type_visibility_test.sh type_vis_cast_gist_1 valid "castclass class Foo<[test_lib]ClassC>"
+./make_type_visibility_test.sh type_vis_cast_gist_2 valid "castclass class Foo<[test_lib]NotExportedA>"
+
+
+./make_type_visibility_test.sh type_vis_sizeof_1 valid "sizeof class [test_lib]ClassC"
+./make_type_visibility_test.sh type_vis_sizeof_2 valid "sizeof class [test_lib]NotExportedA"
+./make_type_visibility_test.sh type_vis_sizeof_gist_1 valid "sizeof class Foo<[test_lib]ClassC>"
+./make_type_visibility_test.sh type_vis_sizeof_gist_2 valid "sizeof class Foo<[test_lib]NotExportedA>"
+
+
+./make_type_visibility_test.sh type_vis_newarr_1 valid "newarr class [test_lib]ClassC" "ldc.i4.1"
+./make_type_visibility_test.sh type_vis_newarr_2 valid "newarr class [test_lib]NotExportedA" "ldc.i4.1"
+./make_type_visibility_test.sh type_vis_newarr_gist_1 valid "newarr class Foo<[test_lib]ClassC>" "ldc.i4.1"
+./make_type_visibility_test.sh type_vis_newarr_gist_2 valid "newarr class Foo<[test_lib]NotExportedA>" "ldc.i4.1"
+
+
+./make_type_visibility_test.sh type_vis_ldelem_1 valid "ldelem class [test_lib]ClassC" "ldc.i4.1\n\tnewarr class [test_lib]ClassC\n\tldc.i4.0"
+./make_type_visibility_test.sh type_vis_ldelem_2 valid "ldelem class [test_lib]NotExportedA" "ldc.i4.1\n\tnewarr class [test_lib]NotExportedA\n\tldc.i4.0"
+./make_type_visibility_test.sh type_vis_ldelem_gist_1 valid "ldelem class Foo<[test_lib]ClassC>" "ldc.i4.1\n\tnewarr class Foo<[test_lib]ClassC>\n\tldc.i4.0"
+./make_type_visibility_test.sh type_vis_ldelem_gist_2 valid "ldelem class Foo<[test_lib]NotExportedA>" "ldc.i4.1\n\tnewarr class Foo<[test_lib]NotExportedA>\n\tldc.i4.0"
+
+
+./make_type_visibility_test.sh type_vis_stelem_1 valid "stelem class [test_lib]ClassC" "ldc.i4.1\n\tnewarr class [test_lib]ClassC\n\tldc.i4.0\n\tldnull"
+./make_type_visibility_test.sh type_vis_stelem_2 valid "stelem class [test_lib]NotExportedA" "ldc.i4.1\n\tnewarr class [test_lib]NotExportedA\n\tldc.i4.0\n\tldnull"
+./make_type_visibility_test.sh type_vis_stelem_gist_1 valid "stelem class Foo<[test_lib]ClassC>" "ldc.i4.1\n\tnewarr class Foo<[test_lib]ClassC>\n\tldc.i4.0\n\tldnull"
+./make_type_visibility_test.sh type_vis_stelem_gist_2 valid "stelem class Foo<[test_lib]NotExportedA>" "ldc.i4.1\n\tnewarr class Foo<[test_lib]NotExportedA>\n\tldc.i4.0\n\tldnull"
+
+
+./make_type_visibility_test.sh type_vis_box_1 valid "box valuetype [test_lib]PublicStruct" "ldloc.1" "valuetype [test_lib]PublicStruct"
+./make_type_visibility_test.sh type_vis_box_2 valid "box valuetype [test_lib]NBStruct" "ldloc.1" "valuetype [test_lib]NBStruct"
+
+
+#generic method
+
+./make_type_visibility_test.sh type_vis_gmethod_1 valid "call void SimpleClass::Generic<[test_lib]ClassC>()"
+./make_type_visibility_test.sh type_vis_gmethod_2 unverifiable "call void SimpleClass::Generic<[test_lib]NotExportedA>()"
+
+
+#Constructor tests
+
+./make_ctor_test.sh ctor_good_ops_1 valid "call instance void object::'.ctor'()"
+./make_ctor_test.sh ctor_good_ops_2 valid "nop\n\tcall instance void object::'.ctor'()"
+./make_ctor_test.sh ctor_good_ops_3 valid "dup\n\tldc.i4.0\n\tstfld int32 Test::val\n\tcall instance void object::'.ctor'()"
+./make_ctor_test.sh ctor_good_ops_4 valid "dup\n\tldfld int32 Test::val\n\tpop\n\tcall instance void object::'.ctor'()"
+./make_ctor_test.sh ctor_good_ops_5 valid "dup\n\tpop\n\tcall instance void object::'.ctor'()"
+
+./make_ctor_test.sh ctor_call_super_2x valid "call instance void object::'.ctor'()\n\tldarg.0\n\tcall instance void object::'.ctor'()"
+
+./make_ctor_test.sh ctor_pass_this_as_arg_1 unverifiable "ldarg.0\n\tcall instance void TestClass::'.ctor'(object)" "other"
+./make_ctor_test.sh ctor_pass_this_as_arg_2 unverifiable "dup\n\tcall instance void TestClass::'.ctor'(object)" "other"
+
+
+./make_ctor_test.sh ctor_no_super_call unverifiable "nop"
+./make_ctor_test.sh ctor_call_invalid_super unverifiable "call instance void TestClass::'.ctor'()"
+./make_call_test.sh ctor_call_outside_ctor unverifiable "call instance void ClassA::.ctor()" "newobj instance void ClassA::.ctor()"
+
+./make_ctor_test.sh ctor_use_non_this_ptr unverifiable "ldloc.0\n\tcall instance void object::'.ctor'()"
+./make_ctor_test.sh ctor_store_this_on_field unverifiable "dup\n\tdup\n\tstfld object Test::obj\n\tcall instance void object::'.ctor'()"
+
+
+./make_ctor_test.sh ctor_use_uninit_this_1 unverifiable "dup\n\tcall void Test::StaticMethod(object)\n\tcall instance void object::'.ctor'()"
+./make_ctor_test.sh ctor_use_uninit_this_2 unverifiable "dup\n\tcall instance void Test::InstanceMethod()\n\tcall instance void object::'.ctor'()"
+./make_ctor_test.sh ctor_use_uninit_this_3 unverifiable "dup\n\tcastclass [mscorlib]System.String\n\tcall instance void object::'.ctor'()"
+./make_ctor_test.sh ctor_use_uninit_this_4 unverifiable "dup\n\tunbox.any Test\n\tcall instance void object::'.ctor'()"
+./make_ctor_test.sh ctor_use_uninit_this_5 unverifiable "dup\n\tcall instance void object::'.ctor'()\n\tcall instance void Test::InstanceMethod()"
+
+./make_ctor_test.sh ctor_bad_ops_1 unverifiable "dup\n\tstloc.0\n\tcall instance void object::'.ctor'()"
+./make_ctor_test.sh ctor_bad_ops_2 unverifiable "dup\n\tcall instance void object::'.ctor'()\n\tcall instance void Test::InstanceMethod()"
+
+#TODO try / catch inside constructor
+
+
+#TODO methods cannot have variance, but this should be checked at load time
+#TODO check for variance compatibility between types
+
+#generic delegate validation
+
+./make_generic_argument_constraints_test.sh no_constraints valid "" ""
+
+I=1
+for SRC in "(IfaceA)" "(IfaceB)" "(IfaceA, IfaceB)" ".ctor" "class" 
+do
+       ./make_generic_argument_constraints_test.sh src_ctrs_only_${I} unverifiable "$SRC" ""
+       I=`expr $I + 1`
+done
+
+./make_generic_argument_constraints_test.sh src_ctrs_only_vt unverifiable "valuetype" "" "int32"
+
+
+#Type arg compatibility
+./make_generic_argument_constraints_test.sh type_ctrs_1 valid "(IfaceA)" "(IfaceA)"
+./make_generic_argument_constraints_test.sh type_ctrs_2 valid "(IfaceA)" "(IfaceB, IfaceA)"
+./make_generic_argument_constraints_test.sh type_ctrs_3 unverifiable "(IfaceA)" "(IfaceB)"
+./make_generic_argument_constraints_test.sh type_ctrs_4 unverifiable "(IfaceA, IfaceB)" "(IfaceA)"
+
+#DefaultArgument implements IfaceA
+./make_generic_argument_constraints_test.sh type_ctrs_5 valid "(IfaceA)" "(DefaultArgument)"
+
+
+./make_generic_argument_constraints_test.sh type_ctor_1 valid ".ctor" ".ctor"
+
+./make_generic_argument_constraints_test.sh type_class_1 valid "class" "class"
+
+./make_generic_argument_constraints_test.sh type_valuetype_1 valid "valuetype" "valuetype" "int32"
+
+./make_generic_argument_constraints_test.sh type_mixed_1 valid "class (IfaceA)" "class (IfaceA)"
+./make_generic_argument_constraints_test.sh type_mixed_2 valid "(IfaceA)" "class (IfaceA)"
+
+./make_generic_argument_constraints_test.sh type_mixed_3 valid "" "(IfaceA)"
+./make_generic_argument_constraints_test.sh type_mixed_4 valid "" "class (IfaceA)"