2008-04-02 Rodrigo Kumpera <rkumpera@novell.com>
[mono.git] / mono / tests / verifier / make_tests.sh
1 #! /bin/sh
2
3 # Stack Size Tests
4 for OP in 'starg.s 0'
5 do
6   ./make_stack_0_test.sh invalid "$OP"
7 done
8
9 for OP in 'stloc.0' 'stloc.s 0' 'stfld int32 Class::fld' pop ret
10 do
11   ./make_stack_0_test.sh invalid "$OP"
12 done
13
14 for OP in add and 'box [mscorlib]System.Int32' 'brfalse branch_target' ceq cgt clt conv.i4 conv.r8 div dup 'ldfld int32 Class::fld' 'ldflda int32 Class::fld' mul not or rem shl shr sub xor
15 do
16   ./make_stack_0_pop_test.sh "$OP"
17 done
18
19 for OP in add and ceq cgt clt div dup mul or rem shl shr sub xor 'stfld int32 Class::fld'
20 do
21   ./make_stack_1_pop_test.sh "$OP" int32
22 done
23
24 # Table 2: Binary Numeric Operators
25 I=1
26 for OP in add div mul rem sub
27 do
28   if [ "$OP" == "div" ] || [ "$OP" == "rem" ]; then
29         INIT="yes";
30   else
31         INIT="no";
32   fi
33         
34   ./make_bin_test.sh bin_num_op_32_${I} valid $OP int32 int32 "ldc.i4.1" "${INIT}"
35   ./make_bin_test.sh bin_num_op_33_${I} valid $OP int32 'native int' "ldc.i4.1" "${INIT}"
36   ./make_bin_test.sh bin_num_op_34_${I} valid $OP int64 int64 "ldc.i8 1" "${INIT}"
37   ./make_bin_test.sh bin_num_op_35_${I} valid $OP 'native int' int32 "ldc.i4.1" "${INIT}"
38   ./make_bin_test.sh bin_num_op_36_${I} valid $OP 'native int' 'native int' "ldc.i4.1" "${INIT}"
39   ./make_bin_test.sh bin_num_op_37_${I} valid $OP float64 float64 "ldc.r8 0" "${INIT}"
40   ./make_bin_test.sh bin_num_op_38_${I} valid $OP float32 float64 "ldc.r8 0" "${INIT}"
41   ./make_bin_test.sh bin_num_op_39_${I} valid $OP float64 float32 "ldc.r4 0" "${INIT}"
42   ./make_bin_test.sh bin_num_op_40_${I} valid $OP float32 float32 "ldc.r4 0" "${INIT}"
43   
44   ./make_bin_test.sh bin_num_op_1_${I} unverifiable $OP int32 int64 "ldc.i8 1" "${INIT}"
45   ./make_bin_test.sh bin_num_op_2_${I} unverifiable $OP int32 float64 "ldc.r8 0" "${INIT}"
46   ./make_bin_test.sh bin_num_op_3_${I} unverifiable $OP int32 object "ldnull" "${INIT}"
47
48   ./make_bin_test.sh bin_num_op_4_${I} unverifiable $OP int64 int32 "ldc.i4.1" "${INIT}"
49   ./make_bin_test.sh bin_num_op_5_${I} unverifiable $OP int64 'native int' "ldc.i4.1" "${INIT}"
50   ./make_bin_test.sh bin_num_op_6_${I} unverifiable $OP int64 float64 "ldc.r8 0" "${INIT}"
51   ./make_bin_test.sh bin_num_op_7_${I} unverifiable $OP int64 'int64&' "ldnull" "${INIT}"
52   ./make_bin_test.sh bin_num_op_8_${I} unverifiable $OP int64 object "ldnull" "${INIT}"
53
54   ./make_bin_test.sh bin_num_op_9_${I} unverifiable $OP 'native int' int64 "ldc.i8 1" "${INIT}"
55   ./make_bin_test.sh bin_num_op_10_${I} unverifiable $OP 'native int' float64 "ldc.r8 0" "${INIT}"
56   ./make_bin_test.sh bin_num_op_11_${I} unverifiable $OP 'native int' object "ldnull" "${INIT}"
57
58   ./make_bin_test.sh bin_num_op_12_${I} unverifiable $OP float64 int32 "ldc.i4.1" "${INIT}"
59   ./make_bin_test.sh bin_num_op_13_${I} unverifiable $OP float64 int64 "ldc.i8 1" "${INIT}"
60   ./make_bin_test.sh bin_num_op_14_${I} unverifiable $OP float64 'native int' "ldc.i4.1" "${INIT}"
61   ./make_bin_test.sh bin_num_op_15_${I} unverifiable $OP float64 'float64&' "ldnull" "${INIT}"
62   ./make_bin_test.sh bin_num_op_16_${I} unverifiable $OP float64 object "ldnull" "${INIT}"
63
64   ./make_bin_test.sh bin_num_op_17_${I} unverifiable $OP 'int64&' int64 "ldc.i8 1" "${INIT}"
65   ./make_bin_test.sh bin_num_op_18_${I} unverifiable $OP 'float64&' float64 "ldc.r8 0" "${INIT}"
66   ./make_bin_test.sh bin_num_op_19_${I} unverifiable $OP 'object&' object "ldnull" "${INIT}"
67
68   ./make_bin_test.sh bin_num_op_20_${I} unverifiable $OP object int32 "ldc.i4.1" "${INIT}"
69   ./make_bin_test.sh bin_num_op_21_${I} unverifiable $OP object int64 "ldc.i8 1" "${INIT}"
70   ./make_bin_test.sh bin_num_op_22_${I} unverifiable $OP object 'native int' "ldc.i4.1" "${INIT}"
71   ./make_bin_test.sh bin_num_op_23_${I} unverifiable $OP object float64 "ldc.r8 0" "${INIT}"
72   ./make_bin_test.sh bin_num_op_24_${I} unverifiable $OP object 'object&' "ldnull" "${INIT}"
73   ./make_bin_test.sh bin_num_op_25_${I} unverifiable $OP object object "ldnull" "${INIT}"
74   I=`expr $I + 1`
75 done
76
77 I=1
78 for OP in div mul rem sub
79 do
80   ./make_bin_test.sh bin_num_op_26_${I} unverifiable $OP int32 'int32&'
81   ./make_bin_test.sh bin_num_op_27_${I} unverifiable $OP 'native int' 'native int&'
82   I=`expr $I + 1`
83 done
84
85 for OP in add
86 do
87   ./make_bin_test.sh bin_num_op_26_${I} unverifiable $OP int32 'int32&'
88   ./make_bin_test.sh bin_num_op_27_${I} unverifiable $OP 'native int' 'native int&'
89   I=`expr $I + 1`
90 done
91
92 I=1
93 for OP in div mul rem
94 do
95   if [ "$OP" == "div" ] || [ "$OP" == "div" ]; then
96         INIT="yes";
97   else
98         INIT="no";
99   fi
100   ./make_bin_test.sh bin_num_op_28_${I} unverifiable $OP 'int32&' int32 "ldc.i4.1" "${INIT}"
101   ./make_bin_test.sh bin_num_op_29_${I} unverifiable $OP 'native int&' 'native int' "ldc.i4.1" "${INIT}"
102   I=`expr $I + 1`
103 done
104
105 for OP in add sub
106 do
107   ./make_bin_test.sh bin_num_op_28_${I} unverifiable $OP 'int32&' int32
108   ./make_bin_test.sh bin_num_op_29_${I} unverifiable $OP 'native int&' 'native int'
109   I=`expr $I + 1`
110 done
111
112 I=1
113 for OP in div mul rem add
114 do
115   if [ "$OP" == "div" ] || [ "$OP" == "div" ]; then
116         INIT="yes";
117   else
118         INIT="no";
119   fi
120   ./make_bin_test.sh bin_num_op_30_${I} unverifiable $OP 'int32&' 'int32&' "ldnull" "${INIT}"
121   I=`expr $I + 1`
122 done
123
124 for OP in sub
125 do
126   ./make_bin_test.sh bin_num_op_30_${I} unverifiable $OP 'int32&' 'int32&'
127   I=`expr $I + 1`
128 done
129
130 # Table 4: Binary Comparison or Branch Operations
131 I=1
132 for OP in ceq cgt clt
133 do
134   ./make_bin_test.sh bin_comp_op_1_${I} unverifiable $OP int32 int64
135   ./make_bin_test.sh bin_comp_op_2_${I} unverifiable $OP int32 float64
136   ./make_bin_test.sh bin_comp_op_3_${I} unverifiable $OP int32 'int32&'
137   ./make_bin_test.sh bin_comp_op_4_${I} unverifiable $OP int32 object
138
139   ./make_bin_test.sh bin_comp_op_5_${I} unverifiable $OP int64 int32
140   ./make_bin_test.sh bin_comp_op_6_${I} unverifiable $OP int64 'native int'
141   ./make_bin_test.sh bin_comp_op_7_${I} unverifiable $OP int64 float64
142   ./make_bin_test.sh bin_comp_op_8_${I} unverifiable $OP int64 'int64&'
143   ./make_bin_test.sh bin_comp_op_9_${I} unverifiable $OP int64 object
144
145   ./make_bin_test.sh bin_comp_op_10_${I} unverifiable $OP 'native int' int64
146   ./make_bin_test.sh bin_comp_op_11_${I} unverifiable $OP 'native int' float64
147   ./make_bin_test.sh bin_comp_op_12_${I} unverifiable $OP 'native int' object
148
149   ./make_bin_test.sh bin_comp_op_13_${I} unverifiable $OP float64 int32
150   ./make_bin_test.sh bin_comp_op_14_${I} unverifiable $OP float64 int64
151   ./make_bin_test.sh bin_comp_op_15_${I} unverifiable $OP float64 'native int'
152   ./make_bin_test.sh bin_comp_op_16_${I} unverifiable $OP float64 'float64&'
153   ./make_bin_test.sh bin_comp_op_17_${I} unverifiable $OP float64 object
154
155   ./make_bin_test.sh bin_comp_op_18_${I} unverifiable $OP 'int32&' int32
156   ./make_bin_test.sh bin_comp_op_19_${I} unverifiable $OP 'int64&' int64
157   ./make_bin_test.sh bin_comp_op_20_${I} unverifiable $OP 'float64&' float64
158   ./make_bin_test.sh bin_comp_op_21_${I} unverifiable $OP 'object&' object
159
160   ./make_bin_test.sh bin_comp_op_22_${I} unverifiable $OP object int32
161   ./make_bin_test.sh bin_comp_op_23_${I} unverifiable $OP object int64
162   ./make_bin_test.sh bin_comp_op_24_${I} unverifiable $OP object 'native int'
163   ./make_bin_test.sh bin_comp_op_25_${I} unverifiable $OP object float64
164   ./make_bin_test.sh bin_comp_op_26_${I} unverifiable $OP object 'object&'
165   I=`expr $I + 1`
166 done
167
168 I=1
169 for OP in cgt clt
170 do
171   ./make_bin_test.sh bin_comp_op_27_${I} unverifiable $OP 'native int' 'native int&'
172   ./make_bin_test.sh bin_comp_op_28_${I} unverifiable $OP 'native int&' 'native int'
173   ./make_bin_test.sh bin_comp_op_29_${I} unverifiable $OP object object
174   I=`expr $I + 1`
175 done
176
177 #tests for the difference between cgt.un and others
178 I=1
179 for TYPE in string object
180 do
181         ./make_bin_test.sh bin_cgt_un_a_${I} valid 'cgt.un' "${TYPE}" 'object'
182         ./make_bin_test.sh bin_cgt_un_b_${I} valid 'cgt.un' 'object' "${TYPE}"
183   I=`expr $I + 1`
184 done
185
186
187 for TYPE in int32 float32 int64 "int32&" "native int" 
188 do
189         ./make_bin_test.sh bin_cgt_un_a_${I} unverifiable 'cgt.un' "${TYPE}" 'object'
190         ./make_bin_test.sh bin_cgt_un_b_${I} unverifiable 'cgt.un' 'object' "${TYPE}"
191   I=`expr $I + 1`
192
193 for OP in ceq
194 do
195   ./make_bin_test.sh bin_comp_op_27_${I} unverifiable $OP 'native int' 'native int&'
196   ./make_bin_test.sh bin_comp_op_28_${I} unverifiable $OP 'native int&' 'native int'
197   I=`expr $I + 1`
198 done
199
200 # Table 5: Integer Operations
201 I=1
202 for OP in and or xor
203 do
204   ./make_bin_test.sh bin_int_op_1_${I} unverifiable "$OP" int32 int64
205   ./make_bin_test.sh bin_int_op_2_${I} unverifiable "$OP" int32 float64
206   ./make_bin_test.sh bin_int_op_3_${I} unverifiable "$OP" int32 'int32&'
207   ./make_bin_test.sh bin_int_op_4_${I} unverifiable "$OP" int32 object
208
209   ./make_bin_test.sh bin_int_op_5_${I} unverifiable "$OP" int64 int32
210   ./make_bin_test.sh bin_int_op_6_${I} unverifiable "$OP" int64 'native int'
211   ./make_bin_test.sh bin_int_op_7_${I} unverifiable "$OP" int64 float64
212   ./make_bin_test.sh bin_int_op_8_${I} unverifiable "$OP" int64 'int64&'
213   ./make_bin_test.sh bin_int_op_9_${I} unverifiable "$OP" int64 object
214
215   ./make_bin_test.sh bin_int_op_10_${I} unverifiable "$OP" 'native int' int64
216   ./make_bin_test.sh bin_int_op_11_${I} unverifiable "$OP" 'native int' float64
217   ./make_bin_test.sh bin_int_op_12_${I} unverifiable "$OP" 'native int' 'native int&'
218   ./make_bin_test.sh bin_int_op_13_${I} unverifiable "$OP" 'native int' object
219
220   ./make_bin_test.sh bin_int_op_14_${I} unverifiable "$OP" float64 int32
221   ./make_bin_test.sh bin_int_op_15_${I} unverifiable "$OP" float64 int64
222   ./make_bin_test.sh bin_int_op_16_${I} unverifiable "$OP" float64 'native int'
223   ./make_bin_test.sh bin_int_op_17_${I} unverifiable "$OP" float64 float64
224   ./make_bin_test.sh bin_int_op_18_${I} unverifiable "$OP" float64 'int32&'
225   ./make_bin_test.sh bin_int_op_19_${I} unverifiable "$OP" float64 object
226
227   ./make_bin_test.sh bin_int_op_20_${I} unverifiable "$OP" 'int32&' int32
228   ./make_bin_test.sh bin_int_op_21_${I} unverifiable "$OP" 'int64&' int64
229   ./make_bin_test.sh bin_int_op_22_${I} unverifiable "$OP" 'native int&' 'native int'
230   ./make_bin_test.sh bin_int_op_23_${I} unverifiable "$OP" 'float64&' float64
231   ./make_bin_test.sh bin_int_op_24_${I} unverifiable "$OP" 'int32&' 'int32&'
232   ./make_bin_test.sh bin_int_op_25_${I} unverifiable "$OP" 'float64&' object
233
234   ./make_bin_test.sh bin_int_op_26_${I} unverifiable "$OP" object int32
235   ./make_bin_test.sh bin_int_op_27_${I} unverifiable "$OP" object int64
236   ./make_bin_test.sh bin_int_op_28_${I} unverifiable "$OP" object 'native int'
237   ./make_bin_test.sh bin_int_op_29_${I} unverifiable "$OP" object float64
238   ./make_bin_test.sh bin_int_op_30_${I} unverifiable "$OP" object 'int32&'
239   ./make_bin_test.sh bin_int_op_31_${I} unverifiable "$OP" object object
240   I=`expr $I + 1`
241 done
242
243 I=1
244 for TYPE in bool int8 int16 char int32 int64 'native int' 'class Int8Enum'
245 do
246   ./make_unary_test.sh not_${I} valid "not\n\tpop" "$TYPE"
247   I=`expr $I + 1`
248 done
249
250 for TYPE in 'int32&' object "class MyStruct" typedref "method int32 *(int32)" 'class Template\`1<int32>' float32 float64
251 do
252   ./make_unary_test.sh not_${I} unverifiable "not\n\tpop" "$TYPE"
253   I=`expr $I + 1`
254 done
255
256 I=1
257 for TYPE in bool int8 int16 char int32 int64 'native int' 'class Int8Enum' float32 float64
258 do
259   ./make_unary_test.sh neg_${I} valid "neg\n\tpop" "$TYPE"
260   I=`expr $I + 1`
261 done
262
263 for TYPE in 'int32&' object "class MyStruct" typedref "method int32 *(int32)" 'class Template\`1<int32>'
264 do
265   ./make_unary_test.sh neg_${I} unverifiable "neg\n\tpop" "$TYPE"
266   I=`expr $I + 1`
267 done
268
269
270 # Table 6: Shift Operators
271 I=1
272 for OP in shl shr
273 do
274   ./make_bin_test.sh shift_op_1_${I} unverifiable $OP int32 int64
275   ./make_bin_test.sh shift_op_2_${I} unverifiable $OP int32 float64
276   ./make_bin_test.sh shift_op_3_${I} unverifiable $OP int32 'int32&'
277   ./make_bin_test.sh shift_op_4_${I} unverifiable $OP int32 object
278
279   ./make_bin_test.sh shift_op_5_${I} unverifiable $OP int64 int64
280   ./make_bin_test.sh shift_op_6_${I} unverifiable $OP int64 float64
281   ./make_bin_test.sh shift_op_7_${I} unverifiable $OP int64 'int32&'
282   ./make_bin_test.sh shift_op_8_${I} unverifiable $OP int64 object
283
284   ./make_bin_test.sh shift_op_9_${I} unverifiable $OP 'native int' int64
285   ./make_bin_test.sh shift_op_10_${I} unverifiable $OP 'native int' float64
286   ./make_bin_test.sh shift_op_11_${I} unverifiable $OP 'native int' 'native int&'
287   ./make_bin_test.sh shift_op_12_${I} unverifiable $OP 'native int' object
288
289   ./make_bin_test.sh shift_op_13_${I} unverifiable $OP float64 int32
290   ./make_bin_test.sh shift_op_14_${I} unverifiable $OP float64 int64
291   ./make_bin_test.sh shift_op_15_${I} unverifiable $OP float64 'native int'
292   ./make_bin_test.sh shift_op_16_${I} unverifiable $OP float64 float64
293   ./make_bin_test.sh shift_op_17_${I} unverifiable $OP float64 'int32&'
294   ./make_bin_test.sh shift_op_18_${I} unverifiable $OP float64 object
295
296   ./make_bin_test.sh shift_op_19_${I} unverifiable $OP 'int32&' int32
297   ./make_bin_test.sh shift_op_20_${I} unverifiable $OP 'int64&' int64
298   ./make_bin_test.sh shift_op_21_${I} unverifiable $OP 'native int&' 'native int'
299   ./make_bin_test.sh shift_op_22_${I} unverifiable $OP 'float64&' float64
300   ./make_bin_test.sh shift_op_23_${I} unverifiable $OP 'int32&' 'int32&'
301   ./make_bin_test.sh shift_op_24_${I} unverifiable $OP 'float64&' object
302
303   ./make_bin_test.sh shift_op_25_${I} unverifiable $OP object int32
304   ./make_bin_test.sh shift_op_26_${I} unverifiable $OP object int64
305   ./make_bin_test.sh shift_op_27_${I} unverifiable $OP object 'native int'
306   ./make_bin_test.sh shift_op_28_${I} unverifiable $OP object float64
307   ./make_bin_test.sh shift_op_29_${I} unverifiable $OP object 'int32&'
308   ./make_bin_test.sh shift_op_30_${I} unverifiable $OP object object
309   I=`expr $I + 1`
310 done
311
312 # Table 8: Conversion Operations
313 I=1
314 J=1
315 for OP in "conv.i1\n\tpop" "conv.i2\n\tpop" "conv.i4\n\tpop" "conv.i8\n\tpop" "conv.r4\n\tpop" "conv.r8\n\tpop" "conv.u1\n\tpop" "conv.u2\n\tpop" "conv.u4\n\tpop" "conv.u8\n\tpop" "conv.i\n\tpop" "conv.u\n\tpop" "conv.r.un\n\tpop" "conv.ovf.i1\n\tpop" "conv.ovf.i2\n\tpop" "conv.ovf.i4\n\tpop" "conv.ovf.i8\n\tpop" "conv.ovf.u1\n\tpop" "conv.ovf.u2\n\tpop" "conv.ovf.u4\n\tpop" "conv.ovf.u8\n\tpop" "conv.ovf.i\n\tpop"  "conv.ovf.u\n\tpop" "conv.ovf.i1.un\n\tpop" "conv.ovf.i2.un\n\tpop" "conv.ovf.i4.un\n\tpop" "conv.ovf.i8.un\n\tpop" "conv.ovf.u1.un\n\tpop" "conv.ovf.u2.un\n\tpop" "conv.ovf.u4.un\n\tpop" "conv.ovf.u8.un\n\tpop" "conv.ovf.i.un\n\tpop"  "conv.ovf.u.un\n\tpop" 
316 do
317   for TYPE in 'int8' 'bool' 'unsigned int8' 'int16' 'char' 'unsigned int16' 'int32' 'unsigned int32' 'int64' 'unsigned int64' 'float32' 'float64' 'native int' 'native unsigned int'
318   do
319     ./make_unary_test.sh conv_op_${J}_${I} valid $OP "$TYPE"
320     I=`expr $I + 1`
321   done
322
323   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>&'
324   do
325     ./make_unary_test.sh conv_op_${J}_${I} unverifiable $OP "$TYPE"
326     I=`expr $I + 1`
327   done
328   J=`expr $J + 1`
329   I=1
330 done
331
332 #local and argument store with invalid values lead to unverifiable code
333 I=1
334 for OP in stloc.0 "stloc.s 0" "starg 0" "starg.s 0"
335 do
336   ./make_store_test.sh coercion_1_${I} unverifiable "$OP" int8 int64
337   ./make_store_test.sh coercion_2_${I} unverifiable "$OP" int8 float64
338   ./make_store_test.sh coercion_3_${I} unverifiable "$OP" int8 'int8&'
339   ./make_store_test.sh coercion_4_${I} unverifiable "$OP" int8 object
340
341   ./make_store_test.sh coercion_5_${I} unverifiable "$OP" 'unsigned int8' int64
342   ./make_store_test.sh coercion_6_${I} unverifiable "$OP" 'unsigned int8' float64
343   ./make_store_test.sh coercion_7_${I} unverifiable "$OP" 'unsigned int8' 'unsigned int8&'
344   ./make_store_test.sh coercion_8_${I} unverifiable "$OP" 'unsigned int8' object
345
346   ./make_store_test.sh coercion_9_${I} unverifiable "$OP" bool int64
347   ./make_store_test.sh coercion_10_${I} unverifiable "$OP" bool float64
348   ./make_store_test.sh coercion_11_${I} unverifiable "$OP" bool 'bool&'
349   ./make_store_test.sh coercion_12_${I} unverifiable "$OP" bool object
350
351   ./make_store_test.sh coercion_13_${I} unverifiable "$OP" int16 int64
352   ./make_store_test.sh coercion_14_${I} unverifiable "$OP" int16 float64
353   ./make_store_test.sh coercion_15_${I} unverifiable "$OP" int16 'int16&'
354   ./make_store_test.sh coercion_16_${I} unverifiable "$OP" int16 object
355   
356   ./make_store_test.sh coercion_17_${I} unverifiable "$OP" 'unsigned int16' int64
357   ./make_store_test.sh coercion_18_${I} unverifiable "$OP" 'unsigned int16' float64
358   ./make_store_test.sh coercion_19_${I} unverifiable "$OP" 'unsigned int16' 'unsigned int16&'
359   ./make_store_test.sh coercion_20_${I} unverifiable "$OP" 'unsigned int16' object
360   
361   ./make_store_test.sh coercion_21_${I} unverifiable "$OP" char int64
362   ./make_store_test.sh coercion_22_${I} unverifiable "$OP" char float64
363   ./make_store_test.sh coercion_23_${I} unverifiable "$OP" char 'char&'
364   ./make_store_test.sh coercion_24_${I} unverifiable "$OP" char object
365   
366   ./make_store_test.sh coercion_25_${I} unverifiable "$OP" int32 int64
367   ./make_store_test.sh coercion_26_${I} unverifiable "$OP" int32 float64
368   ./make_store_test.sh coercion_27_${I} unverifiable "$OP" int32 'int32&'
369   ./make_store_test.sh coercion_28_${I} unverifiable "$OP" int32 object
370   
371   ./make_store_test.sh coercion_29_${I} unverifiable "$OP" 'unsigned int32' int64
372   ./make_store_test.sh coercion_30_${I} unverifiable "$OP" 'unsigned int32' float64
373   ./make_store_test.sh coercion_31_${I} unverifiable "$OP" 'unsigned int32' 'unsigned int32&'
374   ./make_store_test.sh coercion_32_${I} unverifiable "$OP" 'unsigned int32' object
375  
376   ./make_store_test.sh coercion_33_${I} unverifiable "$OP" int64 int32
377   ./make_store_test.sh coercion_34_${I} unverifiable "$OP" int64 'native int'
378   ./make_store_test.sh coercion_35_${I} unverifiable "$OP" int64 float64
379   ./make_store_test.sh coercion_36_${I} unverifiable "$OP" int64 'int64&'
380   ./make_store_test.sh coercion_37_${I} unverifiable "$OP" int64 object
381   
382   ./make_store_test.sh coercion_38_${I} unverifiable "$OP" 'unsigned int64' int32
383   ./make_store_test.sh coercion_39_${I} unverifiable "$OP" 'unsigned int64' 'native int'
384   ./make_store_test.sh coercion_40_${I} unverifiable "$OP" 'unsigned int64' float64
385   ./make_store_test.sh coercion_41_${I} unverifiable "$OP" 'unsigned int64' 'unsigned int64&'
386   ./make_store_test.sh coercion_42_${I} unverifiable "$OP" 'unsigned int64' object
387   
388   ./make_store_test.sh coercion_43_${I} unverifiable "$OP" 'native int' int64
389   ./make_store_test.sh coercion_44_${I} unverifiable "$OP" 'native int' float64
390   ./make_store_test.sh coercion_45_${I} unverifiable "$OP" 'native int' 'native int&'
391   ./make_store_test.sh coercion_46_${I} unverifiable "$OP" 'native int' object
392   
393   ./make_store_test.sh coercion_47_${I} unverifiable "$OP" 'native unsigned int' int64
394   ./make_store_test.sh coercion_48_${I} unverifiable "$OP" 'native unsigned int' float64
395   ./make_store_test.sh coercion_49_${I} unverifiable "$OP" 'native unsigned int' 'native unsigned int&'
396   ./make_store_test.sh coercion_50_${I} unverifiable "$OP" 'native unsigned int' object
397   
398   ./make_store_test.sh coercion_51_${I} unverifiable "$OP" float32 int32
399   ./make_store_test.sh coercion_52_${I} unverifiable "$OP" float32 'native int'
400   ./make_store_test.sh coercion_53_${I} unverifiable "$OP" float32 int64
401   ./make_store_test.sh coercion_54_${I} unverifiable "$OP" float32 'float32&'
402   ./make_store_test.sh coercion_55_${I} unverifiable "$OP" float32 object
403   
404   ./make_store_test.sh coercion_56_${I} unverifiable "$OP" float64 int32
405   ./make_store_test.sh coercion_57_${I} unverifiable "$OP" float64 'native int'
406   ./make_store_test.sh coercion_58_${I} unverifiable "$OP" float64 int64
407   ./make_store_test.sh coercion_59_${I} unverifiable "$OP" float64 'float64&'
408   ./make_store_test.sh coercion_60_${I} unverifiable "$OP" float64 object
409
410   ./make_store_test.sh coercion_61_${I} unverifiable "$OP" object int32
411   ./make_store_test.sh coercion_62_${I} unverifiable "$OP" object 'native int'
412   ./make_store_test.sh coercion_63_${I} unverifiable "$OP" object int64
413   ./make_store_test.sh coercion_64_${I} unverifiable "$OP" object float64
414   ./make_store_test.sh coercion_65_${I} unverifiable "$OP" object 'object&'
415   
416   ./make_store_test.sh coercion_66_${I} unverifiable "$OP" 'class ValueType' int32
417   ./make_store_test.sh coercion_67_${I} unverifiable "$OP" 'class ValueType' 'native int'
418   ./make_store_test.sh coercion_68_${I} unverifiable "$OP" 'class ValueType' int64
419   ./make_store_test.sh coercion_69_${I} unverifiable "$OP" 'class ValueType' float64
420   ./make_store_test.sh coercion_70_${I} unverifiable "$OP" 'class ValueType' 'class ValueType&'
421   ./make_store_test.sh coercion_71_${I} unverifiable "$OP" 'class ValueType' object
422   
423   ./make_store_test.sh coercion_72_${I} unverifiable "$OP" 'int32&' int32
424   ./make_store_test.sh coercion_73_${I} unverifiable "$OP" 'int32&' 'native int'
425   ./make_store_test.sh coercion_74_${I} unverifiable "$OP" 'int32&' int64
426   ./make_store_test.sh coercion_75_${I} unverifiable "$OP" 'int32&' float64
427   ./make_store_test.sh coercion_76_${I} unverifiable "$OP" 'int32&' object
428   
429   ./make_store_test.sh coercion_77_${I} unverifiable "$OP" typedref int32
430   ./make_store_test.sh coercion_78_${I} unverifiable "$OP" typedref 'native int'
431   ./make_store_test.sh coercion_89_${I} unverifiable "$OP" typedref int64
432   ./make_store_test.sh coercion_80_${I} unverifiable "$OP" typedref float64
433   ./make_store_test.sh coercion_81_${I} unverifiable "$OP" typedref 'typedref&'
434   ./make_store_test.sh coercion_82_${I} unverifiable "$OP" typedref object
435   I=`expr $I + 1`
436 done
437
438 #valid coersion between native int and int32
439 I=1
440 for OP in stloc.0 "starg 0" 
441 do
442         ./make_store_test.sh coercion_83_${I} valid "$OP" int32 "native int"
443         ./make_store_test.sh coercion_84_${I} valid "$OP" "native int" int32
444
445         ./make_store_test.sh coercion_85_${I} valid "$OP" "unsigned int32" "native int"
446         ./make_store_test.sh coercion_86_${I} valid "$OP" "native int" "unsigned int32"
447
448         ./make_store_test.sh coercion_87_${I} valid "$OP" int32 "native unsigned int"
449         ./make_store_test.sh coercion_88_${I} valid "$OP" "native unsigned int" int32
450
451         ./make_store_test.sh coercion_89_${I} valid "$OP" "unsigned int32" "native int"
452         ./make_store_test.sh coercion_90_${I} valid "$OP" "native unsigned int" "unsigned int32"
453
454         I=`expr $I + 1`
455 done
456
457 #test for unverifiable types
458
459 I=1
460 for OP in "stloc.0" "starg 0"
461 do
462   ./make_store_test.sh misc_types_store_1_${I} valid "$OP" typedref typedref
463   ./make_store_test.sh misc_types_store_2_${I} unverifiable "$OP" "int32*" "int32*"
464   ./make_store_test.sh misc_types_store_3_${I} unverifiable "$OP" "method int32 *(int32)" "method int32 *(int32)"
465
466   ./make_store_test.sh misc_types_store_4_${I} unverifiable "$OP" "method int32 *(int32)" "method void *(int32)"
467   ./make_store_test.sh misc_types_store_5_${I} unverifiable "$OP" "int32*" "int8*"
468   ./make_store_test.sh misc_types_store_6_${I} unverifiable "$OP" typedref "native int&"
469
470
471   ./make_store_test.sh managed_pointer_store_1_${I} valid "$OP" "int32&" "int32&"
472   ./make_store_test.sh managed_pointer_store_2_${I} valid "$OP" "int32&" "native int&"
473   ./make_store_test.sh managed_pointer_store_3_${I} valid "$OP" "int32&" "unsigned int32&"
474   ./make_store_test.sh managed_pointer_store_4_${I} valid "$OP" "native int&" "int32&"
475   ./make_store_test.sh managed_pointer_store_5_${I} unverifiable "$OP" "int32&" "int16&"
476
477   ./make_store_test.sh managed_pointer_store_6_${I} valid "$OP" "int8&" "unsigned int8&"
478   ./make_store_test.sh managed_pointer_store_7_${I} valid "$OP" "int8&" "bool&"
479   ./make_store_test.sh managed_pointer_store_8_${I} unverifiable "$OP" "int8&" "int16&"
480
481   ./make_store_test.sh managed_pointer_store_9_${I} valid "$OP" "int16&" "unsigned int16&"
482   ./make_store_test.sh managed_pointer_store_10_${I} valid "$OP" "int16&" "char&"
483   ./make_store_test.sh managed_pointer_store_11_${I} unverifiable "$OP" "int16&" "int32&"
484
485   ./make_store_test.sh managed_pointer_store_12_${I} unverifiable "$OP" "float32&" "float64&"
486   ./make_store_test.sh managed_pointer_store_13_${I} unverifiable "$OP" "float64&" "float32&"
487
488   I=`expr $I + 1`
489 done
490
491
492 function fix () {
493         if [ "$3" != "" ]; then
494                 A=$3;
495         elif [ "$2" != "" ]; then
496                 A=$2;
497         else
498                 A=$1;
499         fi
500
501         if [ "$A" == "bool&" ]; then
502                 A="int8&";
503         elif [ "$A" == "char&" ]; then
504                 A="int16&";
505         fi
506
507         echo "$A";
508 }
509
510 #Tests related to storing reference types on other reference types
511 I=1
512 for OP in stloc.0 "stloc.s 0" "starg 0" "starg.s 0"
513 do
514         for TYPE1 in 'native int&' 'native unsigned int&'
515         do
516                 for TYPE2 in 'int8&' 'unsigned int8&' 'bool&' 'int16&' 'unsigned int16&' 'char&' 'int32&' 'unsigned int32&' 'int64&' 'unsigned int64&' 'float32&' 'float64&' 'native int&' 'native unsigned int&'
517                 do
518                         TA="$(fix $TYPE1)"
519                         TB="$(fix $TYPE2)"
520                         if [ "$TA" == "$TB" ]; then
521                                 ./make_store_test.sh ref_coercion_${I} valid "$OP" "$TYPE1" "$TYPE2"
522                         elif [ "$TA" == "int32&" ] && [ "$TB" == "int&" ]; then
523                                 ./make_store_test.sh ref_coercion_${I} valid "$OP" "$TYPE1" "$TYPE2"
524                         elif [ "$TA" == "int&" ] && [ "$TB" == "int32&" ]; then
525                                 ./make_store_test.sh ref_coercion_${I} valid "$OP" "$TYPE1" "$TYPE2"
526                         else
527                                 ./make_store_test.sh ref_coercion_${I} unverifiable "$OP" "$TYPE1" "$TYPE2"
528                         fi
529                         I=`expr $I + 1`
530                 done
531         done
532 done
533
534 I=1
535 for OP in stloc.0 "stloc.s 0" "starg 0" "starg.s 0"
536 do
537         for TYPE1 in 'int8&' 'unsigned int8&' 'bool&' 'int16&' 'unsigned int16&' 'char&' 'int32&' 'unsigned int32&' 'int64&' 'unsigned int64&' 'float32&' 'float64&'
538         do
539                 for TYPE2 in 'int8&' 'unsigned int8&' 'bool&' 'int16&' 'unsigned int16&' 'char&' 'int32&' 'unsigned int32&' 'int64&' 'unsigned int64&' 'float32&' 'float64&'
540                 do
541                         TA="$(fix $TYPE1)"
542                         TB="$(fix $TYPE2)"
543                         if [ "$TA" == "$TB" ]; then
544                                 ./make_store_test.sh ref_coercion_${I} valid "$OP" "$TYPE1" "$TYPE2"
545                         else
546                                 ./make_store_test.sh ref_coercion_${I} unverifiable "$OP" "$TYPE1" "$TYPE2"
547                         fi
548                         I=`expr $I + 1`
549                 done
550         done
551 done
552
553 for OP in stloc.0 "stloc.s 0" "starg 0" "starg.s 0"
554 do
555         for TYPE1 in 'class ClassA&' 'class ClassB&' 'class InterfaceA&' 'class InterfaceB&' 'class ValueType&'
556         do
557                 for TYPE2 in 'class ClassA&' 'class ClassB&' 'class InterfaceA&' 'class InterfaceB&' 'class ValueType&'
558                 do
559                         if [ "$TYPE1" == "$TYPE2" ]; then
560                                 ./make_store_test.sh ref_coercion_${I} valid "$OP" "$TYPE1" "$TYPE2"
561                         else
562                                 ./make_store_test.sh ref_coercion_${I} unverifiable "$OP" "$TYPE1" "$TYPE2"
563                         fi
564                         I=`expr $I + 1`
565                 done
566         done
567 done
568
569 #Field store parameter compatibility leads to invalid code
570 #Calling method with different verification types on stack lead to invalid code
571 I=1
572 for OP in "stfld TYPE1 Class::fld" "stsfld TYPE1 Class::sfld\n\tpop"  "call void Class::Method(TYPE1)"
573 do
574   ./make_obj_store_test.sh obj_coercion_1_${I} unverifiable "$OP" int8 int64
575   ./make_obj_store_test.sh obj_coercion_2_${I} unverifiable "$OP" int8 float64
576   ./make_obj_store_test.sh obj_coercion_3_${I} unverifiable "$OP" int8 'int8&'
577   ./make_obj_store_test.sh obj_coercion_4_${I} unverifiable "$OP" int8 object
578
579   ./make_obj_store_test.sh obj_coercion_5_${I} unverifiable "$OP" 'unsigned int8' int64
580   ./make_obj_store_test.sh obj_coercion_6_${I} unverifiable "$OP" 'unsigned int8' float64
581   ./make_obj_store_test.sh obj_coercion_7_${I} unverifiable "$OP" 'unsigned int8' 'unsigned int8&'
582   ./make_obj_store_test.sh obj_coercion_8_${I} unverifiable "$OP" 'unsigned int8' object
583
584   ./make_obj_store_test.sh obj_coercion_9_${I} unverifiable "$OP" bool int64
585   ./make_obj_store_test.sh obj_coercion_10_${I} unverifiable "$OP" bool float64
586   ./make_obj_store_test.sh obj_coercion_11_${I} unverifiable "$OP" bool 'bool&'
587   ./make_obj_store_test.sh obj_coercion_12_${I} unverifiable "$OP" bool object
588
589   ./make_obj_store_test.sh obj_coercion_13_${I} unverifiable "$OP" int16 int64
590   ./make_obj_store_test.sh obj_coercion_14_${I} unverifiable "$OP" int16 float64
591   ./make_obj_store_test.sh obj_coercion_15_${I} unverifiable "$OP" int16 'int16&'
592   ./make_obj_store_test.sh obj_coercion_16_${I} unverifiable "$OP" int16 object
593   
594   ./make_obj_store_test.sh obj_coercion_17_${I} unverifiable "$OP" 'unsigned int16' int64
595   ./make_obj_store_test.sh obj_coercion_18_${I} unverifiable "$OP" 'unsigned int16' float64
596   ./make_obj_store_test.sh obj_coercion_19_${I} unverifiable "$OP" 'unsigned int16' 'unsigned int16&'
597   ./make_obj_store_test.sh obj_coercion_20_${I} unverifiable "$OP" 'unsigned int16' object
598   
599   ./make_obj_store_test.sh obj_coercion_21_${I} unverifiable "$OP" char int64
600   ./make_obj_store_test.sh obj_coercion_22_${I} unverifiable "$OP" char float64
601   ./make_obj_store_test.sh obj_coercion_23_${I} unverifiable "$OP" char 'char&'
602   ./make_obj_store_test.sh obj_coercion_24_${I} unverifiable "$OP" char object
603   
604   ./make_obj_store_test.sh obj_coercion_25_${I} unverifiable "$OP" int32 int64
605   ./make_obj_store_test.sh obj_coercion_26_${I} unverifiable "$OP" int32 float64
606   ./make_obj_store_test.sh obj_coercion_27_${I} unverifiable "$OP" int32 'int32&'
607   ./make_obj_store_test.sh obj_coercion_28_${I} unverifiable "$OP" int32 object
608   
609   ./make_obj_store_test.sh obj_coercion_29_${I} unverifiable "$OP" 'unsigned int32' int64
610   ./make_obj_store_test.sh obj_coercion_30_${I} unverifiable "$OP" 'unsigned int32' float64
611   ./make_obj_store_test.sh obj_coercion_31_${I} unverifiable "$OP" 'unsigned int32' 'unsigned int32&'
612   ./make_obj_store_test.sh obj_coercion_32_${I} unverifiable "$OP" 'unsigned int32' object
613  
614   ./make_obj_store_test.sh obj_coercion_33_${I} unverifiable "$OP" int64 int32
615   ./make_obj_store_test.sh obj_coercion_34_${I} unverifiable "$OP" int64 'native int'
616   ./make_obj_store_test.sh obj_coercion_35_${I} unverifiable "$OP" int64 float64
617   ./make_obj_store_test.sh obj_coercion_36_${I} unverifiable "$OP" int64 'int64&'
618   ./make_obj_store_test.sh obj_coercion_37_${I} unverifiable "$OP" int64 object
619   
620   ./make_obj_store_test.sh obj_coercion_38_${I} unverifiable "$OP" 'unsigned int64' int32
621   ./make_obj_store_test.sh obj_coercion_39_${I} unverifiable "$OP" 'unsigned int64' 'native int'
622   ./make_obj_store_test.sh obj_coercion_40_${I} unverifiable "$OP" 'unsigned int64' float64
623   ./make_obj_store_test.sh obj_coercion_41_${I} unverifiable "$OP" 'unsigned int64' 'unsigned int64&'
624   ./make_obj_store_test.sh obj_coercion_42_${I} unverifiable "$OP" 'unsigned int64' object
625   
626   ./make_obj_store_test.sh obj_coercion_43_${I} unverifiable "$OP" 'native int' int64
627   ./make_obj_store_test.sh obj_coercion_44_${I} unverifiable "$OP" 'native int' float64
628   ./make_obj_store_test.sh obj_coercion_45_${I} unverifiable "$OP" 'native int' 'native int&'
629   ./make_obj_store_test.sh obj_coercion_46_${I} unverifiable "$OP" 'native int' object
630   
631   ./make_obj_store_test.sh obj_coercion_47_${I} unverifiable "$OP" 'native unsigned int' int64
632   ./make_obj_store_test.sh obj_coercion_48_${I} unverifiable "$OP" 'native unsigned int' float64
633   ./make_obj_store_test.sh obj_coercion_49_${I} unverifiable "$OP" 'native unsigned int' 'native unsigned int&'
634   ./make_obj_store_test.sh obj_coercion_50_${I} unverifiable "$OP" 'native unsigned int' object
635   
636   ./make_obj_store_test.sh obj_coercion_51_${I} unverifiable "$OP" float32 int32
637   ./make_obj_store_test.sh obj_coercion_52_${I} unverifiable "$OP" float32 'native int'
638   ./make_obj_store_test.sh obj_coercion_53_${I} unverifiable "$OP" float32 int64
639   ./make_obj_store_test.sh obj_coercion_54_${I} unverifiable "$OP" float32 'float32&'
640   ./make_obj_store_test.sh obj_coercion_55_${I} unverifiable "$OP" float32 object
641   
642   ./make_obj_store_test.sh obj_coercion_56_${I} unverifiable "$OP" float64 int32
643   ./make_obj_store_test.sh obj_coercion_57_${I} unverifiable "$OP" float64 'native int'
644   ./make_obj_store_test.sh obj_coercion_58_${I} unverifiable "$OP" float64 int64
645   ./make_obj_store_test.sh obj_coercion_59_${I} unverifiable "$OP" float64 'float64&'
646   ./make_obj_store_test.sh obj_coercion_60_${I} unverifiable "$OP" float64 object
647
648   ./make_obj_store_test.sh obj_coercion_61_${I} unverifiable "$OP" object int32
649   ./make_obj_store_test.sh obj_coercion_62_${I} unverifiable "$OP" object 'native int'
650   ./make_obj_store_test.sh obj_coercion_63_${I} unverifiable "$OP" object int64
651   ./make_obj_store_test.sh obj_coercion_64_${I} unverifiable "$OP" object float64
652   ./make_obj_store_test.sh obj_coercion_65_${I} unverifiable "$OP" object 'object&'
653   
654   ./make_obj_store_test.sh obj_coercion_66_${I} unverifiable "$OP" 'class ValueType' int32
655   ./make_obj_store_test.sh obj_coercion_67_${I} unverifiable "$OP" 'class ValueType' 'native int'
656   ./make_obj_store_test.sh obj_coercion_68_${I} unverifiable "$OP" 'class ValueType' int64
657   ./make_obj_store_test.sh obj_coercion_69_${I} unverifiable "$OP" 'class ValueType' float64
658   ./make_obj_store_test.sh obj_coercion_70_${I} unverifiable "$OP" 'class ValueType' 'class ValueType&'
659   ./make_obj_store_test.sh obj_coercion_71_${I} unverifiable "$OP" 'class ValueType' object
660   
661   
662   #These tests don't test store error since one cannot have an 'int32&' field
663   #They should exist in the structural tests session
664   #./make_obj_store_test.sh obj_coercion_72_${I} invalid "$OP" 'int32&' int32
665   #./make_obj_store_test.sh obj_coercion_73_${I} invalid "$OP" 'int32&' 'native int'
666   #./make_obj_store_test.sh obj_coercion_74_${I} invalid "$OP" 'int32&' int64
667   #./make_obj_store_test.sh obj_coercion_75_${I} invalid "$OP" 'int32&' float64
668   #./make_obj_store_test.sh obj_coercion_76_${I} invalid "$OP" 'int32&' object
669   
670
671   ./make_obj_store_test.sh obj_coercion_83_${I} valid "$OP" int32 "native int"
672   ./make_obj_store_test.sh obj_coercion_84_${I} valid "$OP" "native int" int32
673  
674   ./make_obj_store_test.sh obj_coercion_85_${I} valid "$OP" "unsigned int32" "native int"
675   ./make_obj_store_test.sh obj_coercion_86_${I} valid "$OP" "native int" "unsigned int32"
676  
677   ./make_obj_store_test.sh obj_coercion_87_${I} valid "$OP" int32 "native unsigned int"
678   ./make_obj_store_test.sh obj_coercion_88_${I} valid "$OP" "native unsigned int" int32
679  
680   ./make_obj_store_test.sh obj_coercion_89_${I} valid "$OP" "unsigned int32" "native int"
681   ./make_obj_store_test.sh obj_coercion_90_${I} valid "$OP" "native unsigned int" "unsigned int32"
682   I=`expr $I + 1`
683 done
684
685 I=1
686 for OP in "call void Class::Method(TYPE1)"
687 do
688   ./make_obj_store_test.sh obj_coercion_77_${I} unverifiable "$OP" typedref int32 "no"
689   ./make_obj_store_test.sh obj_coercion_78_${I} unverifiable "$OP" typedref 'native int' "no"
690   ./make_obj_store_test.sh obj_coercion_79_${I} unverifiable "$OP" typedref int64 "no"
691   ./make_obj_store_test.sh obj_coercion_80_${I} unverifiable "$OP" typedref float64 "no"
692   ./make_obj_store_test.sh obj_coercion_82_${I} unverifiable "$OP" typedref object "no"
693   I=`expr $I + 1`
694 done
695
696 # 1.8.1.2.3 Verification type compatibility (Assignment compatibility)
697 I=1
698 for OP in stloc.0 "stloc.s 0" "starg.s 0"
699 do
700   # ClassB not subtype of ClassA.
701   ./make_store_test.sh assign_compat_1_${I} unverifiable "$OP" 'class ClassA' 'class ClassB'
702
703   # ClassA not interface type.
704   # FIXME: what was the purpoise of this test? on it's current for it is valid and not unverifiable
705   ./make_store_test.sh assign_compat_3_${I} valid "$OP" object 'class ClassA'
706   
707   # Implementation of InterfaceB does not require the implementation of InterfaceA
708   ./make_store_test.sh assign_compat_4_${I} unverifiable "$OP" 'class InterfaceA' 'class InterfaceB'
709
710   # Array/vector.
711   ./make_store_test.sh assign_compat_5_${I} unverifiable "$OP" 'string []' 'string[,]'
712
713   # Vector/array.
714   ./make_store_test.sh assign_compat_6_${I} unverifiable "$OP" 'string [,]' 'string[]'
715
716   # Arrays with different rank.
717   ./make_store_test.sh assign_compat_7_${I} unverifiable "$OP" 'string [,]' 'string[,,]'
718
719   # Method pointers with different return types.
720   ./make_store_test.sh assign_compat_8_${I} unverifiable "$OP" 'method int32 *(int32)' 'method float32 *(int32)'
721
722   # Method pointers with different parameters.
723   ./make_store_test.sh assign_compat_9_${I} unverifiable "$OP" 'method int32 *(float64)' 'method int32 *(int32)'
724
725   # Method pointers with different calling conventions.
726   ./make_store_test.sh assign_compat_10_${I} unverifiable "$OP" 'method vararg int32 *(int32)' 'method int32 *(int32)'
727
728   # Method pointers with different calling conventions. (2)
729   ./make_store_test.sh assign_compat_11_${I} unverifiable "$OP" 'method unmanaged fastcall int32 *(int32)' 'method int32 *(int32)'
730
731   # Method pointers with different calling conventions. (3)
732   ./make_store_test.sh assign_compat_12_${I} unverifiable "$OP" 'method unmanaged fastcall int32 *(int32)' 'method unmanaged stdcall int32 *(int32)'
733   I=`expr $I + 1`
734 done
735
736 for OP in "stfld TYPE1 Class::fld" "stsfld TYPE1 Class::sfld\n\tpop"  "call void Class::Method(TYPE1)"
737 do
738   # ClassB not subtype of ClassA.
739   ./make_obj_store_test.sh assign_compat_1_${I} unverifiable "$OP" 'class ClassA' 'class ClassB'
740
741   # object not subtype of ClassA.
742   ./make_obj_store_test.sh assign_compat_2_${I} unverifiable "$OP" 'class ClassA' 'object'
743
744   # ClassA not interface type.
745   #FIXME: this test is valid, you can store type ClassA in a object field
746   ./make_obj_store_test.sh assign_compat_3_${I} valid "$OP" object 'class ClassA'
747   
748   # Implementation of InterfaceB does not require the implementation of InterfaceA
749   ./make_obj_store_test.sh assign_compat_4_${I} unverifiable "$OP" 'class InterfaceA' 'class InterfaceB'
750
751   # Array/vector.
752   ./make_obj_store_test.sh assign_compat_5_${I} unverifiable "$OP" 'string []' 'string[,]'
753
754   # Vector/array.
755   ./make_obj_store_test.sh assign_compat_6_${I} unverifiable "$OP" 'string [,]' 'string[]'
756
757   # Arrays with different rank.
758   ./make_obj_store_test.sh assign_compat_7_${I} unverifiable "$OP" 'string [,]' 'string[,,]'
759
760   # Method pointers with different return types.
761   ./make_obj_store_test.sh assign_compat_8_${I} unverifiable "$OP" 'method int32 *(int32)' 'method float32 *(int32)'
762
763   # Method pointers with different parameters.
764   ./make_obj_store_test.sh assign_compat_9_${I} unverifiable "$OP" 'method int32 *(float64)' 'method int32 *(int32)'
765
766   # Method pointers with different calling conventions.
767   ./make_obj_store_test.sh assign_compat_10_${I} unverifiable "$OP" 'method vararg int32 *(int32)' 'method int32 *(int32)'
768   
769     # Method pointers with different calling conventions. (2)
770   ./make_obj_store_test.sh assign_compat_11_${I} unverifiable "$OP" 'method unmanaged fastcall int32 *(int32)' 'method int32 *(int32)'
771   
772     # Method pointers with different calling conventions. (3)
773   ./make_obj_store_test.sh assign_compat_12_${I} unverifiable "$OP" 'method unmanaged fastcall int32 *(int32)' 'method unmanaged stdcall int32 *(int32)'
774   
775   I=`expr $I + 1`
776 done
777
778 # 1.8.1.3 Merging stack states
779 I=1
780 for TYPE1 in int32 int64 'native int' float64 'valuetype ValueType' 'class Class' 'int8&' 'int16&' 'int32&' 'int64&' 'native int&' 'float32&' 'float64&' 'valuetype ValueType&' 'class Class&' 'method int32 *(int32)' 'method float32 *(int32)' 'method int32 *(float64)' 'method vararg int32 *(int32)'
781 do
782   for TYPE2 in int32 int64 'native int' float64 'valuetype ValueType' 'class Class' 'int8&' 'int16&' 'int32&' 'int64&' 'native int&' 'float32&' 'float64&' 'valuetype ValueType&' 'class Class&' 'method int32 *(int32)' 'method float32 *(int32)' 'method int32 *(float64)' 'method vararg int32 *(int32)'
783   do
784         ZZ=`echo $TYPE1 | grep "*";`
785         T1_PTR=$?
786         ZZ=`echo $TYPE2 | grep "*";`
787         T2_PTR=$?
788         
789     if (($T1_PTR == 0  ||  $T2_PTR == 0)); then
790                 ./make_stack_merge_test.sh stack_merge_${I} unverifiable "$TYPE1" "$TYPE2"
791     elif [ "$TYPE1" == "$TYPE2" ]; then
792                 ./make_stack_merge_test.sh stack_merge_${I} valid "$TYPE1" "$TYPE2"
793         elif [ "$TYPE1" == "int32" ] && [ "$TYPE2" == "native int" ]; then
794                 ./make_stack_merge_test.sh stack_merge_${I} valid "$TYPE1" "$TYPE2"
795         elif [ "$TYPE1" == "native int" ] && [ "$TYPE2" == "int32" ]; then
796                 ./make_stack_merge_test.sh stack_merge_${I} valid "$TYPE1" "$TYPE2"
797         elif [ "$TYPE1" == "int32&" ] && [ "$TYPE2" == "native int&" ]; then
798                 ./make_stack_merge_test.sh stack_merge_${I} valid "$TYPE1" "$TYPE2"
799         elif [ "$TYPE1" == "native int&" ] && [ "$TYPE2" == "int32&" ]; then
800                 ./make_stack_merge_test.sh stack_merge_${I} valid "$TYPE1" "$TYPE2"
801         else
802                 ./make_stack_merge_test.sh stack_merge_${I} unverifiable "$TYPE1" "$TYPE2"
803     fi
804         I=`expr $I + 1`
805   done
806 done
807
808 # Unverifiable array stack merges
809
810 # These are verifiable, the merged type is 'object' or 'Array'
811 #for TYPE1 in 'string []' 'string [,]' 'string [,,]' 
812 #do
813 #  for TYPE2 in 'string []' 'string [,]' 'string [,,]' 
814 #  do
815 #    if [ "$TYPE1" != "$TYPE2" ]; then
816 #       ./make_stack_merge_test.sh stack_merge_${I} unverifiable "$TYPE1" "$TYPE2"
817 #       I=`expr $I + 1`
818 #    fi
819 #  done
820 #done
821
822 # Exception block branch tests (see 3.15)
823 I=1
824 for OP in br "ldc.i4.0\n\tbrfalse"
825 do
826   ./make_exception_branch_test.sh in_try_${I} unverifiable "$OP branch_target1"
827   ./make_exception_branch_test.sh in_catch_${I} unverifiable "$OP branch_target2"
828   ./make_exception_branch_test.sh in_finally_${I} invalid "$OP branch_target3"
829   ./make_exception_branch_test.sh in_filter_${I} unverifiable "$OP branch_target4"
830   ./make_exception_branch_test.sh out_try_${I} unverifiable "" "$OP branch_target5"
831   ./make_exception_branch_test.sh out_catch_${I} unverifiable "" "" "$OP branch_target5"
832   ./make_exception_branch_test.sh out_finally_${I} unverifiable "" "" "" "$OP branch_target5"
833   ./make_exception_branch_test.sh out_filter_${I} unverifiable "" "" "" "" "$OP branch_target5"
834   I=`expr $I + 1`
835 done
836
837 for OP in "ldloc.0\n\tldloc.1\n\tbeq" "ldloc.0\n\tldloc.1\n\tbge"
838 do
839   ./make_exception_branch_test.sh in_try_${I} invalid "$OP branch_target1"
840   ./make_exception_branch_test.sh in_catch_${I} invalid "$OP branch_target2"
841   ./make_exception_branch_test.sh in_finally_${I} invalid "$OP branch_target3"
842   ./make_exception_branch_test.sh in_filter_${I} invalid "$OP branch_target4"
843   ./make_exception_branch_test.sh out_try_${I} invalid "" "$OP branch_target5"
844   ./make_exception_branch_test.sh out_catch_${I} invalid "" "" "$OP branch_target5"
845   ./make_exception_branch_test.sh out_finally_${I} unverifiable "" "" "" "$OP branch_target5"
846   ./make_exception_branch_test.sh out_filter_${I} unverifiable "" "" "" "" "$OP branch_target5"
847   I=`expr $I + 1`
848 done
849
850 ./make_exception_branch_test.sh ret_out_try unverifiable "" "ldc.i4.0\n\tret"
851 ./make_exception_branch_test.sh ret_out_catch unverifiable "" "" "ldc.i4.0\n\tret"
852 ./make_exception_branch_test.sh ret_out_finally unverifiable "" "" "" "ldc.i4.0\n\tret"
853 ./make_exception_branch_test.sh ret_out_filter unverifiable "" "" "" "" "ldc.i4.0\n\tret"
854
855
856 # Unary branch op type tests (see 3.17)
857
858 for OP in brfalse
859 do
860   ./make_unary_test.sh un_branch_op unverifiable "$OP branch_target" float64
861 done
862
863 # Ldloc.0 and Ldarg tests (see 3.38)
864
865 I=1
866 for OP in "ldarg.s 0" "ldarg.0"
867 do
868   ./make_unary_test.sh ld_no_slot_${I} unverifiable "pop\n\t$OP\n\tpop" int32
869   I=`expr $I + 1`
870 done
871
872 for OP in "ldloc.s 1" "ldloc.1" "ldloc 1"
873 do
874   ./make_unary_test.sh ld_no_slot_${I} invalid "pop\n\t$OP\n\tpop" int32
875   I=`expr $I + 1`
876 done
877
878 for OP in "ldarga.s 0" "ldloca.s 1"
879 do
880   ./make_unary_test.sh ld_no_slot_${I} invalid "pop\n\t$OP\n\tpop" int32
881   I=`expr $I + 1`
882 done
883
884 # Starg and Stloc tests (see 3.61)
885
886 I=1
887 for OP in "starg.s 0"
888 do
889   ./make_unary_test.sh st_no_slot_${I} unverifiable "$OP" int32
890   I=`expr $I + 1`
891 done
892
893 for OP in "stloc.s 1"
894 do
895   ./make_unary_test.sh st_no_slot_${I} invalid "$OP" int32
896   I=`expr $I + 1`
897 done
898
899 # Ldfld and Ldflda tests (see 4.10)
900
901 for OP in ldfld ldflda
902 do
903   ./make_unary_test.sh ${OP}_no_fld invalid "$OP int32 Class::invalid\n\tpop" "class Class"
904   ./make_unary_test.sh ${OP}_bad_obj unverifiable "$OP int32 Class::valid\n\tpop" object
905   ./make_unary_test.sh ${OP}_obj_int32 unverifiable "$OP int32 Class::valid\n\tpop" int32
906   ./make_unary_test.sh ${OP}_obj_int64 unverifiable "$OP int32 Class::valid\n\tpop" int64
907   ./make_unary_test.sh ${OP}_obj_float64 unverifiable "$OP int32 Class::valid\n\tpop" float64
908   ./make_unary_test.sh ${OP}_obj_native_int unverifiable "$OP int32 Class::valid\n\tpop" 'native int'
909 #overlapped checks must be done separatedly
910 #  ./make_unary_test.sh ${OP}_obj_ref_overlapped unverifiable "$OP object Overlapped::objVal\n\tpop" "class Overlapped"
911 #  ./make_unary_test.sh ${OP}_obj_overlapped_field_not_accessible unverifiable "$OP int32 Overlapped::publicIntVal\n\tpop" "class Overlapped"
912 done
913
914 #TODO: these tests are bogus, they need to be fixed
915 # Stfld tests (see 4.28)
916
917 ./make_unary_test.sh stfld_no_fld invalid "ldc.i4.0\n\tstfld int32 Class::invalid" "class Class"
918 ./make_unary_test.sh stfld_bad_obj unverifiable "ldc.i4.0\n\tstfld int32 Class::valid" object
919 ./make_unary_test.sh stfld_obj_int32 unverifiable "ldc.i4.0\n\tstfld int32 Class::valid" int32
920 ./make_unary_test.sh stfld_obj_int64 unverifiable "ldc.i4.0\n\tstfld int32 Class::valid" int64
921 ./make_unary_test.sh stfld_obj_float64 unverifiable "ldc.i4.0\n\tstfld int32 Class::valid" float64
922 ./make_unary_test.sh stfld_no_int invalid "stfld int32 Class::valid" "class Class"
923 ./make_unary_test.sh stfld_obj_native_int unverifiable "ldc.i4.0\n\tstfld int32 Class::valid" 'native int'
924
925 # Box tests (see 4.1)
926
927 # Box non-existent type.
928 ./make_unary_test.sh box_bad_type unverifiable "box valuetype NonExistent\n\tpop" "valuetype NonExistent"
929
930 # Top of stack not assignment compatible with typeToc.
931 ./make_unary_test.sh box_not_compat unverifiable "box [mscorlib]System.Int32\n\tpop" float32
932
933 # Box byref type.
934 ./make_unary_test.sh box_byref invalid "box [mscorlib]System.Int32\&\n\tpop" 'int32&'
935
936 # Box byref-like type.
937 ./make_unary_test.sh box_byref_like unverifiable "box [mscorlib]System.TypedReference\n\tpop" typedref
938
939 #boxing between Int32 and IntPtr
940 ./make_unary_test.sh box_compat_1 valid "box [mscorlib]System.Int32\n\tpop" "native int"
941 ./make_unary_test.sh box_compat_2 valid "box [mscorlib]System.IntPtr\n\tpop" "int32"
942
943 #This is illegal since you cannot have a Void local variable, it should go into the structural tests part
944 # Box void type.
945 #./make_unary_test.sh box_void unverifiable "box [mscorlib]System.Void\n\tpop" "class [mscorlib]System.Void"
946
947
948
949
950
951 ./make_ret_test.sh ret_coercion_1 unverifiable int8 int64
952 ./make_ret_test.sh ret_coercion_2 unverifiable int8 float64
953 ./make_ret_test.sh ret_coercion_3 unverifiable int8 'int8&'
954 ./make_ret_test.sh ret_coercion_4 unverifiable int8 object
955
956 ./make_ret_test.sh ret_coercion_5 unverifiable 'unsigned int8' int64
957 ./make_ret_test.sh ret_coercion_6 unverifiable 'unsigned int8' float64
958 ./make_ret_test.sh ret_coercion_6 unverifiable 'unsigned int8' float64
959 ./make_ret_test.sh ret_coercion_6 unverifiable 'unsigned int8' float64
960 ./make_ret_test.sh ret_coercion_7 unverifiable 'unsigned int8' 'unsigned int8&'
961 ./make_ret_test.sh ret_coercion_8 unverifiable 'unsigned int8' object
962
963 ./make_ret_test.sh ret_coercion_9 unverifiable bool int64
964 ./make_ret_test.sh ret_coercion_10 unverifiable bool float64
965 ./make_ret_test.sh ret_coercion_11 unverifiable bool 'bool&'
966 ./make_ret_test.sh ret_coercion_12 unverifiable bool object
967
968 ./make_ret_test.sh ret_coercion_13 unverifiable int16 int64
969 ./make_ret_test.sh ret_coercion_14 unverifiable int16 float64
970 ./make_ret_test.sh ret_coercion_15 unverifiable int16 'int16&'
971 ./make_ret_test.sh ret_coercion_16 unverifiable int16 object
972   
973 ./make_ret_test.sh ret_coercion_17 unverifiable 'unsigned int16' int64
974 ./make_ret_test.sh ret_coercion_18 unverifiable 'unsigned int16' float64
975 ./make_ret_test.sh ret_coercion_19 unverifiable 'unsigned int16' 'unsigned int16&'
976 ./make_ret_test.sh ret_coercion_20 unverifiable 'unsigned int16' object
977   
978 ./make_ret_test.sh ret_coercion_21 unverifiable char int64
979 ./make_ret_test.sh ret_coercion_22 unverifiable char float64
980 ./make_ret_test.sh ret_coercion_23 unverifiable char 'char&'
981 ./make_ret_test.sh ret_coercion_24 unverifiable char object
982   
983 ./make_ret_test.sh ret_coercion_25 unverifiable int32 int64
984 ./make_ret_test.sh ret_coercion_26 unverifiable int32 float64
985 ./make_ret_test.sh ret_coercion_27 unverifiable int32 'int32&'
986 ./make_ret_test.sh ret_coercion_28 unverifiable int32 object
987   
988 ./make_ret_test.sh ret_coercion_29 unverifiable 'unsigned int32' int64
989 ./make_ret_test.sh ret_coercion_30 unverifiable 'unsigned int32' float64
990 ./make_ret_test.sh ret_coercion_31 unverifiable 'unsigned int32' 'unsigned int32&'
991 ./make_ret_test.sh ret_coercion_32 unverifiable 'unsigned int32' object
992  
993 ./make_ret_test.sh ret_coercion_33 unverifiable int64 int32
994 ./make_ret_test.sh ret_coercion_34 unverifiable int64 'native int'
995 ./make_ret_test.sh ret_coercion_35 unverifiable int64 float64
996 ./make_ret_test.sh ret_coercion_36 unverifiable int64 'int64&'
997 ./make_ret_test.sh ret_coercion_37 unverifiable int64 object
998   
999 ./make_ret_test.sh ret_coercion_38 unverifiable 'unsigned int64' int32
1000 ./make_ret_test.sh ret_coercion_39 unverifiable 'unsigned int64' 'native int'
1001 ./make_ret_test.sh ret_coercion_40 unverifiable 'unsigned int64' float64
1002 ./make_ret_test.sh ret_coercion_41 unverifiable 'unsigned int64' 'unsigned int64&'
1003 ./make_ret_test.sh ret_coercion_42 unverifiable 'unsigned int64' object
1004   
1005 ./make_ret_test.sh ret_coercion_43 unverifiable 'native int' int64
1006 ./make_ret_test.sh ret_coercion_44 unverifiable 'native int' float64
1007 ./make_ret_test.sh ret_coercion_45 unverifiable 'native int' 'native int&'
1008 ./make_ret_test.sh ret_coercion_46 unverifiable 'native int' object
1009   
1010 ./make_ret_test.sh ret_coercion_47 unverifiable 'native unsigned int' int64
1011 ./make_ret_test.sh ret_coercion_48 unverifiable 'native unsigned int' float64
1012 ./make_ret_test.sh ret_coercion_49 unverifiable 'native unsigned int' 'native unsigned int&'
1013 ./make_ret_test.sh ret_coercion_50 unverifiable 'native unsigned int' object
1014   
1015 ./make_ret_test.sh ret_coercion_51 unverifiable float32 int32
1016 ./make_ret_test.sh ret_coercion_52 unverifiable float32 'native int'
1017 ./make_ret_test.sh ret_coercion_53 unverifiable float32 int64
1018 ./make_ret_test.sh ret_coercion_54 unverifiable float32 'float32&'
1019 ./make_ret_test.sh ret_coercion_55 unverifiable float32 object
1020   
1021 ./make_ret_test.sh ret_coercion_56 unverifiable float64 int32
1022 ./make_ret_test.sh ret_coercion_57 unverifiable float64 'native int'
1023 ./make_ret_test.sh ret_coercion_58 unverifiable float64 int64
1024 ./make_ret_test.sh ret_coercion_59 unverifiable float64 'float64&'
1025 ./make_ret_test.sh ret_coercion_60 unverifiable float64 object
1026
1027 ./make_ret_test.sh ret_coercion_61 unverifiable object int32
1028 ./make_ret_test.sh ret_coercion_62 unverifiable object 'native int'
1029 ./make_ret_test.sh ret_coercion_63 unverifiable object int64
1030 ./make_ret_test.sh ret_coercion_64 unverifiable object float64
1031 ./make_ret_test.sh ret_coercion_65 unverifiable object 'object&'
1032   
1033 ./make_ret_test.sh ret_coercion_66 unverifiable 'class MyValueType' int32
1034 ./make_ret_test.sh ret_coercion_67 unverifiable 'class MyValueType' 'native int'
1035 ./make_ret_test.sh ret_coercion_68 unverifiable 'class MyValueType' int64
1036 ./make_ret_test.sh ret_coercion_69 unverifiable 'class MyValueType' float64
1037 ./make_ret_test.sh ret_coercion_70 unverifiable 'class MyValueType' 'class MyValueType&'
1038 ./make_ret_test.sh ret_coercion_71 unverifiable 'class MyValueType' object
1039   
1040 ./make_ret_test.sh ret_coercion_72 unverifiable 'int32&' int32
1041 ./make_ret_test.sh ret_coercion_73 unverifiable 'int32&' 'native int'
1042 ./make_ret_test.sh ret_coercion_74 unverifiable 'int32&' int64
1043 ./make_ret_test.sh ret_coercion_75 unverifiable 'int32&' float64
1044 ./make_ret_test.sh ret_coercion_76 unverifiable 'int32&' object
1045   
1046 ./make_ret_test.sh ret_coercion_77 unverifiable typedref int32
1047 ./make_ret_test.sh ret_coercion_78 unverifiable typedref 'native int'
1048 ./make_ret_test.sh ret_coercion_79 unverifiable typedref int64
1049 ./make_ret_test.sh ret_coercion_80 unverifiable typedref float64
1050 ./make_ret_test.sh ret_coercion_81 unverifiable typedref 'typedref&'
1051 ./make_ret_test.sh ret_coercion_82 unverifiable typedref object
1052
1053 ./make_ret_test.sh ret_coercion_83 valid int32 "native int"
1054 ./make_ret_test.sh ret_coercion_84 valid "native int" int32
1055 ./make_ret_test.sh ret_coercion_85 valid "unsigned int32" "native int"
1056 ./make_ret_test.sh ret_coercion_86 valid "native int" "unsigned int32"
1057 ./make_ret_test.sh ret_coercion_87 valid int32 "native unsigned int"
1058 ./make_ret_test.sh ret_coercion_88 valid "native unsigned int" int32
1059 ./make_ret_test.sh ret_coercion_89 valid "unsigned int32" "native int"
1060 ./make_ret_test.sh ret_coercion_90 valid "native unsigned int" "unsigned int32"
1061
1062 #type is unverifable
1063 ./make_ret_test.sh ret_coercion_100 unverifiable "int32*" "int32*"
1064 ./make_ret_test.sh ret_coercion_101 unverifiable "method int32* (int32)" "method int32* (int32)"
1065
1066 #typedbyref as parm is ok
1067 ./make_ret_test.sh ret_coercion_102 unverifiable int32 typedref
1068 ./make_ret_test.sh ret_coercion_103 unverifiable typedref int32
1069
1070 #unverifable return type: byref, typedbyref and ArgInterator
1071 ./make_ret_test.sh bad_ret_type_1 unverifiable typedref typedref
1072 ./make_ret_test.sh bad_ret_type_2 unverifiable "int32&" "int32&"
1073 ./make_ret_test.sh bad_ret_type_4 unverifiable "valuetype [mscorlib]System.ArgIterator" "valuetype [mscorlib]System.ArgIterator"
1074
1075
1076 ./make_ret_test.sh ret_sub_type valid ClassA ClassSubA
1077 ./make_ret_test.sh ret_same_type valid ClassA ClassA
1078 ./make_ret_test.sh ret_obj_iface valid object InterfaceA
1079 ./make_ret_test.sh ret_obj_obj valid object object
1080 ./make_ret_test.sh ret_obj_string valid object string
1081 ./make_ret_test.sh ret_string_string valid string string
1082 ./make_ret_test.sh ret_obj_vector valid object 'int32[]'
1083 ./make_ret_test.sh ret_obj_array valid object 'int32[,]'
1084 ./make_ret_test.sh ret_obj_generic valid object 'class Template`1<object>'
1085 ./make_ret_test.sh ret_obj_value_type unverifiable object 'MyValueType'
1086 ./make_ret_test.sh ret_string_value_type unverifiable string 'MyValueType'
1087 ./make_ret_test.sh ret_class_value_type unverifiable ClassA 'MyValueType'
1088
1089 ./make_ret_test.sh ret_string_string unverifiable string object
1090 ./make_ret_test.sh ret_string_string unverifiable 'int32[]' object
1091
1092 ./make_ret_test.sh ret_iface_imple valid InterfaceA ImplA
1093 ./make_ret_test.sh ret_arrays_same_vector valid 'int32[]' 'int32[]'
1094 ./make_ret_test.sh ret_arrays_same_rank valid 'int32[,]' 'int32[,]'
1095
1096 ./make_ret_test.sh ret_sub_type_array_covariant valid 'ClassA[]' 'ClassSubA[]'
1097 ./make_ret_test.sh ret_same_type_array_covariant valid 'ClassA[]' 'ClassA[]'
1098 ./make_ret_test.sh ret_obj_iface_array_covariant valid 'object[]' 'InterfaceA[]'
1099 ./make_ret_test.sh ret_iface_imple_array_covariant valid 'InterfaceA[]' 'ImplA[]'
1100
1101 ./make_ret_test.sh ret_diff_types unverifiable ClassA ClassB
1102 ./make_ret_test.sh ret_class_vale_type unverifiable ClassA MyValueType
1103 ./make_ret_test.sh ret_diff_vale_type unverifiable MyValueType2 MyValueType
1104 ./make_ret_test.sh ret_value_type_class unverifiable MyValueType ClassA
1105 ./make_ret_test.sh ret_super_type unverifiable ClassSubA ClassB
1106 ./make_ret_test.sh ret_interfaces unverifiable InterfaceA InterfaceB
1107 ./make_ret_test.sh ret_interface_class unverifiable ClassA InterfaceB
1108
1109 ./make_ret_test.sh ret_object_type valid object ClassA
1110 ./make_ret_test.sh ret_type_object unverifiable ClassA object
1111
1112
1113 ./make_ret_test.sh ret_array_diff_rank unverifiable 'int32[]' 'int32[,]'
1114 ./make_ret_test.sh ret_array_diff_rank2 unverifiable 'int32[,]' 'int32[]'
1115 ./make_ret_test.sh ret_array_diff_rank3 unverifiable 'int32[,,]' 'int32[,]'
1116 ./make_ret_test.sh ret_array_not_covar unverifiable 'ClassA[]' 'ClassB[]'
1117 ./make_ret_test.sh ret_array_not_covar2 unverifiable 'ClassSubA[]' 'ClassA[]'
1118 ./make_ret_test.sh ret_array_not_covar3 unverifiable 'ClassA[]' 'InterfaceA[]'
1119 ./make_ret_test.sh ret_array_not_covar4 unverifiable 'ImplA[]' 'InterfaceA[]'
1120 ./make_ret_test.sh ret_array_not_covar5 unverifiable 'InterfaceA[]' 'object[]'
1121
1122
1123 #generics tests
1124 ./make_ret_test.sh ret_generics_1 valid 'class Template' 'class Template'
1125 ./make_ret_test.sh ret_generics_2 valid 'class Template`1<int32>' 'class Template`1<int32>'
1126 ./make_ret_test.sh ret_generics_3 valid 'class Template`2<int32,object>' 'class Template`2<int32,object>'
1127
1128 ./make_ret_test.sh ret_generics_4 unverifiable 'class Template' 'class Template`1<object>'
1129 ./make_ret_test.sh ret_generics_5 unverifiable 'class Template`1<object>' 'class Template'
1130 ./make_ret_test.sh ret_generics_6 unverifiable 'class Template`1<object>' 'class Template`1<string>'
1131 ./make_ret_test.sh ret_generics_7 unverifiable 'class Template`1<string>' 'class Template`1<object>'
1132 ./make_ret_test.sh ret_generics_8 unverifiable 'class Template`1<object>' 'class Template`2<object, object>'
1133 ./make_ret_test.sh ret_generics_9 unverifiable 'class Template`2<object, object>' 'class Template`1<object>'
1134
1135 ./make_ret_test.sh ret_generics_10 unverifiable 'class Template`1<int32>' 'class Template`1<int16>'
1136 ./make_ret_test.sh ret_generics_11 unverifiable 'class Template`1<int16>' 'class Template`1<int32>'
1137 ./make_ret_test.sh ret_generics_12 unverifiable 'class Template`1<unsigned int32>' 'class Template`1<int32>'
1138 ./make_ret_test.sh ret_generics_13 unverifiable 'class Template`1<float32>' 'class Template`1<float64>'
1139 ./make_ret_test.sh ret_generics_14 unverifiable 'class Template`1<float64>' 'class Template`1<float32>'
1140
1141 #variance tests
1142 ./make_ret_test.sh ret_generics_15 valid 'class ICovariant`1<object>' 'class ICovariant`1<string>'
1143 ./make_ret_test.sh ret_generics_16 valid 'class ICovariant`1<string>' 'class ICovariant`1<string>'
1144 ./make_ret_test.sh ret_generics_17 unverifiable 'class ICovariant`1<string>' 'class ICovariant`1<object>'
1145
1146 ./make_ret_test.sh ret_generics_18 valid 'class IContravariant`1<string>' 'class IContravariant`1<object>'
1147 ./make_ret_test.sh ret_generics_19 valid 'class IContravariant`1<string>' 'class IContravariant`1<string>'
1148 ./make_ret_test.sh ret_generics_20 unverifiable 'class IContravariant`1<object>' 'class IContravariant`1<string>'
1149
1150 ./make_ret_test.sh ret_generics_21 valid 'class ICovariant`1<ClassA>' 'class ICovariant`1<ClassSubA>'
1151 ./make_ret_test.sh ret_generics_22 valid 'class ICovariant`1<ClassSubA>' 'class ICovariant`1<ClassSubA>'
1152 ./make_ret_test.sh ret_generics_23 unverifiable 'class ICovariant`1<ClassSubA>' 'class ICovariant`1<ClassA>'
1153
1154 ./make_ret_test.sh ret_generics_24 valid 'class IContravariant`1<ClassSubA>' 'class IContravariant`1<ClassA>'
1155 ./make_ret_test.sh ret_generics_25 valid 'class IContravariant`1<ClassSubA>' 'class IContravariant`1<ClassSubA>'
1156 ./make_ret_test.sh ret_generics_26 unverifiable 'class IContravariant`1<ClassA>' 'class IContravariant`1<ClassSubA>'
1157
1158
1159 ./make_ret_test.sh ret_generics_27 valid 'class Bivariant`2<ClassA, ClassB>' 'class Bivariant`2<ClassA, ClassB>'
1160 ./make_ret_test.sh ret_generics_28 valid 'class Bivariant`2<ClassA, ClassB>' 'class Bivariant`2<ClassA, object>'
1161 ./make_ret_test.sh ret_generics_29 valid 'class Bivariant`2<ClassA, ClassB>' 'class Bivariant`2<ClassSubA, ClassB>'
1162 ./make_ret_test.sh ret_generics_30 valid 'class Bivariant`2<ClassA, ClassB>' 'class Bivariant`2<ClassSubA, object>'
1163 ./make_ret_test.sh ret_generics_31 unverifiable 'class Bivariant`2<ClassA, ClassB>' 'class Bivariant`2<object, ClassB>'
1164 ./make_ret_test.sh ret_generics_32 unverifiable 'class Bivariant`2<ClassA, ClassB>' 'class Bivariant`2<object, object>'
1165 ./make_ret_test.sh ret_generics_33 unverifiable 'class Bivariant`2<ClassA, object>' 'class Bivariant`2<object, ClassB>'
1166 ./make_ret_test.sh ret_generics_34 unverifiable 'class Bivariant`2<ClassA, object>' 'class Bivariant`2<ClassA, ClassB>'
1167
1168 #mix parameter types
1169 ./make_ret_test.sh ret_generics_types_1 unverifiable 'class Template`1<int8>' 'class Template`1<unsigned int8>'
1170 ./make_ret_test.sh ret_generics_types_2 unverifiable 'class Template`1<int8>' 'class Template`1<int16>'
1171 ./make_ret_test.sh ret_generics_types_3 unverifiable 'class Template`1<int8>' 'class Template`1<unsigned int16>'
1172 ./make_ret_test.sh ret_generics_types_4 unverifiable 'class Template`1<int8>' 'class Template`1<int32>'
1173 ./make_ret_test.sh ret_generics_types_5 unverifiable 'class Template`1<int8>' 'class Template`1<unsigned int32>'
1174 ./make_ret_test.sh ret_generics_types_6 unverifiable 'class Template`1<int8>' 'class Template`1<int64>'
1175 ./make_ret_test.sh ret_generics_types_7 unverifiable 'class Template`1<int8>' 'class Template`1<unsigned int64>'
1176 ./make_ret_test.sh ret_generics_types_8 unverifiable 'class Template`1<int8>' 'class Template`1<float32>'
1177 ./make_ret_test.sh ret_generics_types_9 unverifiable 'class Template`1<int8>' 'class Template`1<float64>'
1178 ./make_ret_test.sh ret_generics_types_10 unverifiable 'class Template`1<int8>' 'class Template`1<bool>'
1179
1180 ./make_ret_test.sh ret_generics_types_11 unverifiable 'class Template`1<int8>' 'class Template`1<native int>'
1181 ./make_ret_test.sh ret_generics_types_12 unverifiable 'class Template`1<int8>' 'class Template`1<native unsigned int>'
1182 ./make_ret_test.sh ret_generics_types_13 unverifiable 'class Template`1<int8>' 'class Template`1<int32 *>'
1183
1184
1185 #inheritance tests
1186 ./make_ret_test.sh ret_generics_inheritante_1 valid 'class Base`1<int32>' 'class SubClass1`1<int32>'
1187 ./make_ret_test.sh ret_generics_inheritante_2 valid 'class SubClass1`1<int32>' 'class SubClass1`1<int32>'
1188 ./make_ret_test.sh ret_generics_inheritante_3 unverifiable 'class SubClass1`1<int32>' 'class Base`1<int32>'
1189 ./make_ret_test.sh ret_generics_inheritante_4 unverifiable 'class Base`1<int32>' 'class SubClass1`1<float32>'
1190 ./make_ret_test.sh ret_generics_inheritante_5 valid 'class Base`1<object>' 'class SubClass1`1<object>'
1191
1192 ./make_ret_test.sh ret_generics_inheritante_6 valid 'class BaseBase`2<int32, object>' 'class SubClass1`1<object>'
1193 ./make_ret_test.sh ret_generics_inheritante_7 valid 'class BaseBase`2<int32, object>' 'class Base`1<object>'
1194
1195 ./make_ret_test.sh ret_generics_inheritante_8 unverifiable 'class BaseBase`2<int64, object>' 'class Base`1<object>'
1196 ./make_ret_test.sh ret_generics_inheritante_9 unverifiable 'class BaseBase`2<int64, object>' 'class SubClass1`1<object>'
1197 ./make_ret_test.sh ret_generics_inheritante_10 unverifiable 'class BaseBase`2<int32, object>' 'class SubClass1`1<string>'
1198
1199 #interface tests
1200
1201 ./make_ret_test.sh ret_generics_inheritante_12 valid 'class Interface`1<int32>' 'class InterfaceImpl`1<int32>'
1202 ./make_ret_test.sh ret_generics_inheritante_13 valid 'class InterfaceImpl`1<int32>' 'class InterfaceImpl`1<int32>'
1203 ./make_ret_test.sh ret_generics_inheritante_14 unverifiable 'class InterfaceImpl`1<int32>' 'class Interface`1<int32>'
1204 ./make_ret_test.sh ret_generics_inheritante_15 unverifiable 'class Interface`1<int32>' 'class InterfaceImpl`1<float32>'
1205 ./make_ret_test.sh ret_generics_inheritante_16 valid 'class Interface`1<object>' 'class InterfaceImpl`1<object>'
1206
1207
1208 #mix variance with inheritance
1209 #only interfaces or delegates can have covariance
1210
1211 #mix variance with interfaces
1212
1213 ./make_ret_test.sh ret_generics_inheritante_28 valid 'class ICovariant`1<object>' 'class CovariantImpl`1<string>'
1214 ./make_ret_test.sh ret_generics_inheritante_29 valid 'class ICovariant`1<string>' 'class CovariantImpl`1<string>'
1215 ./make_ret_test.sh ret_generics_inheritante_30 unverifiable 'class ICovariant`1<string>' 'class CovariantImpl`1<object>'
1216
1217 ./make_ret_test.sh ret_generics_inheritante_31 valid 'class IContravariant`1<string>' 'class ContravariantImpl`1<object>'
1218 ./make_ret_test.sh ret_generics_inheritante_32 valid 'class IContravariant`1<string>' 'class ContravariantImpl`1<string>'
1219 ./make_ret_test.sh ret_generics_inheritante_33 unverifiable 'class IContravariant`1<object>' 'class ContravariantImpl`1<string>'
1220
1221 ./make_ret_test.sh ret_generics_inheritante_34 valid 'class ICovariant`1<ClassA>' 'class CovariantImpl`1<ClassSubA>'
1222 ./make_ret_test.sh ret_generics_inheritante_35 valid 'class ICovariant`1<ClassSubA>' 'class CovariantImpl`1<ClassSubA>'
1223 ./make_ret_test.sh ret_generics_inheritante_36 unverifiable 'class ICovariant`1<ClassSubA>' 'class CovariantImpl`1<ClassA>'
1224
1225 ./make_ret_test.sh ret_generics_inheritante_37 valid 'class IContravariant`1<ClassSubA>' 'class ContravariantImpl`1<ClassA>'
1226 ./make_ret_test.sh ret_generics_inheritante_38 valid 'class IContravariant`1<ClassSubA>' 'class ContravariantImpl`1<ClassSubA>'
1227 ./make_ret_test.sh ret_generics_inheritante_39 unverifiable 'class IContravariant`1<ClassA>' 'class ContravariantImpl`1<ClassSubA>'
1228
1229
1230 #mix variance with arrays
1231
1232 ./make_ret_test.sh ret_generics_arrays_1 valid 'class ICovariant`1<object>' 'class ICovariant`1<object[]>'
1233 ./make_ret_test.sh ret_generics_arrays_2 valid 'class ICovariant`1<object>' 'class ICovariant`1<int32[]>'
1234 ./make_ret_test.sh ret_generics_arrays_3 valid 'class ICovariant`1<object>' 'class ICovariant`1<int32[,]>'
1235 ./make_ret_test.sh ret_generics_arrays_4 valid 'class ICovariant`1<object>' 'class ICovariant`1<string[]>'
1236 ./make_ret_test.sh ret_generics_arrays_5 valid 'class ICovariant`1<object[]>' 'class ICovariant`1<string[]>'
1237 ./make_ret_test.sh ret_generics_arrays_6 valid 'class ICovariant`1<object[]>' 'class ICovariant`1<ClassA[]>'
1238 ./make_ret_test.sh ret_generics_arrays_7 valid 'class ICovariant`1<ClassA[]>' 'class ICovariant`1<ClassSubA[]>'
1239 ./make_ret_test.sh ret_generics_arrays_8 valid 'class ICovariant`1<InterfaceA[]>' 'class ICovariant`1<ImplA[]>'
1240 ./make_ret_test.sh ret_generics_arrays_9 valid 'class ICovariant`1<object[,]>' 'class ICovariant`1<string[,]>'
1241 ./make_ret_test.sh ret_generics_arrays_10 valid 'class ICovariant`1<ClassA[,]>' 'class ICovariant`1<ClassSubA[,]>'
1242
1243 ./make_ret_test.sh ret_generics_arrays_1_b valid 'class ICovariant`1<object>' 'class CovariantImpl`1<object[]>'
1244 ./make_ret_test.sh ret_generics_arrays_2_b valid 'class ICovariant`1<object>' 'class CovariantImpl`1<int32[]>'
1245 ./make_ret_test.sh ret_generics_arrays_3_b valid 'class ICovariant`1<object>' 'class CovariantImpl`1<int32[,]>'
1246 ./make_ret_test.sh ret_generics_arrays_4_b valid 'class ICovariant`1<object>' 'class ICovariant`1<string[]>'
1247 ./make_ret_test.sh ret_generics_arrays_5_b valid 'class ICovariant`1<object[]>' 'class CovariantImpl`1<string[]>'
1248 ./make_ret_test.sh ret_generics_arrays_6_b valid 'class ICovariant`1<object[]>' 'class CovariantImpl`1<ClassA[]>'
1249 ./make_ret_test.sh ret_generics_arrays_7_b valid 'class ICovariant`1<ClassA[]>' 'class CovariantImpl`1<ClassSubA[]>'
1250 ./make_ret_test.sh ret_generics_arrays_8_b valid 'class ICovariant`1<InterfaceA[]>' 'class CovariantImpl`1<ImplA[]>'
1251 ./make_ret_test.sh ret_generics_arrays_9_b valid 'class ICovariant`1<object[,]>' 'class CovariantImpl`1<string[,]>'
1252 ./make_ret_test.sh ret_generics_arrays_10_b valid 'class ICovariant`1<ClassA[,]>' 'class CovariantImpl`1<ClassSubA[,]>'
1253
1254 ./make_ret_test.sh ret_generics_arrays_11 valid 'class IContravariant`1<object[]>' 'class IContravariant`1<object>'
1255 ./make_ret_test.sh ret_generics_arrays_12 valid 'class IContravariant`1<int32[]>' 'class IContravariant`1<object>'
1256 ./make_ret_test.sh ret_generics_arrays_13 valid 'class IContravariant`1<int32[,]>' 'class IContravariant`1<object>'
1257 ./make_ret_test.sh ret_generics_arrays_14 valid 'class IContravariant`1<string[]>' 'class IContravariant`1<object>'
1258 ./make_ret_test.sh ret_generics_arrays_15 valid 'class IContravariant`1<string[]>' 'class IContravariant`1<object[]>'
1259 ./make_ret_test.sh ret_generics_arrays_16 valid 'class IContravariant`1<ClassA[]>' 'class IContravariant`1<object[]>'
1260 ./make_ret_test.sh ret_generics_arrays_17 valid 'class IContravariant`1<ClassSubA[]>' 'class IContravariant`1<ClassA[]>'
1261 ./make_ret_test.sh ret_generics_arrays_18 valid 'class IContravariant`1<ImplA[]>' 'class IContravariant`1<InterfaceA[]>'
1262 ./make_ret_test.sh ret_generics_arrays_19 valid 'class IContravariant`1<string[,]>' 'class IContravariant`1<object[,]>'
1263 ./make_ret_test.sh ret_generics_arrays_20 valid 'class IContravariant`1<ClassSubA[,]>' 'class IContravariant`1<ClassA[,]>'
1264
1265 ./make_ret_test.sh ret_generics_arrays_11_b valid 'class IContravariant`1<object[]>' 'class ContravariantImpl`1<object>'
1266 ./make_ret_test.sh ret_generics_arrays_12_b valid 'class IContravariant`1<int32[]>' 'class ContravariantImpl`1<object>'
1267 ./make_ret_test.sh ret_generics_arrays_13_b valid 'class IContravariant`1<int32[,]>' 'class ContravariantImpl`1<object>'
1268 ./make_ret_test.sh ret_generics_arrays_14_b valid 'class IContravariant`1<string[]>' 'class ContravariantImpl`1<object>'
1269 ./make_ret_test.sh ret_generics_arrays_15_b valid 'class IContravariant`1<string[]>' 'class ContravariantImpl`1<object[]>'
1270 ./make_ret_test.sh ret_generics_arrays_16_b valid 'class IContravariant`1<ClassA[]>' 'class ContravariantImpl`1<object[]>'
1271 ./make_ret_test.sh ret_generics_arrays_17_b valid 'class IContravariant`1<ClassSubA[]>' 'class ContravariantImpl`1<ClassA[]>'
1272 ./make_ret_test.sh ret_generics_arrays_18_b valid 'class IContravariant`1<ImplA[]>' 'class ContravariantImpl`1<InterfaceA[]>'
1273 ./make_ret_test.sh ret_generics_arrays_19_b valid 'class IContravariant`1<string[,]>' 'class ContravariantImpl`1<object[,]>'
1274 ./make_ret_test.sh ret_generics_arrays_20_b valid 'class IContravariant`1<ClassSubA[,]>' 'class ContravariantImpl`1<ClassA[,]>'
1275
1276 ./make_ret_test.sh ret_generics_arrays_21 unverifiable 'class ICovariant`1<int32[]>' 'class ICovariant`1<object>'
1277 ./make_ret_test.sh ret_generics_arrays_22 unverifiable 'class ICovariant`1<int32[]>' 'class ICovariant`1<object[]>'
1278 ./make_ret_test.sh ret_generics_arrays_23 unverifiable 'class ICovariant`1<string[]>' 'class ICovariant`1<object[]>'
1279 ./make_ret_test.sh ret_generics_arrays_24 unverifiable 'class ICovariant`1<ClassSubA[]>' 'class ICovariant`1<ClassA[]>'
1280 ./make_ret_test.sh ret_generics_arrays_25 unverifiable 'class ICovariant`1<int32[]>' 'class ICovariant`1<int32[,]>'
1281 ./make_ret_test.sh ret_generics_arrays_26 unverifiable 'class ICovariant`1<ImplA[]>' 'class ICovariant`1<InterfaceA[]>'
1282
1283 ./make_ret_test.sh ret_generics_arrays_27 unverifiable 'class IContravariant`1<object>' 'class IContravariant`1<int32[]>'
1284 ./make_ret_test.sh ret_generics_arrays_28 unverifiable 'class IContravariant`1<object[]>' 'class IContravariant`1<int32[]>'
1285 ./make_ret_test.sh ret_generics_arrays_29 unverifiable 'class IContravariant`1<object[]>' 'class IContravariant`1<string[]>'
1286 ./make_ret_test.sh ret_generics_arrays_30 unverifiable 'class IContravariant`1<ClassA[]>' 'class IContravariant`1<ClassSubA[]>'
1287 ./make_ret_test.sh ret_generics_arrays_31 unverifiable 'class IContravariant`1<int32[,]>' 'class IContravariant`1<int32[]>'
1288 ./make_ret_test.sh ret_generics_arrays_32 unverifiable 'class IContravariant`1<InterfaceA[]>' 'class IContravariant`1<ImplA[]>'
1289
1290
1291 #generic with value types
1292
1293 ./make_ret_test.sh ret_generics_vt_1 valid 'class Template`1<MyValueType>' 'class Template`1<MyValueType>'
1294 ./make_ret_test.sh ret_generics_vt_2 unverifiable 'class Template`1<MyValueType>' 'class Template`1<MyValueType2>'
1295 ./make_ret_test.sh ret_generics_vt_3 unverifiable 'class ICovariant`1<MyValueType>' 'class ICovariant`1<MyValueType2>'
1296 ./make_ret_test.sh ret_generics_vt_4 unverifiable 'class ICovariant`1<object>' 'class ICovariant`1<MyValueType2>'
1297
1298
1299 #mix variance and generic compatibility with all kinds of types valid for a generic parameter (hellish task - huge task)
1300 #test with composite generics ( Foo<Bar<int>> )
1301
1302 #test variance with delegates
1303 #generic methods
1304 #generic atributes
1305 #generic delegates
1306 #generic code
1307 #the verifier must check if the generic instantiation is valid
1308
1309 for OP in ldarg ldloc
1310 do
1311         ARGS_1='int32 V'
1312         LOCALS_1=''
1313         CALL_1='ldc.i4.0'
1314         SIG_1='int32'
1315         
1316         ARGS_2='int32 V, int32 V1'
1317         LOCALS_2=''
1318         CALL_2='ldc.i4.0\n\tldc.i4.0'
1319         SIG_2='int32, int32'
1320         
1321         ARGS_3='int32 V, int32 V1, int32 V1'
1322         LOCALS_3=''
1323         CALL_3='ldc.i4.0\n\tldc.i4.0\n\tldc.i4.0'
1324         SIG_3='int32, int32, int32'
1325         
1326         ARGS_4='int32 V, int32 V1, int32 V1, int32 V1'
1327         LOCALS_4=''
1328         CALL_4='ldc.i4.0\n\tldc.i4.0\n\tldc.i4.0\n\tldc.i4.0'
1329         SIG_4='int32, int32, int32, int32'
1330         MAX_PARAM_RESULT="unverifiable"
1331         POPS="pop\npop\npop\npop\npop\npop\npop\npop\n"
1332         
1333         if [ "$OP" == "ldloc" ]; then
1334                 MAX_PARAM_RESULT="invalid"
1335
1336                 LOCALS_1=$ARGS_1
1337                 ARGS_1=''
1338                 CALL_1=''
1339                 SIG_1=''
1340
1341                 LOCALS_2=$ARGS_2
1342                 ARGS_2=''
1343                 CALL_2=''
1344                 SIG_2=''
1345
1346                 LOCALS_3=$ARGS_3
1347                 ARGS_3=''
1348                 CALL_3=''
1349                 SIG_3=''
1350
1351                 LOCALS_4=$ARGS_4
1352                 ARGS_4=''
1353                 CALL_4=''
1354                 SIG_4=''
1355         fi;
1356         
1357         ./make_load_test.sh ${OP}0_max_params "${MAX_PARAM_RESULT}" "${OP}.0" '' '' '' ''
1358         ./make_load_test.sh ${OP}1_max_params "${MAX_PARAM_RESULT}" "${OP}.1" '' '' '' ''
1359         ./make_load_test.sh ${OP}2_max_params "${MAX_PARAM_RESULT}" "${OP}.2" '' '' '' ''
1360         ./make_load_test.sh ${OP}3_max_params "${MAX_PARAM_RESULT}" "${OP}.3" '' '' '' ''
1361         
1362         ./make_load_test.sh ${OP}1_1_max_params "${MAX_PARAM_RESULT}" "${OP}.1" "${ARGS_1}" "${LOCALS_1}" "${CALL_1}" "${SIG_1}"
1363         ./make_load_test.sh ${OP}2_1_max_params "${MAX_PARAM_RESULT}" "${OP}.2" "${ARGS_1}" "${LOCALS_1}" "${CALL_1}" "${SIG_1}"
1364         ./make_load_test.sh ${OP}3_1_max_params "${MAX_PARAM_RESULT}" "${OP}.3" "${ARGS_1}" "${LOCALS_1}" "${CALL_1}" "${SIG_1}"
1365         
1366         ./make_load_test.sh ${OP}2_2_max_params "${MAX_PARAM_RESULT}" "${OP}.2" "${ARGS_2}" "${LOCALS_2}" "${CALL_2}" "${SIG_2}"
1367         ./make_load_test.sh ${OP}3_2_max_params "${MAX_PARAM_RESULT}" "${OP}.3" "${ARGS_2}" "${LOCALS_2}" "${CALL_2}" "${SIG_2}"
1368         
1369         ./make_load_test.sh ${OP}3_3_max_params "${MAX_PARAM_RESULT}" "${OP}.3" "${ARGS_3}" "${LOCALS_3}" "${CALL_3}" "${SIG_3}"
1370         
1371         ./make_load_test.sh ${OP}0_max_params valid "${OP}.0" "${ARGS_1}" "${LOCALS_1}" "${CALL_1}" "${SIG_1}"
1372         ./make_load_test.sh ${OP}1_max_params valid "${OP}.1" "${ARGS_2}" "${LOCALS_2}" "${CALL_2}" "${SIG_2}"
1373         ./make_load_test.sh ${OP}2_max_params valid "${OP}.2" "${ARGS_3}" "${LOCALS_3}" "${CALL_3}" "${SIG_3}"
1374         ./make_load_test.sh ${OP}3_max_params valid "${OP}.3" "${ARGS_4}" "${LOCALS_4}" "${CALL_4}" "${SIG_4}"
1375         
1376         ./make_load_test.sh ${OP}0_stack_overflow invalid "${OP}.0\n${OP}.0\n${OP}.0\n${OP}.0\n${OP}.0\n${OP}.0\n${OP}.0\n${OP}.0\n${OP}.0\n${POPS}" "${ARGS_4}" "${LOCALS_4}" "${CALL_4}" "${SIG_4}"
1377         ./make_load_test.sh ${OP}1_stack_overflow invalid "${OP}.1\n${OP}.1\n${OP}.1\n${OP}.1\n${OP}.1\n${OP}.1\n${OP}.1\n${OP}.1\n${OP}.1\n${POPS}" "${ARGS_4}" "${LOCALS_4}" "${CALL_4}" "${SIG_4}"
1378         ./make_load_test.sh ${OP}2_stack_overflow invalid "${OP}.2\n${OP}.2\n${OP}.2\n${OP}.2\n${OP}.2\n${OP}.2\n${OP}.2\n${OP}.2\n${OP}.2\n${POPS}" "${ARGS_4}" "${LOCALS_4}" "${CALL_4}" "${SIG_4}"
1379         ./make_load_test.sh ${OP}3_stack_overflow invalid "${OP}.3\n${OP}.3\n${OP}.3\n${OP}.3\n${OP}.3\n${OP}.3\n${OP}.3\n${OP}.3\n${OP}.3\n${POPS}" "${ARGS_4}" "${LOCALS_4}" "${CALL_4}" "${SIG_4}"
1380 done
1381
1382 #Test if the values used for brtrue and brfalse are valid
1383 I=1
1384 for OP in brfalse brtrue 'brfalse.s' 'brtrue.s'
1385 do
1386         ./make_bool_branch_test.sh boolean_branch_${I}_1 valid ${OP} int8
1387         ./make_bool_branch_test.sh boolean_branch_${I}_2 valid ${OP} int16
1388         ./make_bool_branch_test.sh boolean_branch_${I}_3 valid ${OP} int32
1389         ./make_bool_branch_test.sh boolean_branch_${I}_4 valid ${OP} int64
1390         ./make_bool_branch_test.sh boolean_branch_${I}_5 valid ${OP} 'native int'
1391         
1392         #unmanaged pointers are not veriable types, all ops on unmanaged pointers are unverifiable
1393         ./make_bool_branch_test.sh boolean_branch_${I}_6 unverifiable ${OP} 'int32*'
1394         ./make_bool_branch_test.sh boolean_branch_${I}_8 unverifiable ${OP} 'method int32 *(int32)'
1395
1396         ./make_bool_branch_test.sh boolean_branch_${I}_7 valid ${OP} 'int32&'
1397         ./make_bool_branch_test.sh boolean_branch_${I}_9 valid ${OP} object
1398         ./make_bool_branch_test.sh boolean_branch_${I}_10 valid ${OP} string
1399         ./make_bool_branch_test.sh boolean_branch_${I}_11 valid ${OP} 'ClassA'
1400         ./make_bool_branch_test.sh boolean_branch_${I}_12 valid ${OP} 'int32[]'
1401         ./make_bool_branch_test.sh boolean_branch_${I}_13 valid ${OP} 'int32[,,]'
1402         ./make_bool_branch_test.sh boolean_branch_${I}_14 valid ${OP} 'class Template`1<object>'
1403         ./make_bool_branch_test.sh boolean_branch_${I}_15 valid ${OP} 'class Template`1<object>[]'
1404         ./make_bool_branch_test.sh boolean_branch_${I}_16 valid ${OP} 'class Template`1<object>[,,]'
1405         
1406         ./make_bool_branch_test.sh boolean_branch_${I}_17 unverifiable ${OP} float32
1407         ./make_bool_branch_test.sh boolean_branch_${I}_18 unverifiable ${OP} float64
1408         ./make_bool_branch_test.sh boolean_branch_${I}_19 unverifiable ${OP} 'class MyValueType'
1409         ./make_bool_branch_test.sh boolean_branch_${I}_20 unverifiable ${OP} 'class ValueTypeTemplate`1<object>'
1410
1411         ./make_bool_branch_test.sh boolean_branch_${I}_21 valid ${OP} object "pop\n\tldnull"
1412         ./make_bool_branch_test.sh boolean_branch_${I}_22 valid ${OP} MyValueType "pop\n\tldnull\n\tisinst MyValueType"
1413
1414         I=`expr $I + 1`
1415 done
1416
1417 #tests for field loading
1418 I=1
1419 for OP in 'ldfld' 'ldflda'
1420 do
1421         ./make_field_store_test.sh field_store_${I}_1 unverifiable "${OP} int32 ClassA::fld" int32 int32
1422         ./make_field_store_test.sh field_store_${I}_2 unverifiable "${OP} int32 ClassA::fld" int32 'class ClassB' yes
1423         ./make_field_store_test.sh field_store_${I}_3 unverifiable "${OP} int32 ClassA::fld" int32 object yes
1424         ./make_field_store_test.sh field_store_${I}_4 unverifiable "${OP} int32 ClassA::fld" int32 'class MyValueType'
1425         ./make_field_store_test.sh field_store_${I}_5 valid "${OP} int32 ClassA::fld" int32 'class ClassA' yes
1426         ./make_field_store_test.sh field_store_${I}_6 valid "${OP} int32 ClassA::fld" int32 'class SubClass' yes
1427         #ldfld and ldflda works different with value objects, you cannot take the address of a value-object on the stack
1428         #./make_field_store_test.sh field_store_${I}_7 valid "${OP} int32 MyValueType::fld" int32 'class MyValueType'
1429         #Not usefull as it throws NRE
1430         #./make_field_store_test.sh field_store_${I}_8 valid "${OP} int32 MyValueType::fld" int32 'class MyValueType \&'
1431         ./make_field_store_test.sh field_store_${I}_9 unverifiable "${OP} int32 MyValueType::fld" int32 'native int'
1432         ./make_field_store_test.sh field_store_${I}_10 unverifiable "${OP} int32 MyValueType::fld" int32 'class MyValueType *'
1433         ./make_field_store_test.sh field_store_${I}_11 unverifiable "${OP} int32 ClassA::fld" int32 'class ClassA *'
1434         #overlapped field tests should be done separatedly
1435         #./make_field_store_test.sh field_store_${I}_12 valid "${OP} int32 Overlapped::field1" int32 'class Overlapped' yes
1436         #./make_field_store_test.sh field_store_${I}_13 unverifiable "${OP} ClassA Overlapped::field1" 'class ClassA' 'class Overlapped' yes
1437         #./make_field_store_test.sh field_store_${I}_14 valid "${OP} int32 Overlapped::field1" int32 'class SubOverlapped' yes
1438         #./make_field_store_test.sh field_store_${I}_15 unverifiable "${OP} ClassA Overlapped::field1" 'class ClassA' 'class SubOverlapped' yes
1439         #./make_field_store_test.sh field_store_${I}_16 valid "${OP} int32 SubOverlapped::field6" int32 'class SubOverlapped' yes
1440         #./make_field_store_test.sh field_store_${I}_17 unverifiable "${OP} ClassA SubOverlapped::field6" 'class ClassA' 'class SubOverlapped' yes
1441         #./make_field_store_test.sh field_store_${I}_18 valid "${OP} int32 Overlapped::field10" int32 'class Overlapped' yes
1442         #./make_field_store_test.sh field_store_${I}_20 unverifiable "${OP} int32 Overlapped::field10" 'class ClassA' 'class Overlapped' yes
1443
1444         ./make_field_store_test.sh field_store_${I}_22 invalid "${OP} int32 ClassA::unknown_field" 'class ClassA' 'class ClassA' yes
1445         ./make_field_store_test.sh field_store_${I}_23 unverifiable "${OP} int32 ClassA::const_field" int32 'int32 \&'
1446
1447         ./make_field_store_test.sh field_store_${I}_24 valid "${OP} int32 ClassA::sfld" int32 'class ClassA' yes
1448         I=`expr $I + 1`
1449 done
1450
1451 ./make_field_store_test.sh field_store_2_25 unverifiable 'ldflda int32 ClassA::const_field' int32 'class ClassA'
1452
1453 #tests form static field loading
1454 I=1
1455 for OP in 'ldsfld' 'ldsflda'
1456 do
1457         #unknown field
1458         ./make_field_store_test.sh static_field_store_${I}_1 invalid "${OP} int32 ClassA::unknown_field\n\tpop" 'class ClassA' 'class ClassA'
1459         #non static field
1460         ./make_field_store_test.sh static_field_store_${I}_2 invalid "${OP} int32 ClassA::fld\n\tpop" 'class ClassA' 'class ClassA'
1461         #valid
1462         ./make_field_store_test.sh static_field_store_${I}_3 valid "${OP} ClassA ClassA::sfld\n\tpop" 'class ClassA' 'class ClassA'
1463         I=`expr $I + 1`
1464 done
1465
1466 ./make_field_store_test.sh static_field_store_2_25 unverifiable 'ldsflda int32 ClassA::st_const_field\n\tpop' int32 'class ClassA'
1467
1468
1469 #stfld with null values
1470 ./make_field_store_test.sh field_store_null_value valid "ldnull\n\tstfld string ClassA::fld\n\tldc.i4.0" 'string' 'class ClassA' yes
1471 ./make_field_store_test.sh field_store_null_object valid "pop\n\tldnull\n\tldnull\n\tstfld string ClassA::fld\n\tldc.i4.0" 'string' 'class ClassA' yes
1472
1473
1474 ./make_field_valuetype_test.sh value_type_field_load_1 valid 'ldfld int32 MyValueType::fld' 'ldloc.0'
1475 ./make_field_valuetype_test.sh value_type_field_load_2 unverifiable 'ldflda int32 MyValueType::fld' 'ldloc.0'
1476 ./make_field_valuetype_test.sh value_type_field_load_3 valid 'ldfld int32 MyValueType::fld' 'ldloca.s 0'
1477 ./make_field_valuetype_test.sh value_type_field_load_4 valid 'ldflda int32 MyValueType::fld' 'ldloca.s 0'
1478
1479 ./make_field_valuetype_test.sh value_type_field_load_1 valid 'ldfld int32 MyValueType::fld' 'ldloc.1'
1480 ./make_field_valuetype_test.sh value_type_field_load_2 valid 'ldflda int32 MyValueType::fld' 'ldloc.1'
1481 ./make_field_valuetype_test.sh value_type_field_load_3 unverifiable 'ldfld int32 MyValueType::fld' 'ldloca.s 1'
1482 ./make_field_valuetype_test.sh value_type_field_load_4 unverifiable 'ldflda int32 MyValueType::fld' 'ldloca.s 1'
1483
1484
1485
1486 #Tests for access checks
1487 #TODO tests with static calls
1488 #TODO tests with multiple assemblies, involving friend assemblies, with and without matching public key
1489
1490 I=1
1491 for OP in "callvirt instance int32 class Owner\/Nested::Target()" "call instance int32 class Owner\/Nested::Target()" "ldc.i4.0\n\t\tstfld int32 Owner\/Nested::fld\n\t\tldc.i4.0" "ldc.i4.0\n\t\tstsfld int32 Owner\/Nested::sfld" "ldsfld int32 Owner\/Nested::sfld\n\n\tpop" "ldfld int32 Owner\/Nested::fld" "ldsflda int32 Owner\/Nested::sfld\n\n\tpop" "ldflda int32 Owner\/Nested::fld"
1492 do
1493         ./make_nested_access_test.sh nested_access_check_1_${I} valid "$OP" public public no
1494         ./make_nested_access_test.sh nested_access_check_2_${I} valid "$OP" public public yes
1495         ./make_nested_access_test.sh nested_access_check_3_${I} unverifiable "$OP" public private no
1496         ./make_nested_access_test.sh nested_access_check_4_${I} unverifiable "$OP" public private yes
1497         ./make_nested_access_test.sh nested_access_check_5_${I} unverifiable "$OP" public family no
1498         ./make_nested_access_test.sh nested_access_check_6_${I} unverifiable "$OP" public family yes
1499         ./make_nested_access_test.sh nested_access_check_7_${I} valid "$OP" public assembly no
1500         ./make_nested_access_test.sh nested_access_check_8_${I} valid "$OP" public assembly yes
1501         ./make_nested_access_test.sh nested_access_check_9_${I} unverifiable "$OP" public famandassem no
1502         ./make_nested_access_test.sh nested_access_check_a_${I} unverifiable "$OP" public famandassem yes
1503         ./make_nested_access_test.sh nested_access_check_b_${I} valid "$OP" public famorassem no
1504         ./make_nested_access_test.sh nested_access_check_c_${I} valid "$OP" public famorassem yes
1505
1506         ./make_nested_access_test.sh nested_access_check_11_${I} unverifiable "$OP" private public no
1507         ./make_nested_access_test.sh nested_access_check_12_${I} unverifiable "$OP" private public yes
1508         ./make_nested_access_test.sh nested_access_check_13_${I} unverifiable "$OP" private private no
1509         ./make_nested_access_test.sh nested_access_check_14_${I} unverifiable "$OP" private private yes
1510         ./make_nested_access_test.sh nested_access_check_15_${I} unverifiable "$OP" private family no
1511         ./make_nested_access_test.sh nested_access_check_16_${I} unverifiable "$OP" private family yes
1512         ./make_nested_access_test.sh nested_access_check_17_${I} unverifiable "$OP" private assembly no
1513         ./make_nested_access_test.sh nested_access_check_18_${I} unverifiable "$OP" private assembly yes
1514         ./make_nested_access_test.sh nested_access_check_19_${I} unverifiable "$OP" private famandassem no
1515         ./make_nested_access_test.sh nested_access_check_1a_${I} unverifiable "$OP" private famandassem yes
1516         ./make_nested_access_test.sh nested_access_check_1b_${I} unverifiable "$OP" private famorassem no
1517         ./make_nested_access_test.sh nested_access_check_1c_${I} unverifiable "$OP" private famorassem yes
1518
1519         ./make_nested_access_test.sh nested_access_check_21_${I} unverifiable "$OP" family public no
1520         ./make_nested_access_test.sh nested_access_check_22_${I} valid "$OP" family public yes
1521         ./make_nested_access_test.sh nested_access_check_23_${I} unverifiable "$OP" family private no
1522         ./make_nested_access_test.sh nested_access_check_24_${I} unverifiable "$OP" family private yes
1523         ./make_nested_access_test.sh nested_access_check_25_${I} unverifiable "$OP" family family no
1524         ./make_nested_access_test.sh nested_access_check_26_${I} unverifiable "$OP" family family yes
1525         ./make_nested_access_test.sh nested_access_check_27_${I} unverifiable "$OP" family assembly no
1526         ./make_nested_access_test.sh nested_access_check_28_${I} valid "$OP" family assembly yes
1527         ./make_nested_access_test.sh nested_access_check_29_${I} unverifiable "$OP" family famandassem no
1528         ./make_nested_access_test.sh nested_access_check_2a_${I} unverifiable "$OP" family famandassem yes
1529         ./make_nested_access_test.sh nested_access_check_2b_${I} unverifiable "$OP" family famorassem no
1530         ./make_nested_access_test.sh nested_access_check_2c_${I} valid "$OP" family famorassem yes
1531
1532         ./make_nested_access_test.sh nested_access_check_31_${I} valid "$OP" assembly public no
1533         ./make_nested_access_test.sh nested_access_check_32_${I} valid "$OP" assembly public yes
1534         ./make_nested_access_test.sh nested_access_check_33_${I} unverifiable "$OP" assembly private no
1535         ./make_nested_access_test.sh nested_access_check_34_${I} unverifiable "$OP" assembly private yes
1536         ./make_nested_access_test.sh nested_access_check_35_${I} unverifiable "$OP" assembly family no
1537         ./make_nested_access_test.sh nested_access_check_36_${I} unverifiable "$OP" assembly family yes
1538         ./make_nested_access_test.sh nested_access_check_37_${I} valid "$OP" assembly assembly no
1539         ./make_nested_access_test.sh nested_access_check_38_${I} valid "$OP" assembly assembly yes
1540         ./make_nested_access_test.sh nested_access_check_39_${I} unverifiable "$OP" assembly famandassem no
1541         ./make_nested_access_test.sh nested_access_check_3a_${I} unverifiable "$OP" assembly famandassem yes
1542         ./make_nested_access_test.sh nested_access_check_3b_${I} valid "$OP" assembly famorassem no
1543         ./make_nested_access_test.sh nested_access_check_3c_${I} valid "$OP" assembly famorassem yes
1544
1545         ./make_nested_access_test.sh nested_access_check_41_${I} unverifiable "$OP" famandassem public no
1546         ./make_nested_access_test.sh nested_access_check_42_${I} valid "$OP" famandassem public yes
1547         ./make_nested_access_test.sh nested_access_check_43_${I} unverifiable "$OP" famandassem private no
1548         ./make_nested_access_test.sh nested_access_check_44_${I} unverifiable "$OP" famandassem private yes
1549         ./make_nested_access_test.sh nested_access_check_45_${I} unverifiable "$OP" famandassem family no
1550         ./make_nested_access_test.sh nested_access_check_46_${I} unverifiable "$OP" famandassem family yes
1551         ./make_nested_access_test.sh nested_access_check_47_${I} unverifiable "$OP" famandassem assembly no
1552         ./make_nested_access_test.sh nested_access_check_48_${I} valid "$OP" famandassem assembly yes
1553         ./make_nested_access_test.sh nested_access_check_49_${I} unverifiable "$OP" famandassem famandassem no
1554         ./make_nested_access_test.sh nested_access_check_4a_${I} unverifiable "$OP" famandassem famandassem yes
1555         ./make_nested_access_test.sh nested_access_check_4b_${I} unverifiable "$OP" famandassem famorassem no
1556         ./make_nested_access_test.sh nested_access_check_4c_${I} valid "$OP" famandassem famorassem yes
1557
1558         ./make_nested_access_test.sh nested_access_check_51_${I} valid "$OP" famorassem public no
1559         ./make_nested_access_test.sh nested_access_check_52_${I} valid "$OP" famorassem public yes
1560         ./make_nested_access_test.sh nested_access_check_53_${I} unverifiable "$OP" famorassem private no
1561         ./make_nested_access_test.sh nested_access_check_54_${I} unverifiable "$OP" famorassem private yes
1562         ./make_nested_access_test.sh nested_access_check_55_${I} unverifiable "$OP" famorassem family no
1563         ./make_nested_access_test.sh nested_access_check_56_${I} unverifiable "$OP" famorassem family yes
1564         ./make_nested_access_test.sh nested_access_check_57_${I} valid "$OP" famorassem assembly no
1565         ./make_nested_access_test.sh nested_access_check_58_${I} valid "$OP" famorassem assembly yes
1566         ./make_nested_access_test.sh nested_access_check_59_${I} unverifiable "$OP" famorassem famandassem no
1567         ./make_nested_access_test.sh nested_access_check_5a_${I} unverifiable "$OP" famorassem famandassem yes
1568         ./make_nested_access_test.sh nested_access_check_5b_${I} valid "$OP" famorassem famorassem no
1569         ./make_nested_access_test.sh nested_access_check_5c_${I} valid "$OP" famorassem famorassem yes
1570         I=`expr $I + 1`
1571 done
1572
1573 #Tests for accessing an owned nested type
1574 I=1
1575 for OP in "callvirt instance int32 class Outer\/Inner::Target()" "call instance int32 class Outer\/Inner::Target()" "ldc.i4.0\n\t\tstfld int32 Outer\/Inner::fld\n\t\tldc.i4.0" "ldc.i4.0\n\t\tstsfld int32 Outer\/Inner::sfld" "ldsfld int32 Outer\/Inner::sfld\n\n\tpop" "ldfld int32 Outer\/Inner::fld" "ldsflda int32 Outer\/Inner::sfld\n\n\tpop" "ldflda int32 Outer\/Inner::fld"
1576 do
1577         ./make_self_nested_test.sh self_nested_access_check_1_${I} valid "$OP" public public
1578         ./make_self_nested_test.sh self_nested_access_check_2_${I} unverifiable "$OP" public private
1579         ./make_self_nested_test.sh self_nested_access_check_3_${I} unverifiable "$OP" public family
1580         ./make_self_nested_test.sh self_nested_access_check_4_${I} valid "$OP" public assembly
1581         ./make_self_nested_test.sh self_nested_access_check_5_${I} unverifiable "$OP" public famandassem
1582         ./make_self_nested_test.sh self_nested_access_check_6_${I} valid "$OP" public famorassem
1583
1584         ./make_self_nested_test.sh self_nested_access_check_7_${I} valid "$OP" private public
1585         ./make_self_nested_test.sh self_nested_access_check_8_${I} unverifiable "$OP" private private
1586         ./make_self_nested_test.sh self_nested_access_check_9_${I} unverifiable "$OP" private family
1587         ./make_self_nested_test.sh self_nested_access_check_10_${I} valid "$OP" private assembly
1588         ./make_self_nested_test.sh self_nested_access_check_11_${I} unverifiable "$OP" private famandassem
1589         ./make_self_nested_test.sh self_nested_access_check_12_${I} valid "$OP" private famorassem
1590
1591         ./make_self_nested_test.sh self_nested_access_check_13_${I} valid "$OP" family public
1592         ./make_self_nested_test.sh self_nested_access_check_14_${I} unverifiable "$OP" family private
1593         ./make_self_nested_test.sh self_nested_access_check_15_${I} unverifiable "$OP" family family
1594         ./make_self_nested_test.sh self_nested_access_check_16_${I} valid "$OP" family assembly
1595         ./make_self_nested_test.sh self_nested_access_check_17_${I} unverifiable "$OP" family famandassem
1596         ./make_self_nested_test.sh self_nested_access_check_18_${I} valid "$OP" family famorassem
1597
1598         ./make_self_nested_test.sh self_nested_access_check_19_${I} valid "$OP" assembly public
1599         ./make_self_nested_test.sh self_nested_access_check_20_${I} unverifiable "$OP" assembly private
1600         ./make_self_nested_test.sh self_nested_access_check_21_${I} unverifiable "$OP" assembly family
1601         ./make_self_nested_test.sh self_nested_access_check_22_${I} valid "$OP" assembly assembly
1602         ./make_self_nested_test.sh self_nested_access_check_23_${I} unverifiable "$OP" assembly famandassem
1603         ./make_self_nested_test.sh self_nested_access_check_24_${I} valid "$OP" assembly famorassem
1604
1605         ./make_self_nested_test.sh self_nested_access_check_25_${I} valid "$OP" famandassem public
1606         ./make_self_nested_test.sh self_nested_access_check_26_${I} unverifiable "$OP" famandassem private
1607         ./make_self_nested_test.sh self_nested_access_check_27_${I} unverifiable "$OP" famandassem family
1608         ./make_self_nested_test.sh self_nested_access_check_28_${I} valid "$OP" famandassem assembly
1609         ./make_self_nested_test.sh self_nested_access_check_29_${I} valid "$unverifiable" famandassem famandassem
1610         ./make_self_nested_test.sh self_nested_access_check_30_${I} valid "$OP" famandassem famorassem
1611
1612         ./make_self_nested_test.sh self_nested_access_check_31_${I} valid "$OP" famorassem public
1613         ./make_self_nested_test.sh self_nested_access_check_32_${I} unverifiable "$OP" famorassem private
1614         ./make_self_nested_test.sh self_nested_access_check_33_${I} unverifiable "$OP" famorassem family
1615         ./make_self_nested_test.sh self_nested_access_check_34_${I} valid "$OP" famorassem assembly
1616         ./make_self_nested_test.sh self_nested_access_check_35_${I} unverifiable "$OP" famorassem famandassem
1617         ./make_self_nested_test.sh self_nested_access_check_36_${I} valid "$OP" famorassem famorassem
1618         I=`expr $I + 1`
1619 done
1620
1621
1622 I=1
1623 for OP in "ldc.i4.0\n\t\tstsfld int32 Owner\/Nested::sfld" "ldsfld int32 Owner\/Nested::sfld\n\n\tpop" "ldsflda int32 Owner\/Nested::sfld\n\n\tpop" "callvirt instance int32 class Owner\/Nested::Target()" "call instance int32 class Owner\/Nested::Target()" "ldc.i4.0\n\t\tstfld int32 Owner\/Nested::fld\n\t\tldc.i4.0" "ldfld int32 Owner\/Nested::fld" "ldflda int32 Owner\/Nested::fld"
1624 do
1625         ./make_cross_nested_access_test.sh cross_nested_access_check_1_${I} valid "$OP" public public no
1626         ./make_cross_nested_access_test.sh cross_nested_access_check_2_${I} valid "$OP" public public yes
1627         ./make_cross_nested_access_test.sh cross_nested_access_check_3_${I} unverifiable "$OP" public private no
1628         ./make_cross_nested_access_test.sh cross_nested_access_check_4_${I} unverifiable "$OP" public private yes
1629         ./make_cross_nested_access_test.sh cross_nested_access_check_5_${I} unverifiable "$OP" public family no
1630         ./make_cross_nested_access_test.sh cross_nested_access_check_7_${I} valid "$OP" public assembly no
1631         ./make_cross_nested_access_test.sh cross_nested_access_check_8_${I} valid "$OP" public assembly yes
1632         ./make_cross_nested_access_test.sh cross_nested_access_check_9_${I} unverifiable "$OP" public famandassem no
1633         ./make_cross_nested_access_test.sh cross_nested_access_check_b_${I} valid "$OP" public famorassem no
1634         ./make_cross_nested_access_test.sh cross_nested_access_check_c_${I} valid "$OP" public famorassem yes
1635
1636         ./make_cross_nested_access_test.sh cross_nested_access_check_11_${I} valid "$OP" private public no
1637         ./make_cross_nested_access_test.sh cross_nested_access_check_12_${I} valid "$OP" private public yes
1638         ./make_cross_nested_access_test.sh cross_nested_access_check_13_${I} unverifiable "$OP" private private no
1639         ./make_cross_nested_access_test.sh cross_nested_access_check_14_${I} unverifiable "$OP" private private yes
1640         ./make_cross_nested_access_test.sh cross_nested_access_check_15_${I} unverifiable "$OP" private family no
1641         ./make_cross_nested_access_test.sh cross_nested_access_check_17_${I} valid "$OP" private assembly no
1642         ./make_cross_nested_access_test.sh cross_nested_access_check_18_${I} valid "$OP" private assembly yes
1643         ./make_cross_nested_access_test.sh cross_nested_access_check_19_${I} unverifiable "$OP" private famandassem no
1644         ./make_cross_nested_access_test.sh cross_nested_access_check_1b_${I} valid "$OP" private famorassem no
1645         ./make_cross_nested_access_test.sh cross_nested_access_check_1c_${I} valid "$OP" private famorassem yes
1646
1647         ./make_cross_nested_access_test.sh cross_nested_access_check_21_${I} valid "$OP" family public no
1648         ./make_cross_nested_access_test.sh cross_nested_access_check_22_${I} valid "$OP" family public yes
1649         ./make_cross_nested_access_test.sh cross_nested_access_check_23_${I} unverifiable "$OP" family private no
1650         ./make_cross_nested_access_test.sh cross_nested_access_check_24_${I} unverifiable "$OP" family private yes
1651         ./make_cross_nested_access_test.sh cross_nested_access_check_25_${I} unverifiable "$OP" family family no
1652         ./make_cross_nested_access_test.sh cross_nested_access_check_27_${I} valid "$OP" family assembly no
1653         ./make_cross_nested_access_test.sh cross_nested_access_check_28_${I} valid "$OP" family assembly yes
1654         ./make_cross_nested_access_test.sh cross_nested_access_check_29_${I} unverifiable "$OP" family famandassem no
1655         ./make_cross_nested_access_test.sh cross_nested_access_check_2b_${I} valid "$OP" family famorassem no
1656         ./make_cross_nested_access_test.sh cross_nested_access_check_2c_${I} valid "$OP" family famorassem yes
1657
1658         ./make_cross_nested_access_test.sh cross_nested_access_check_31_${I} valid "$OP" assembly public no
1659         ./make_cross_nested_access_test.sh cross_nested_access_check_32_${I} valid "$OP" assembly public yes
1660         ./make_cross_nested_access_test.sh cross_nested_access_check_33_${I} unverifiable "$OP" assembly private no
1661         ./make_cross_nested_access_test.sh cross_nested_access_check_34_${I} unverifiable "$OP" assembly private yes
1662         ./make_cross_nested_access_test.sh cross_nested_access_check_35_${I} unverifiable "$OP" assembly family no
1663         ./make_cross_nested_access_test.sh cross_nested_access_check_37_${I} valid "$OP" assembly assembly no
1664         ./make_cross_nested_access_test.sh cross_nested_access_check_38_${I} valid "$OP" assembly assembly yes
1665         ./make_cross_nested_access_test.sh cross_nested_access_check_39_${I} unverifiable "$OP" assembly famandassem no
1666         ./make_cross_nested_access_test.sh cross_nested_access_check_3b_${I} valid "$OP" assembly famorassem no
1667         ./make_cross_nested_access_test.sh cross_nested_access_check_3c_${I} valid "$OP" assembly famorassem yes
1668
1669         ./make_cross_nested_access_test.sh cross_nested_access_check_41_${I} valid "$OP" famandassem public no
1670         ./make_cross_nested_access_test.sh cross_nested_access_check_42_${I} valid "$OP" famandassem public yes
1671         ./make_cross_nested_access_test.sh cross_nested_access_check_43_${I} unverifiable "$OP" famandassem private no
1672         ./make_cross_nested_access_test.sh cross_nested_access_check_44_${I} unverifiable "$OP" famandassem private yes
1673         ./make_cross_nested_access_test.sh cross_nested_access_check_45_${I} unverifiable "$OP" famandassem family no
1674         ./make_cross_nested_access_test.sh cross_nested_access_check_47_${I} valid "$OP" famandassem assembly no
1675         ./make_cross_nested_access_test.sh cross_nested_access_check_48_${I} valid "$OP" famandassem assembly yes
1676         ./make_cross_nested_access_test.sh cross_nested_access_check_49_${I} unverifiable "$OP" famandassem famandassem no
1677         ./make_cross_nested_access_test.sh cross_nested_access_check_4b_${I} valid "$OP" famandassem famorassem no
1678         ./make_cross_nested_access_test.sh cross_nested_access_check_4c_${I} valid "$OP" famandassem famorassem yes
1679
1680         ./make_cross_nested_access_test.sh cross_nested_access_check_51_${I} valid "$OP" famorassem public no
1681         ./make_cross_nested_access_test.sh cross_nested_access_check_52_${I} valid "$OP" famorassem public yes
1682         ./make_cross_nested_access_test.sh cross_nested_access_check_53_${I} unverifiable "$OP" famorassem private no
1683         ./make_cross_nested_access_test.sh cross_nested_access_check_54_${I} unverifiable "$OP" famorassem private yes
1684         ./make_cross_nested_access_test.sh cross_nested_access_check_55_${I} unverifiable "$OP" famorassem family no
1685         ./make_cross_nested_access_test.sh cross_nested_access_check_57_${I} valid "$OP" famorassem assembly no
1686         ./make_cross_nested_access_test.sh cross_nested_access_check_58_${I} valid "$OP" famorassem assembly yes
1687         ./make_cross_nested_access_test.sh cross_nested_access_check_59_${I} unverifiable "$OP" famorassem famandassem no
1688         ./make_cross_nested_access_test.sh cross_nested_access_check_5b_${I} valid "$OP" famorassem famorassem no
1689         ./make_cross_nested_access_test.sh cross_nested_access_check_5c_${I} valid "$OP" famorassem famorassem yes
1690         I=`expr $I + 1`
1691 done
1692
1693
1694 I=1
1695 for OP in "callvirt instance int32 class Owner\/Nested::Target()" "call instance int32 class Owner\/Nested::Target()" "ldc.i4.0\n\t\tstfld int32 Owner\/Nested::fld\n\t\tldc.i4.0" "ldc.i4.0\n\t\tstsfld int32 Owner\/Nested::sfld" "ldsfld int32 Owner\/Nested::sfld\n\n\tpop" "ldfld int32 Owner\/Nested::fld" "ldsflda int32 Owner\/Nested::sfld\n\n\tpop" "ldflda int32 Owner\/Nested::fld"
1696 do
1697         ./make_cross_nested_access_test.sh cross_nested_access_check_2a_${I} valid "$OP" public public yes yes
1698         ./make_cross_nested_access_test.sh cross_nested_access_check_4a_${I} unverifiable "$OP" public private yes yes
1699         ./make_cross_nested_access_test.sh cross_nested_access_check_8a_${I} valid "$OP" public assembly yes yes
1700         ./make_cross_nested_access_test.sh cross_nested_access_check_ca_${I} valid "$OP" public famorassem yes yes
1701
1702         ./make_cross_nested_access_test.sh cross_nested_access_check_12a_${I} valid "$OP" private public yes yes
1703         ./make_cross_nested_access_test.sh cross_nested_access_check_14a_${I} unverifiable "$OP" private private yes yes
1704         ./make_cross_nested_access_test.sh cross_nested_access_check_18a_${I} valid "$OP" private assembly yes yes
1705         ./make_cross_nested_access_test.sh cross_nested_access_check_1ca_${I} valid "$OP" private famorassem yes yes
1706
1707         ./make_cross_nested_access_test.sh cross_nested_access_check_22a_${I} valid "$OP" family public yes yes
1708         ./make_cross_nested_access_test.sh cross_nested_access_check_24a_${I} unverifiable "$OP" family private yes yes
1709         ./make_cross_nested_access_test.sh cross_nested_access_check_28a_${I} valid "$OP" family assembly yes yes
1710         ./make_cross_nested_access_test.sh cross_nested_access_check_2ca_${I} valid "$OP" family famorassem yes yes
1711
1712         ./make_cross_nested_access_test.sh cross_nested_access_check_32a_${I} valid "$OP" assembly public yes yes
1713         ./make_cross_nested_access_test.sh cross_nested_access_check_34a_${I} unverifiable "$OP" assembly private yes yes
1714         ./make_cross_nested_access_test.sh cross_nested_access_check_38a_${I} valid "$OP" assembly assembly yes yes
1715         ./make_cross_nested_access_test.sh cross_nested_access_check_3ca_${I} valid "$OP" assembly famorassem yes yes
1716
1717         ./make_cross_nested_access_test.sh cross_nested_access_check_42a_${I} valid "$OP" famandassem public yes yes
1718         ./make_cross_nested_access_test.sh cross_nested_access_check_44a_${I} unverifiable "$OP" famandassem private yes yes
1719         ./make_cross_nested_access_test.sh cross_nested_access_check_48a_${I} valid "$OP" famandassem assembly yes yes
1720         ./make_cross_nested_access_test.sh cross_nested_access_check_4ca_${I} valid "$OP" famandassem famorassem yes yes
1721
1722         ./make_cross_nested_access_test.sh cross_nested_access_check_52a_${I} valid "$OP" famorassem public yes yes
1723         ./make_cross_nested_access_test.sh cross_nested_access_check_54a_${I} unverifiable "$OP" famorassem private yes yes
1724         ./make_cross_nested_access_test.sh cross_nested_access_check_58a_${I} valid "$OP" famorassem assembly yes yes
1725         ./make_cross_nested_access_test.sh cross_nested_access_check_5ca_${I} valid "$OP" famorassem famorassem yes yes
1726         I=`expr $I + 1`
1727 done
1728
1729
1730 I=1
1731 for OP in "callvirt instance int32 class Owner\/Nested::Target()" "call instance int32 class Owner\/Nested::Target()" "ldc.i4.0\n\t\tstfld int32 Owner\/Nested::fld\n\t\tldc.i4.0" "ldfld int32 Owner\/Nested::fld" "ldflda int32 Owner\/Nested::fld"
1732 do
1733         ./make_cross_nested_access_test.sh cross_nested_access_check_6_${I} unverifiable "$OP" public family yes
1734         ./make_cross_nested_access_test.sh cross_nested_access_check_6a_${I} valid "$OP" public family yes yes
1735         ./make_cross_nested_access_test.sh cross_nested_access_check_a_${I} unverifiable "$OP" public famandassem yes
1736         ./make_cross_nested_access_test.sh cross_nested_access_check_aa_${I} valid "$OP" public famandassem yes yes
1737
1738         ./make_cross_nested_access_test.sh cross_nested_access_check_16_${I} unverifiable "$OP" private family yes
1739         ./make_cross_nested_access_test.sh cross_nested_access_check_16a_${I} valid "$OP" private family yes yes
1740         ./make_cross_nested_access_test.sh cross_nested_access_check_1a_${I} unverifiable "$OP" private famandassem yes
1741         ./make_cross_nested_access_test.sh cross_nested_access_check_1aa_${I} valid "$OP" private famandassem yes yes
1742
1743         ./make_cross_nested_access_test.sh cross_nested_access_check_26_${I} unverifiable "$OP" family family yes
1744         ./make_cross_nested_access_test.sh cross_nested_access_check_26a_${I} valid "$OP" family family yes yes
1745         ./make_cross_nested_access_test.sh cross_nested_access_check_2a_${I} unverifiable "$OP" family famandassem yes
1746         ./make_cross_nested_access_test.sh cross_nested_access_check_2aa_${I} valid "$OP" family famandassem yes yes
1747
1748         ./make_cross_nested_access_test.sh cross_nested_access_check_36_${I} unverifiable "$OP" assembly family yes
1749         ./make_cross_nested_access_test.sh cross_nested_access_check_36a_${I} valid "$OP" assembly family yes yes
1750         ./make_cross_nested_access_test.sh cross_nested_access_check_3a_${I} unverifiable "$OP" assembly famandassem yes
1751         ./make_cross_nested_access_test.sh cross_nested_access_check_3aa_${I} valid "$OP" assembly famandassem yes yes
1752
1753         ./make_cross_nested_access_test.sh cross_nested_access_check_46_${I} unverifiable "$OP" famandassem family yes
1754         ./make_cross_nested_access_test.sh cross_nested_access_check_46a_${I} valid "$OP" famandassem family yes yes
1755         ./make_cross_nested_access_test.sh cross_nested_access_check_4a_${I} unverifiable "$OP" famandassem famandassem yes
1756         ./make_cross_nested_access_test.sh cross_nested_access_check_4aa_${I} valid "$OP" famandassem famandassem yes yes
1757
1758         ./make_cross_nested_access_test.sh cross_nested_access_check_56_${I} unverifiable "$OP" famorassem family yes
1759         ./make_cross_nested_access_test.sh cross_nested_access_check_56a_${I} valid "$OP" famorassem family yes yes
1760         ./make_cross_nested_access_test.sh cross_nested_access_check_5a_${I} unverifiable "$OP" famorassem famandassem yes
1761         ./make_cross_nested_access_test.sh cross_nested_access_check_5aa_${I} valid "$OP" famorassem famandassem yes yes
1762
1763         I=`expr $I + 1`
1764 done
1765
1766 for OP in "ldc.i4.0\n\t\tstsfld int32 Owner\/Nested::sfld" "ldsfld int32 Owner\/Nested::sfld\n\n\tpop" "ldsflda int32 Owner\/Nested::sfld\n\n\tpop"
1767 do
1768         ./make_cross_nested_access_test.sh cross_nested_access_check_6_${I} valid "$OP" public family yes
1769         ./make_cross_nested_access_test.sh cross_nested_access_check_6a_${I} valid "$OP" public family yes yes
1770         ./make_cross_nested_access_test.sh cross_nested_access_check_a_${I} valid "$OP" public famandassem yes
1771         ./make_cross_nested_access_test.sh cross_nested_access_check_aa_${I} valid "$OP" public famandassem yes yes
1772
1773         ./make_cross_nested_access_test.sh cross_nested_access_check_16_${I} valid "$OP" private family yes
1774         ./make_cross_nested_access_test.sh cross_nested_access_check_16a_${I} valid "$OP" private family yes yes
1775         ./make_cross_nested_access_test.sh cross_nested_access_check_1a_${I} valid "$OP" private famandassem yes
1776         ./make_cross_nested_access_test.sh cross_nested_access_check_1aa_${I} valid "$OP" private famandassem yes yes
1777
1778         ./make_cross_nested_access_test.sh cross_nested_access_check_26_${I} valid "$OP" family family yes
1779         ./make_cross_nested_access_test.sh cross_nested_access_check_26a_${I} valid "$OP" family family yes yes
1780         ./make_cross_nested_access_test.sh cross_nested_access_check_2a_${I} valid "$OP" family famandassem yes
1781         ./make_cross_nested_access_test.sh cross_nested_access_check_2aa_${I} valid "$OP" family famandassem yes yes
1782
1783         ./make_cross_nested_access_test.sh cross_nested_access_check_36_${I} valid "$OP" assembly family yes
1784         ./make_cross_nested_access_test.sh cross_nested_access_check_36a_${I} valid "$OP" assembly family yes yes
1785         ./make_cross_nested_access_test.sh cross_nested_access_check_3a_${I} valid "$OP" assembly famandassem yes
1786         ./make_cross_nested_access_test.sh cross_nested_access_check_3aa_${I} valid "$OP" assembly famandassem yes yes
1787
1788         ./make_cross_nested_access_test.sh cross_nested_access_check_46_${I} valid "$OP" famandassem family yes
1789         ./make_cross_nested_access_test.sh cross_nested_access_check_46a_${I} valid "$OP" famandassem family yes yes
1790         ./make_cross_nested_access_test.sh cross_nested_access_check_4a_${I} valid "$OP" famandassem famandassem yes
1791         ./make_cross_nested_access_test.sh cross_nested_access_check_4aa_${I} valid "$OP" famandassem famandassem yes yes
1792
1793         ./make_cross_nested_access_test.sh cross_nested_access_check_56_${I} valid "$OP" famorassem family yes
1794         ./make_cross_nested_access_test.sh cross_nested_access_check_56a_${I} valid "$OP" famorassem family yes yes
1795         ./make_cross_nested_access_test.sh cross_nested_access_check_5a_${I} valid "$OP" famorassem famandassem yes
1796         ./make_cross_nested_access_test.sh cross_nested_access_check_5aa_${I} valid "$OP" famorassem famandassem yes yes
1797
1798         I=`expr $I + 1`
1799 done
1800
1801
1802
1803 I=1
1804 for OP in "ldc.i4.0\n\t\tstfld int32 Class::fld\n\t\tldc.i4.0" "ldc.i4.0\n\t\tstsfld int32 Class::sfld" "ldsfld int32 Class::sfld\n\n\tpop" "ldfld int32 Class::fld" "ldsflda int32 Class::sfld\n\n\tpop" "ldflda int32 Class::fld" "call instance int32 Class::Method()" "callvirt int32 Class::Method()"
1805 do
1806         ./make_access_test.sh access_check_1_${I} valid "$OP" public public no
1807         ./make_access_test.sh access_check_2_${I} valid "$OP" public public yes
1808         ./make_access_test.sh access_check_3_${I} unverifiable "$OP" public private no
1809         ./make_access_test.sh access_check_4_${I} unverifiable "$OP" public private yes
1810         ./make_access_test.sh access_check_5_${I} unverifiable "$OP" public family no
1811         ./make_access_test.sh access_check_7_${I} valid "$OP" public assembly no
1812         ./make_access_test.sh access_check_8_${I} valid "$OP" public assembly yes
1813         ./make_access_test.sh access_check_9_${I} unverifiable "$OP" public famandassem no
1814         ./make_access_test.sh access_check_b_${I} valid "$OP" public famorassem no
1815         ./make_access_test.sh access_check_c_${I} valid "$OP" public famorassem yes
1816
1817         ./make_access_test.sh access_check_11_${I} valid "$OP" private public no
1818         ./make_access_test.sh access_check_12_${I} valid "$OP" private public yes
1819         ./make_access_test.sh access_check_13_${I} unverifiable "$OP" private private no
1820         ./make_access_test.sh access_check_14_${I} unverifiable "$OP" private private yes
1821         ./make_access_test.sh access_check_15_${I} unverifiable "$OP" private family no
1822         ./make_access_test.sh access_check_17_${I} valid "$OP" private assembly no
1823         ./make_access_test.sh access_check_18_${I} valid "$OP" private assembly yes
1824         ./make_access_test.sh access_check_19_${I} unverifiable "$OP" private famandassem no
1825         ./make_access_test.sh access_check_1b_${I} valid "$OP" private famorassem no
1826         ./make_access_test.sh access_check_1c_${I} valid "$OP" private famorassem yes
1827
1828         ./make_access_test.sh access_check_31_${I} valid "$OP" " " public no
1829         ./make_access_test.sh access_check_32_${I} valid "$OP" " " public yes
1830         ./make_access_test.sh access_check_33_${I} unverifiable "$OP" " " private no
1831         ./make_access_test.sh access_check_34_${I} unverifiable "$OP" " " private yes
1832         ./make_access_test.sh access_check_35_${I} unverifiable "$OP" " " family no
1833         ./make_access_test.sh access_check_37_${I} valid "$OP" " " assembly no
1834         ./make_access_test.sh access_check_38_${I} valid "$OP" " " assembly yes
1835         ./make_access_test.sh access_check_39_${I} unverifiable "$OP" " " famandassem no
1836         ./make_access_test.sh access_check_3b_${I} valid "$OP" " " famorassem no
1837         ./make_access_test.sh access_check_3c_${I} valid "$OP" " " famorassem yes
1838
1839         I=`expr $I + 1`
1840 done
1841
1842 #static members are different from instance members
1843 I=1
1844 for OP in "ldc.i4.0\n\t\tstsfld int32 Class::sfld" "ldsfld int32 Class::sfld\n\n\tpop" "ldsflda int32 Class::sfld\n\n\tpop" 
1845 do
1846         ./make_access_test.sh access_check_41_${I} valid "$OP" public family yes
1847         ./make_access_test.sh access_check_42_${I} valid "$OP" public famandassem yes
1848         ./make_access_test.sh access_check_43_${I} valid "$OP" private family yes
1849         ./make_access_test.sh access_check_44_${I} valid "$OP" private famandassem yes
1850         ./make_access_test.sh access_check_45_${I} valid "$OP" " " family yes
1851         ./make_access_test.sh access_check_46_${I} valid "$OP" " " famandassem yes
1852         I=`expr $I + 1`
1853 done
1854
1855 #try to access the base stuff directly
1856 I=1
1857 for OP in "ldc.i4.0\n\t\tstfld int32 Class::fld\n\t\tldc.i4.0" "ldfld int32 Class::fld" "ldflda int32 Class::fld" "call instance int32 Class::Method()" "callvirt int32 Class::Method()"
1858 do
1859         ./make_access_test.sh access_check_51_${I} unverifiable "$OP" public family yes
1860         ./make_access_test.sh access_check_52_${I} unverifiable "$OP" public famandassem yes
1861         ./make_access_test.sh access_check_53_${I} unverifiable "$OP" private family yes
1862         ./make_access_test.sh access_check_54_${I} unverifiable "$OP" private famandassem yes
1863         ./make_access_test.sh access_check_55_${I} unverifiable "$OP" " " family yes
1864         ./make_access_test.sh access_check_56_${I} unverifiable "$OP" " " famandassem yes
1865         I=`expr $I + 1`
1866 done
1867
1868 #try to access the subclass stuff
1869 I=1
1870 for OP in "ldc.i4.0\n\t\tstfld int32 Class::fld\n\t\tldc.i4.0" "ldfld int32 Class::fld" "ldflda int32 Class::fld" "call instance int32 Class::Method()" "callvirt int32 Class::Method()"
1871 do
1872         ./make_access_test.sh access_check_61_${I} valid "$OP" public family yes yes
1873         ./make_access_test.sh access_check_62_${I} valid "$OP" public famandassem yes yes
1874         ./make_access_test.sh access_check_63_${I} valid "$OP" private family yes yes
1875         ./make_access_test.sh access_check_64_${I} valid "$OP" private famandassem yes yes
1876         ./make_access_test.sh access_check_65_${I} valid "$OP" " " family yes yes
1877         ./make_access_test.sh access_check_66_${I} valid "$OP" " " famandassem yes yes
1878         I=`expr $I + 1`
1879 done
1880
1881
1882 function create_nesting_test_same_result () {
1883   K=$1
1884   for BASE in yes no
1885   do
1886     for NESTED in yes no
1887       do
1888         for LOAD in yes no
1889         do
1890           if ! ( [ "$NESTED" == "no" ] && [ "$LOAD" == "yes" ] ) ; then
1891             ./make_double_nesting_test.sh double_nesting_access_check_${K}_$I $2 "$OP" $3 $4 $5 "$BASE" "$NESTED" "$LOAD"
1892             K=`expr $K + 1`
1893           fi
1894       done
1895     done
1896   done
1897 }
1898
1899 function create_nesting_test_only_first_ok () {
1900   FIRST=$1
1901   K=$1
1902   for BASE in yes no
1903   do
1904     for NESTED in yes no
1905       do
1906         for LOAD in yes no
1907         do
1908           if ! ( [ "$NESTED" == "no" ] && [ "$LOAD" == "yes" ] ) ; then
1909                EXPECT=unverifiable
1910            if [ "$FIRST" == "$K" ]; then
1911               EXPECT=valid
1912            fi
1913            ./make_double_nesting_test.sh double_nesting_access_check_${K}_$I $EXPECT "$OP" $2 $3 $4 "$BASE" "$NESTED" "$LOAD"
1914            K=`expr $K + 1`
1915          fi
1916      done
1917     done
1918   done
1919 }
1920
1921 I=1
1922
1923 for OP in "callvirt instance int32 class Root\/Nested::Target()" "ldc.i4.0\n\t\tstfld int32 Root\/Nested::fld\n\t\tldc.i4.0" "ldfld int32 Root\/Nested::fld" "ldflda int32 Root\/Nested::fld"
1924 do
1925   create_nesting_test_same_result 1 valid public assembly assembly
1926
1927   ./make_double_nesting_test.sh double_nesting_access_check_7_$I valid "$OP" public assembly family yes yes yes
1928   ./make_double_nesting_test.sh double_nesting_access_check_8_$I unverifiable "$OP" public assembly family yes yes no
1929   ./make_double_nesting_test.sh double_nesting_access_check_9_$I unverifiable "$OP" public assembly family yes no no
1930   ./make_double_nesting_test.sh double_nesting_access_check_10_$I valid "$OP" public assembly family no yes yes
1931   ./make_double_nesting_test.sh double_nesting_access_check_11_$I unverifiable "$OP" public assembly family no yes no
1932   ./make_double_nesting_test.sh double_nesting_access_check_12_$I unverifiable "$OP" public assembly family no no no
1933
1934   ./make_double_nesting_test.sh double_nesting_access_check_13_$I valid "$OP" public assembly famandassem yes yes yes
1935   ./make_double_nesting_test.sh double_nesting_access_check_14_$I unverifiable "$OP" public assembly famandassem yes yes no
1936   ./make_double_nesting_test.sh double_nesting_access_check_15_$I unverifiable "$OP" public assembly famandassem yes no no
1937   ./make_double_nesting_test.sh double_nesting_access_check_16_$I valid "$OP" public assembly famandassem no yes yes
1938   ./make_double_nesting_test.sh double_nesting_access_check_17_$I unverifiable "$OP" public assembly famandassem no yes no
1939   ./make_double_nesting_test.sh double_nesting_access_check_18_$I unverifiable "$OP" public assembly famandassem no no no
1940
1941   create_nesting_test_same_result 19 valid public assembly famorassem
1942   create_nesting_test_same_result 25 unverifiable public assembly private
1943   create_nesting_test_same_result 31 valid public assembly public
1944
1945   ./make_double_nesting_test.sh double_nesting_access_check_37_$I valid "$OP" public family assembly yes yes yes
1946   ./make_double_nesting_test.sh double_nesting_access_check_38_$I valid "$OP" public family assembly yes yes no
1947   ./make_double_nesting_test.sh double_nesting_access_check_39_$I valid "$OP" public family assembly yes no no
1948   ./make_double_nesting_test.sh double_nesting_access_check_40_$I unverifiable "$OP" public family assembly no yes yes
1949   ./make_double_nesting_test.sh double_nesting_access_check_41_$I unverifiable "$OP" public family assembly no yes no
1950   ./make_double_nesting_test.sh double_nesting_access_check_42_$I unverifiable "$OP" public family assembly no no no
1951
1952   create_nesting_test_only_first_ok 43 public family family
1953   create_nesting_test_only_first_ok 49 public family famandassem
1954
1955   ./make_double_nesting_test.sh double_nesting_access_check_55_$I valid "$OP" public family famorassem yes yes yes
1956   ./make_double_nesting_test.sh double_nesting_access_check_56_$I valid "$OP" public family famorassem yes yes no
1957   ./make_double_nesting_test.sh double_nesting_access_check_57_$I valid "$OP" public family famorassem yes no no
1958   ./make_double_nesting_test.sh double_nesting_access_check_58_$I unverifiable "$OP" public family famorassem no yes yes
1959   ./make_double_nesting_test.sh double_nesting_access_check_59_$I unverifiable "$OP" public family famorassem no yes no
1960   ./make_double_nesting_test.sh double_nesting_access_check_60_$I unverifiable "$OP" public family famorassem no no no
1961
1962    create_nesting_test_same_result 61 unverifiable public family private
1963
1964   ./make_double_nesting_test.sh double_nesting_access_check_67_$I valid "$OP" public family public yes yes yes
1965   ./make_double_nesting_test.sh double_nesting_access_check_68_$I valid "$OP" public family public yes yes no
1966   ./make_double_nesting_test.sh double_nesting_access_check_69_$I valid "$OP" public family public yes no no
1967   ./make_double_nesting_test.sh double_nesting_access_check_70_$I unverifiable "$OP" public family public no yes yes
1968   ./make_double_nesting_test.sh double_nesting_access_check_71_$I unverifiable "$OP" public family public no yes no
1969   ./make_double_nesting_test.sh double_nesting_access_check_72_$I unverifiable "$OP" public family public no no no
1970
1971   ./make_double_nesting_test.sh double_nesting_access_check_73_$I valid "$OP" public famandassem assembly yes yes yes
1972   ./make_double_nesting_test.sh double_nesting_access_check_74_$I valid "$OP" public famandassem assembly yes yes no
1973   ./make_double_nesting_test.sh double_nesting_access_check_75_$I valid "$OP" public famandassem assembly yes no no
1974   ./make_double_nesting_test.sh double_nesting_access_check_76_$I unverifiable "$OP" public famandassem assembly no yes yes
1975   ./make_double_nesting_test.sh double_nesting_access_check_77_$I unverifiable "$OP" public famandassem assembly no yes no
1976   ./make_double_nesting_test.sh double_nesting_access_check_78_$I unverifiable "$OP" public famandassem assembly no no no
1977
1978   create_nesting_test_only_first_ok 79  public famandassem family
1979   create_nesting_test_only_first_ok 85  public famandassem famandassem
1980
1981   ./make_double_nesting_test.sh double_nesting_access_check_91_$I valid "$OP" public famandassem famorassem yes yes yes
1982   ./make_double_nesting_test.sh double_nesting_access_check_92_$I valid "$OP" public famandassem famorassem yes yes no
1983   ./make_double_nesting_test.sh double_nesting_access_check_93_$I valid "$OP" public famandassem famorassem yes no no
1984   ./make_double_nesting_test.sh double_nesting_access_check_94_$I unverifiable "$OP" public famandassem famorassem no yes yes
1985   ./make_double_nesting_test.sh double_nesting_access_check_95_$I unverifiable "$OP" public famandassem famorassem no yes no
1986   ./make_double_nesting_test.sh double_nesting_access_check_96_$I unverifiable "$OP" public famandassem famorassem no no no
1987
1988    create_nesting_test_same_result 97 unverifiable public famandassem private
1989
1990   ./make_double_nesting_test.sh double_nesting_access_check_103_$I valid "$OP" public famandassem public yes yes yes
1991   ./make_double_nesting_test.sh double_nesting_access_check_104_$I valid "$OP" public famandassem public yes yes no
1992   ./make_double_nesting_test.sh double_nesting_access_check_105_$I valid "$OP" public famandassem public yes no no
1993   ./make_double_nesting_test.sh double_nesting_access_check_106_$I unverifiable "$OP" public famandassem public no yes yes
1994   ./make_double_nesting_test.sh double_nesting_access_check_107_$I unverifiable "$OP" public famandassem public no yes no
1995   ./make_double_nesting_test.sh double_nesting_access_check_108_$I unverifiable "$OP" public famandassem public no no no
1996
1997   create_nesting_test_same_result 109 valid public famorassem assembly
1998
1999   ./make_double_nesting_test.sh double_nesting_access_check_115_$I valid "$OP" public famorassem family yes yes yes
2000   ./make_double_nesting_test.sh double_nesting_access_check_116_$I unverifiable "$OP" public famorassem family yes yes no
2001   ./make_double_nesting_test.sh double_nesting_access_check_117_$I unverifiable "$OP" public famorassem family yes no no
2002   ./make_double_nesting_test.sh double_nesting_access_check_118_$I valid "$OP" public famorassem family no yes yes
2003   ./make_double_nesting_test.sh double_nesting_access_check_119_$I unverifiable "$OP" public famorassem family no yes no
2004   ./make_double_nesting_test.sh double_nesting_access_check_120_$I unverifiable "$OP" public famorassem family no no no
2005
2006   ./make_double_nesting_test.sh double_nesting_access_check_121_$I valid "$OP" public famorassem famandassem yes yes yes
2007   ./make_double_nesting_test.sh double_nesting_access_check_122_$I unverifiable "$OP" public famorassem famandassem yes yes no
2008   ./make_double_nesting_test.sh double_nesting_access_check_123_$I unverifiable "$OP" public famorassem famandassem yes no no
2009   ./make_double_nesting_test.sh double_nesting_access_check_124_$I valid "$OP" public famorassem famandassem no yes yes
2010   ./make_double_nesting_test.sh double_nesting_access_check_125_$I unverifiable "$OP" public famorassem famandassem no yes no
2011   ./make_double_nesting_test.sh double_nesting_access_check_126_$I unverifiable "$OP" public famorassem famandassem no no no
2012
2013   create_nesting_test_same_result 127 valid public famorassem famorassem
2014   create_nesting_test_same_result 133 unverifiable public famorassem private
2015   create_nesting_test_same_result 139 valid public famorassem public
2016   create_nesting_test_same_result 145 unverifiable public private assembly
2017   create_nesting_test_same_result 151 unverifiable public private family
2018   create_nesting_test_same_result 157 unverifiable public private famandassem
2019   create_nesting_test_same_result 163 unverifiable public private famorassem
2020   create_nesting_test_same_result 169 unverifiable public private private
2021   create_nesting_test_same_result 175 unverifiable public private public
2022   create_nesting_test_same_result 181 valid public public assembly
2023
2024   ./make_double_nesting_test.sh double_nesting_access_check_187_$I valid "$OP" public public family yes yes yes
2025   ./make_double_nesting_test.sh double_nesting_access_check_188_$I unverifiable "$OP" public public family yes yes no
2026   ./make_double_nesting_test.sh double_nesting_access_check_189_$I unverifiable "$OP" public public family yes no no
2027   ./make_double_nesting_test.sh double_nesting_access_check_190_$I valid "$OP" public public family no yes yes
2028   ./make_double_nesting_test.sh double_nesting_access_check_191_$I unverifiable "$OP" public public family no yes no
2029   ./make_double_nesting_test.sh double_nesting_access_check_192_$I unverifiable "$OP" public public family no no no
2030
2031   ./make_double_nesting_test.sh double_nesting_access_check_193_$I valid "$OP" public public famandassem yes yes yes
2032   ./make_double_nesting_test.sh double_nesting_access_check_194_$I unverifiable "$OP" public public famandassem yes yes no
2033   ./make_double_nesting_test.sh double_nesting_access_check_195_$I unverifiable "$OP" public public famandassem yes no no
2034   ./make_double_nesting_test.sh double_nesting_access_check_196_$I valid "$OP" public public famandassem no yes yes
2035   ./make_double_nesting_test.sh double_nesting_access_check_197_$I unverifiable "$OP" public public famandassem no yes no
2036   ./make_double_nesting_test.sh double_nesting_access_check_198_$I unverifiable "$OP" public public famandassem no no no
2037
2038   create_nesting_test_same_result 199 valid public public famorassem
2039   create_nesting_test_same_result 205 unverifiable public public private
2040   create_nesting_test_same_result 211 valid public public public
2041   I=`expr $I + 1`
2042 done
2043
2044 function create_nesting_test_same_result_static () {
2045   K=$1
2046   for BASE in yes no
2047   do
2048     for NESTED in yes no
2049       do
2050         ./make_double_nesting_test.sh double_nesting_access_check_${K}_$I $2 "$OP" $3 $4 $5 "$BASE" "$NESTED" yes
2051         K=`expr $K + 1`
2052     done
2053   done
2054 }
2055
2056 function create_nesting_test_strips_result_static () {
2057   K=$1
2058   for BASE in yes no
2059   do
2060     for NESTED in yes no
2061       do
2062         EXPECT=unverifiable
2063         if [ "$NESTED" == "yes" ]; then
2064           EXPECT=valid
2065         fi
2066         ./make_double_nesting_test.sh double_nesting_access_check_${K}_$I $EXPECT "$OP" $2 $3 $4 "$BASE" "$NESTED" yes
2067         K=`expr $K + 1`
2068     done
2069   done
2070 }
2071
2072 for OP in "ldc.i4.0\n\t\tstsfld int32 Root\/Nested::sfld" "ldsfld int32 Root\/Nested::sfld\n\n\tpop" "ldsflda int32 Root\/Nested::sfld\n\n\tpop"
2073 do
2074    create_nesting_test_same_result 1 valid public assembly assembly
2075
2076   create_nesting_test_strips_result_static 5 public assembly family
2077   create_nesting_test_strips_result_static 9 public assembly family
2078
2079   create_nesting_test_same_result 13 valid public assembly famorassem
2080   create_nesting_test_same_result 17 unverifiable public assembly private
2081   create_nesting_test_same_result 21 valid public assembly public
2082
2083   ./make_double_nesting_test.sh double_nesting_access_check_25_$I valid "$OP" public family assembly yes yes yes
2084   ./make_double_nesting_test.sh double_nesting_access_check_26_$I valid "$OP" public family assembly yes no yes
2085   ./make_double_nesting_test.sh double_nesting_access_check_27_$I unverifiable "$OP" public family assembly no yes yes
2086   ./make_double_nesting_test.sh double_nesting_access_check_27_$I unverifiable "$OP" public family assembly no no yes
2087
2088   ./make_double_nesting_test.sh double_nesting_access_check_29_$I valid "$OP" public family family yes yes yes
2089   ./make_double_nesting_test.sh double_nesting_access_check_30_$I unverifiable "$OP" public family family yes no yes
2090   ./make_double_nesting_test.sh double_nesting_access_check_31_$I unverifiable "$OP" public family family no yes yes
2091   ./make_double_nesting_test.sh double_nesting_access_check_32_$I unverifiable "$OP" public family family no no yes
2092
2093   ./make_double_nesting_test.sh double_nesting_access_check_33_$I valid "$OP" public family famandassem yes yes yes
2094   ./make_double_nesting_test.sh double_nesting_access_check_34_$I unverifiable "$OP" public family famandassem yes no yes
2095   ./make_double_nesting_test.sh double_nesting_access_check_35_$I unverifiable "$OP" public family famandassem no yes yes
2096   ./make_double_nesting_test.sh double_nesting_access_check_36_$I unverifiable "$OP" public family famandassem no no yes
2097
2098   ./make_double_nesting_test.sh double_nesting_access_check_37_$I valid "$OP" public family famorassem yes yes yes
2099   ./make_double_nesting_test.sh double_nesting_access_check_38_$I valid "$OP" public family famorassem yes no yes
2100   ./make_double_nesting_test.sh double_nesting_access_check_39_$I unverifiable "$OP" public family famorassem no yes yes
2101   ./make_double_nesting_test.sh double_nesting_access_check_40_$I unverifiable "$OP" public family famorassem no no yes
2102
2103    create_nesting_test_same_result 41 unverifiable public family private
2104
2105   ./make_double_nesting_test.sh double_nesting_access_check_45_$I valid "$OP" public family public yes yes yes
2106   ./make_double_nesting_test.sh double_nesting_access_check_46_$I valid "$OP" public family public yes no yes
2107   ./make_double_nesting_test.sh double_nesting_access_check_47_$I unverifiable "$OP" public family public no yes yes
2108   ./make_double_nesting_test.sh double_nesting_access_check_48_$I unverifiable "$OP" public family public no no yes
2109
2110   ./make_double_nesting_test.sh double_nesting_access_check_49_$I valid "$OP" public famandassem assembly yes yes yes
2111   ./make_double_nesting_test.sh double_nesting_access_check_50_$I valid "$OP" public famandassem assembly yes no yes
2112   ./make_double_nesting_test.sh double_nesting_access_check_51_$I unverifiable "$OP" public famandassem assembly no yes yes
2113   ./make_double_nesting_test.sh double_nesting_access_check_52_$I unverifiable "$OP" public famandassem assembly no no yes
2114
2115   ./make_double_nesting_test.sh double_nesting_access_check_53_$I valid "$OP" public famandassem family yes yes yes
2116   ./make_double_nesting_test.sh double_nesting_access_check_54_$I unverifiable "$OP" public famandassem family yes no yes
2117   ./make_double_nesting_test.sh double_nesting_access_check_55_$I unverifiable "$OP" public famandassem family no yes yes
2118   ./make_double_nesting_test.sh double_nesting_access_check_56_$I unverifiable "$OP" public famandassem family no no yes
2119
2120   ./make_double_nesting_test.sh double_nesting_access_check_57_$I valid "$OP" public famandassem famandassem yes yes yes
2121   ./make_double_nesting_test.sh double_nesting_access_check_58_$I unverifiable "$OP" public famandassem famandassem yes no yes
2122   ./make_double_nesting_test.sh double_nesting_access_check_59_$I unverifiable "$OP" public famandassem famandassem no yes yes
2123   ./make_double_nesting_test.sh double_nesting_access_check_60_$I unverifiable "$OP" public famandassem famandassem no no yes
2124
2125   ./make_double_nesting_test.sh double_nesting_access_check_61_$I valid "$OP" public famandassem famorassem yes yes yes
2126   ./make_double_nesting_test.sh double_nesting_access_check_62_$I valid "$OP" public famandassem famorassem yes no yes
2127   ./make_double_nesting_test.sh double_nesting_access_check_63_$I unverifiable "$OP" public famandassem famorassem no yes yes
2128   ./make_double_nesting_test.sh double_nesting_access_check_64_$I unverifiable "$OP" public famandassem famorassem no no yes
2129
2130   create_nesting_test_same_result 65 unverifiable public famandassem private
2131
2132   ./make_double_nesting_test.sh double_nesting_access_check_69_$I valid "$OP" public famandassem public yes yes yes
2133   ./make_double_nesting_test.sh double_nesting_access_check_70_$I valid "$OP" public famandassem public yes no yes
2134   ./make_double_nesting_test.sh double_nesting_access_check_71_$I unverifiable "$OP" public famandassem public no yes yes
2135   ./make_double_nesting_test.sh double_nesting_access_check_72_$I unverifiable "$OP" public famandassem public no no yes
2136
2137   create_nesting_test_same_result 73 valid public famorassem assembly
2138   create_nesting_test_strips_result_static 77 public famorassem family
2139   create_nesting_test_strips_result_static 81 public famorassem famandassem
2140
2141   create_nesting_test_same_result 85 valid public famorassem famorassem
2142   create_nesting_test_same_result 89 unverifiable public famorassem private
2143   create_nesting_test_same_result 93 valid public famorassem public
2144   create_nesting_test_same_result 97 unverifiable public private assembly
2145   create_nesting_test_same_result 101 unverifiable public private family
2146   create_nesting_test_same_result 105 unverifiable public private famandassem
2147   create_nesting_test_same_result 109 unverifiable public private famorassem
2148   create_nesting_test_same_result 113 unverifiable public private private
2149   create_nesting_test_same_result 117 unverifiable public private public
2150   create_nesting_test_same_result 121 valid public public assembly
2151   create_nesting_test_strips_result_static 125 public public family
2152   create_nesting_test_strips_result_static 129 public public famandassem
2153   create_nesting_test_same_result 133 valid public public famorassem
2154   create_nesting_test_same_result 137 unverifiable public public private
2155   create_nesting_test_same_result 141 valid public public public
2156
2157   I=`expr $I + 1`
2158 done
2159
2160
2161 #ldtoken tests
2162
2163 ./make_ldtoken_test.sh ldtoken_class valid "ldtoken class Example" "call class [mscorlib]System.Type class [mscorlib]System.Type::GetTypeFromHandle(valuetype [mscorlib]System.RuntimeTypeHandle)"
2164
2165 ./make_ldtoken_test.sh ldtoken_class invalid "ldtoken class [mscorlib]ExampleMM" "call class [mscorlib]System.Type class [mscorlib]System.Type::GetTypeFromHandle(valuetype [mscorlib]System.RuntimeTypeHandle)"
2166
2167 ./make_ldtoken_test.sh ldtoken_field valid "ldtoken field int32 Example::fld" "call class [mscorlib]System.Reflection.FieldInfo class [mscorlib]System.Reflection.FieldInfo::GetFieldFromHandle(valuetype [mscorlib]System.RuntimeFieldHandle)"
2168
2169 ./make_ldtoken_test.sh ldtoken_field invalid "ldtoken field int32 Example::MM" "call class [mscorlib]System.Reflection.FieldInfo class [mscorlib]System.Reflection.FieldInfo::GetFieldFromHandle(valuetype [mscorlib]System.RuntimeFieldHandle)"
2170
2171 ./make_ldtoken_test.sh ldtoken_method valid "ldtoken method void Example::Method()" "call class [mscorlib]System.Reflection.MethodBase class [mscorlib]System.Reflection.MethodBase::GetMethodFromHandle(valuetype [mscorlib]System.RuntimeMethodHandle)"
2172
2173 ./make_ldtoken_test.sh ldtoken_method invalid "ldtoken method int32 Example::Method()" "call class [mscorlib]System.Reflection.MethodBase class [mscorlib]System.Reflection.MethodBase::GetMethodFromHandle(valuetype [mscorlib]System.RuntimeMethodHandle)"
2174
2175
2176 #ldobj tests
2177 function fix_ldobj () {
2178         if [ "$3" != "" ]; then
2179                 A=$3;
2180         elif [ "$2" != "" ]; then
2181                 A=$2;
2182         else
2183                 A=$1;
2184         fi
2185
2186         if [ "$A" == "bool" ]; then
2187                 A="int8";
2188         elif [ "$A" == "char" ]; then
2189                 A="int16";
2190         fi
2191
2192         echo "$A";
2193 }
2194
2195
2196 I=1
2197
2198 #valid
2199 for T1 in 'int8' 'bool' 'unsigned int8' 'int16' 'char' 'unsigned int16' 'int32' 'unsigned int32' 'int64' 'unsigned int64' 'float32' 'float64'
2200 do
2201         for T2 in 'int8' 'bool' 'unsigned int8' 'int16' 'char' 'unsigned int16' 'int32' 'unsigned int32' 'int64' 'unsigned int64' 'float32' 'float64'
2202         do
2203                 TYPE1="$(fix_ldobj $T1)"
2204                 TYPE2="$(fix_ldobj $T2)"
2205                 if [ "$TYPE1" == "$TYPE2" ] ; then
2206                         ./make_ldobj_test.sh ldobj_${I} valid "${T1}\&" "${T2}"
2207                 else
2208                         ./make_ldobj_test.sh ldobj_${I} unverifiable "${T1}\&" "${T2}"
2209                 fi
2210                 I=`expr $I + 1`
2211         done
2212 done
2213
2214
2215
2216 #unverifiable
2217 #for T1 in "int8" "int64" "float64" "object" "string" "class Class" "int32[]" "int32[,]" "valuetype MyStruct" "valuetype MyStruct2" "int32 *" "valuetype MyStruct *" "method int32 *(int32)"
2218 for T1 in "native int" "int8*" "typedref" 
2219 do
2220         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>"
2221         do 
2222                 ./make_ldobj_test.sh ldobj_${I} unverifiable "${T1}" "${T2}"
2223                 I=`expr $I + 1`
2224         done
2225 done
2226
2227
2228
2229
2230 #invalid
2231 #for T1 in "int8" "int64" "float64" "object" "string" "class Class" "int32[]" "int32[,]" "valuetype MyStruct" "valuetype MyStruct2" "int32 *" "valuetype MyStruct *" "method int32 *(int32)"
2232 for T1 in 'int8' 'native int'
2233 do      
2234         for T2 in "int8\&" "int64\&" "float64\&" "object\&" "string\&" "class Class\&" "valuetype MyStruct\&" "native int\&" "class Template\`1<object>\&" "valuetype StructTemplate\`1<object>\&"  "valuetype StructTemplate2\`1<object>\&" "class [mscorlib]ExampleMM" "class [mscorlib]ExampleMM\&"
2235         do 
2236                 ./make_ldobj_test.sh ldobj_${I} invalid "${T1}" "${T2}"
2237                 I=`expr $I + 1`
2238         done
2239 done
2240
2241 ./make_ldobj_test.sh ldobj_struct_1 valid  "valuetype MyStruct\&" "valuetype MyStruct"
2242 ./make_ldobj_test.sh ldobj_struct_2 unverifiable  "valuetype MyStruct\&" "valuetype MyStruct2"
2243 ./make_ldobj_test.sh ldobj_struct_3 valid  "valuetype StructTemplate\`1<object>\&" "valuetype StructTemplate\`1<object>"
2244 ./make_ldobj_test.sh ldobj_struct_4 unverifiable  "valuetype StructTemplate\`1<object>\&" "valuetype StructTemplate2\`1<object>"
2245
2246 ./make_ldobj_test.sh ldobj_struct_5 valid  "object\&"  "object"
2247 ./make_ldobj_test.sh ldobj_struct_6 valid  "string\&"  "string"
2248 ./make_ldobj_test.sh ldobj_struct_7 valid  "int32[]\&"  "int32[]"
2249 ./make_ldobj_test.sh ldobj_struct_8 valid  "int32[,]\&"  "int32[,]"
2250 ./make_ldobj_test.sh ldobj_struct_9 valid  "class Template\`1<object>\&"  "class Template\`1<object>"
2251
2252
2253 # Unbox Test
2254
2255
2256 # unbox non-existent type.
2257 ./make_unbox_test.sh unbox_bad_type invalid "valuetype [mscorlib]NonExistent" "valuetype [mscorlib]NonExistent"
2258
2259 # Unbox byref type.
2260 ./make_unbox_test.sh unbox_byref_type invalid "int32" 'int32\&'
2261
2262 # Box unbox-like type.
2263 ./make_unbox_test.sh unbox_byref_like unverifiable typedref typedref
2264
2265 # Box unbox-like type.
2266 ./make_unbox_test.sh unbox_wrong_types valid object int32
2267
2268 #This is illegal since you cannot have a Void local variable, it should go into the structural tests part
2269 # Box void type.
2270 #./make_unary_test.sh box_void unverifiable "box [mscorlib]System.Void\n\tpop" "class [mscorlib]System.Void"
2271 I=1;
2272 for OP in "native int" "int32*" typedref int16 float32
2273 do
2274         ./make_unbox_test.sh unbox_bad_stack_${I} unverifiable "${OP}" int32 "nop" "yes"
2275         I=`expr $I + 1`
2276 done
2277
2278
2279 #unboxing from int32
2280 ./make_unbox_test.sh unbox_wrong_types_1 unverifiable int32 int32 "nop" "yes"
2281
2282 #unboxing from valuetype
2283 ./make_unbox_test.sh unbox_wrong_types_2 unverifiable "valuetype MyStruct" int32 "nop" "yes"
2284
2285 #unboxing from managed ref
2286 ./make_unbox_test.sh unbox_stack_byref unverifiable "valuetype MyEnum\&" "valuetype MyEnum" "nop" "yes"
2287
2288 # valid unboxing
2289 ./make_unbox_test.sh unbox_primitive valid "int32" "int32"
2290 ./make_unbox_test.sh unbox_struct valid "valuetype MyStruct" 'valuetype MyStruct'
2291 ./make_unbox_test.sh unbox_template valid "valuetype StructTemplate\`1<object>" "valuetype StructTemplate\`1<object>"
2292 ./make_unbox_test.sh unbox_enum valid "valuetype MyEnum" "valuetype MyEnum"
2293
2294
2295 #test if the unboxed value is right
2296 ./make_unbox_test.sh unbox_use_result_1 valid "valuetype MyStruct" "valuetype MyStruct" "ldfld int32 MyStruct::foo"
2297 ./make_unbox_test.sh unbox_use_result_2 valid "valuetype MyStruct" "valuetype MyStruct" "ldobj valuetype MyStruct\n\tstloc.0\n\tldc.i4.0"
2298 ./make_unbox_test.sh unbox_use_result_3 valid "int32" "int32" "ldind.i4\n\tstloc.1\n\tldc.i4.0"
2299
2300
2301 # newarray Test
2302
2303 #no int size on stack
2304 #invalid size type on stack
2305 #invalid array type (with bytref)
2306
2307 #Empty stack
2308 ./make_newarr_test.sh newarr_empty_stack invalid int32 int32 pop
2309
2310 #Stack type tests
2311 ./make_newarr_test.sh newarr_stack_type_1 valid int32 int32
2312 ./make_newarr_test.sh newarr_stack_type_2 valid "native int" int32
2313
2314 ./make_newarr_test.sh newarr_stack_type_3 unverifiable float32 int32
2315 ./make_newarr_test.sh newarr_stack_type_4 unverifiable object int32
2316
2317 #Invalid array element type (with byref)
2318 ./make_newarr_test.sh newarr_array_type_1 invalid int32 "int32\&"
2319
2320 #Check if the verifier push the right type on stack
2321 ./make_newarr_test.sh newarr_array_value valid int32 int32 nop "ldc.i4.0\n\tcallvirt instance int32 class [mscorlib]System.Array::GetLength(int32)"
2322
2323
2324
2325
2326 #Tests for ldind.X
2327 I=1
2328 for OP in "ldind.i1" "ldind.u1"
2329 do
2330         for TYPE in "int8" "bool" "unsigned int8"
2331         do
2332                 ./make_load_indirect_test.sh indirect_load_i1_${I} valid "${OP}" "${TYPE}"
2333                 I=`expr $I + 1`
2334         done
2335
2336         for TYPE in "int16" "char" "unsigned int16" "int32" "unsigned int32" "int64" "unsigned int64" "native int" "native unsigned int" "object" "string" "float32" "float64" "class Class" "valuetype MyStruct"  "int32[]" "int32[,]" "int32*" "method int32 *(int32)"  "class Template\`1<object>"
2337         do
2338                 ./make_load_indirect_test.sh indirect_load_i1_${I} unverifiable "${OP}" "${TYPE}"
2339                 I=`expr $I + 1`
2340         done
2341 done
2342
2343 I=1
2344 for OP in "ldind.i2" "ldind.u2"
2345 do
2346         for TYPE in "int16" "char" "unsigned int16"
2347         do
2348                 ./make_load_indirect_test.sh indirect_load_i2_${I} valid "${OP}" "${TYPE}"
2349                 I=`expr $I + 1`
2350         done
2351
2352         for TYPE in "int8" "bool" "unsigned int8" "int32" "unsigned int32" "int64" "unsigned int64" "native int" "native unsigned int" "object" "string" "float32" "float64" "class Class" "valuetype MyStruct"  "int32[]" "int32[,]" "int32*" "method int32 *(int32)"  "class Template\`1<object>"
2353         do
2354                 ./make_load_indirect_test.sh indirect_load_i2_${I} unverifiable "${OP}" "${TYPE}"
2355                 I=`expr $I + 1`
2356         done
2357 done
2358
2359 I=1
2360 for OP in "ldind.i4" "ldind.u4"
2361 do
2362         for TYPE in "int32" "unsigned int32" "native int" "native unsigned int"
2363         do
2364                 ./make_load_indirect_test.sh indirect_load_i4_${I} valid "${OP}" "${TYPE}"
2365                 I=`expr $I + 1`
2366         done
2367
2368         for TYPE in "int8" "bool" "unsigned int8" "int16" "char" "unsigned int16" "int64" "unsigned int64" "object" "string" "float32" "float64" "class Class" "valuetype MyStruct" "int32[]" "int32[,]" "int32*" "method int32 *(int32)"  "class Template\`1<object>"
2369         do
2370                 ./make_load_indirect_test.sh indirect_load_i4_${I} unverifiable "${OP}" "${TYPE}"
2371                 I=`expr $I + 1`
2372         done
2373 done
2374
2375
2376 #no need to test ldind.u8 as it aliases to ldind.i8
2377 I=1
2378 for TYPE in "int64" "unsigned int64"
2379 do
2380         ./make_load_indirect_test.sh indirect_load_i8_${I} valid "ldind.i8" "${TYPE}"
2381         I=`expr $I + 1`
2382 done
2383
2384 for TYPE in "int8" "bool" "unsigned int8" "int16" "char" "unsigned int16" "int32" "unsigned int32" "native int" "native unsigned int" "object" "string" "float32" "float64" "class Class" "valuetype MyStruct" "int32[]" "int32[,]" "int32*" "method int32 *(int32)"  "class Template\`1<object>"
2385 do
2386         ./make_load_indirect_test.sh indirect_load_i8_${I} unverifiable "ldind.i8" "${TYPE}"
2387         I=`expr $I + 1`
2388 done
2389
2390
2391 I=1
2392 for TYPE in "float32"
2393 do
2394         ./make_load_indirect_test.sh indirect_load_r4_${I} valid "ldind.r4" "${TYPE}"
2395         I=`expr $I + 1`
2396 done
2397
2398 for TYPE in "int8" "bool" "unsigned int8" "int16" "char" "unsigned int16" "int32" "unsigned int32" "int64" "unsigned int64" "float64" "native int" "native unsigned int" "object" "string" "class Class" "valuetype MyStruct"  "int32[]" "int32[,]" "int32*" "method int32 *(int32)"  "class Template\`1<object>"
2399 do
2400         ./make_load_indirect_test.sh indirect_load_r4_${I} unverifiable "ldind.r4" "${TYPE}"
2401         I=`expr $I + 1`
2402 done
2403
2404
2405 I=1
2406 for TYPE in "float64"
2407 do
2408         ./make_load_indirect_test.sh indirect_load_r8_${I} valid "ldind.r8" "${TYPE}"
2409         I=`expr $I + 1`
2410 done
2411
2412 for TYPE in "int8" "bool" "unsigned int8" "int16" "char" "unsigned int16" "int32" "unsigned int32" "int64" "unsigned int64" "float32" "native int" "native unsigned int" "object" "string" "class Class" "valuetype MyStruct"  "int32[]" "int32[,]" "int32*" "method int32 *(int32)"  "class Template\`1<object>"
2413 do
2414         ./make_load_indirect_test.sh indirect_load_r8_${I} unverifiable "ldind.r8" "${TYPE}"
2415         I=`expr $I + 1`
2416 done
2417
2418
2419 I=1
2420 for TYPE in "int32" "unsigned int32" "native int" "native unsigned int" 
2421 do
2422         ./make_load_indirect_test.sh indirect_load_i_${I} valid "ldind.i" "${TYPE}"
2423         I=`expr $I + 1`
2424 done
2425
2426 for TYPE in "int8" "bool" "unsigned int8" "int16" "char" "unsigned int16" "int64" "unsigned int64" "float32" "float64" "object" "string" "class Class" "valuetype MyStruct" "int32[]" "int32[,]" "int32*" "method int32 *(int32)"  "class Template\`1<object>"
2427 do
2428         ./make_load_indirect_test.sh indirect_load_i_${I} unverifiable "ldind.i" "${TYPE}"
2429         I=`expr $I + 1`
2430 done
2431
2432
2433 I=1
2434 for TYPE in "object" "string" "class Class"  "int32[]" "int32[,]" "class Template\`1<object>"
2435 do
2436         ./make_load_indirect_test.sh indirect_load_r_${I} valid "ldind.ref" "${TYPE}"
2437         I=`expr $I + 1`
2438 done
2439
2440 for TYPE in "int8" "bool" "unsigned int8" "int16" "char" "unsigned int16" "int32" "unsigned int32" "int64" "unsigned int64" "native int" "native unsigned int" "float32" "float64" "valuetype MyStruct" "int32*" "method int32 *(int32)"
2441 do
2442         ./make_load_indirect_test.sh indirect_load_r_${I} unverifiable "ldind.ref" "${TYPE}"
2443         I=`expr $I + 1`
2444 done
2445
2446
2447 #valid stores
2448 ./make_store_indirect_test.sh indirect_store_i1_1 valid "stind.i1" "int8\&" "int8"
2449 ./make_store_indirect_test.sh indirect_store_i1_2 valid "stind.i1" "bool\&" "int8"
2450 ./make_store_indirect_test.sh indirect_store_i1_3 valid "stind.i1" "int8\&" "bool"
2451 ./make_store_indirect_test.sh indirect_store_i1_4 valid "stind.i1" "bool\&" "bool"
2452
2453 ./make_store_indirect_test.sh indirect_store_i2_1 valid "stind.i2" "int16\&" "int16"
2454 ./make_store_indirect_test.sh indirect_store_i2_2 valid "stind.i2" "char\&" "int16"
2455 ./make_store_indirect_test.sh indirect_store_i2_3 valid "stind.i2" "int16\&" "char"
2456 ./make_store_indirect_test.sh indirect_store_i2_4 valid "stind.i2" "char\&" "char"
2457
2458 ./make_store_indirect_test.sh indirect_store_i4_1 valid "stind.i4" "int32\&" "int32"
2459 ./make_store_indirect_test.sh indirect_store_i4_2 valid "stind.i4" "native int\&" "int32"
2460 ./make_store_indirect_test.sh indirect_store_i4_3 valid "stind.i4" "int32\&" "native int"
2461 ./make_store_indirect_test.sh indirect_store_i4_4 valid "stind.i4" "native int\&" "native int"
2462
2463
2464 ./make_store_indirect_test.sh indirect_store_i8_1 valid "stind.i8" "int64\&" "int64"
2465
2466 ./make_store_indirect_test.sh indirect_store_r4_1 valid "stind.r4" "float32\&" "float32"
2467
2468 ./make_store_indirect_test.sh indirect_store_r8_1 valid "stind.r8" "float64\&" "float64"
2469
2470 ./make_store_indirect_test.sh indirect_store_i_1 valid "stind.i" "native int\&" "int32"
2471 ./make_store_indirect_test.sh indirect_store_i_2 valid "stind.i" "int32\&" "int32"
2472 ./make_store_indirect_test.sh indirect_store_i_3 valid "stind.i" "native int\&" "native int"
2473 ./make_store_indirect_test.sh indirect_store_i_4 valid "stind.i" "int32\&" "native int"
2474
2475 ./make_store_indirect_test.sh indirect_store_r_1 valid "stind.ref" "object\&" "object"
2476 ./make_store_indirect_test.sh indirect_store_r_2 valid "stind.ref" "object\&" "string"
2477 ./make_store_indirect_test.sh indirect_store_r_3 valid "stind.ref" "string\&" "string"
2478 ./make_store_indirect_test.sh indirect_store_r_4 unverifiable "stind.ref" "valuetype MyStruct\&" "MyStruct"
2479
2480
2481
2482
2483 #stdind tests
2484 #unverifiable due to unmanaged pointers
2485 ./make_store_indirect_test.sh indirect_store_unmanaged_pointer_1 unverifiable "stind.i1" "int8*" "int8"
2486 ./make_store_indirect_test.sh indirect_store_unmanaged_pointer_2 unverifiable "stind.i1" "native int" "int8"
2487
2488 #invalid due to unrelated types on stack
2489 ./make_store_indirect_test.sh indirect_store_bad_type_1 unverifiable "stind.i1" "int8" "int8"
2490 ./make_store_indirect_test.sh indirect_store_bad_type_2 unverifiable "stind.i1" "int8" "int8"
2491
2492 #invalid stind.ref with valuetypes
2493 ./make_store_indirect_test.sh indirect_store_bad_type_r_3 valid "stind.ref" "int32[]\&" "int32[]"
2494
2495 #invalid operands
2496 I=1
2497 for TYPE1 in "int16" "char" "int32" "native int"
2498 do
2499         ./make_store_indirect_test.sh indirect_store_bad_addr_i1_${I} unverifiable "stind.i1" "${TYPE1}\&" "int8"
2500         ./make_store_indirect_test.sh indirect_store_good_val_i1_${I} valid "stind.i1" "int8\&" "${TYPE1}"
2501         I=`expr $I + 1`
2502 done
2503
2504 for TYPE1 in  "int64" "float32" "float64" "object" "string" "class Class" "valuetype MyStruct"  "int32[]" "int32[,]" "int32*" "method int32 *(int32)"  "class Template\`1<object>"
2505 do
2506         ./make_store_indirect_test.sh indirect_store_bad_addr_i1_${I} unverifiable "stind.i1" "${TYPE1}\&" "int8"
2507         ./make_store_indirect_test.sh indirect_store_bad_val_i1_${I} unverifiable "stind.i1" "int8\&" "${TYPE1}"
2508         I=`expr $I + 1`
2509 done
2510
2511
2512 I=1
2513 for TYPE1 in "int8" "bool" "int32" "native int"
2514 do
2515         ./make_store_indirect_test.sh indirect_store_bad_addr_i2_${I} unverifiable "stind.i2" "${TYPE1}\&" "int16"
2516         ./make_store_indirect_test.sh indirect_store_good_val_i2_${I} valid "stind.i2" "int16\&" "${TYPE1}" 
2517         I=`expr $I + 1`
2518 done
2519
2520 for TYPE1 in "int64" "float32" "float64" "object" "string" "class Class" "valuetype MyStruct"  "int32[]" "int32[,]" "int32*" "method int32 *(int32)"  "class Template\`1<object>"
2521 do
2522         ./make_store_indirect_test.sh indirect_store_bad_addr_i2_${I} unverifiable "stind.i2" "${TYPE1}\&" "int16"
2523         ./make_store_indirect_test.sh indirect_store_bad_val_i2_${I} unverifiable "stind.i2" "int16\&" "${TYPE1}" 
2524         I=`expr $I + 1`
2525 done
2526
2527
2528 I=1
2529 for TYPE1 in "int8" "bool" "int16" "char"
2530 do
2531         ./make_store_indirect_test.sh indirect_store_bad_addr_i4_${I} unverifiable "stind.i4" "${TYPE1}\&" "int32"
2532         ./make_store_indirect_test.sh indirect_store_good_val_i4_${I} valid "stind.i4" "int32\&" "${TYPE1}"
2533         I=`expr $I + 1`
2534 done
2535
2536 for TYPE1 in  "int64" "float32" "float64" "object" "string" "class Class" "valuetype MyStruct"  "int32[]" "int32[,]" "int32*" "method int32 *(int32)"  "class Template\`1<object>"
2537 do
2538         ./make_store_indirect_test.sh indirect_store_bad_addr_i4_${I} unverifiable "stind.i4" "${TYPE1}\&" "int32"
2539         ./make_store_indirect_test.sh indirect_store_bad_val_i4_${I} unverifiable "stind.i4" "int32\&" "${TYPE1}"
2540         I=`expr $I + 1`
2541 done
2542
2543
2544 I=1
2545 for TYPE1 in "int8" "bool" "int16" "char" "int32" "float32" "float64" "native int" "object" "string" "class Class" "valuetype MyStruct"  "int32[]" "int32[,]" "int32*" "method int32 *(int32)"  "class Template\`1<object>"
2546 do
2547         ./make_store_indirect_test.sh indirect_store_bad_addr_i8_${I} unverifiable "stind.i8" "${TYPE1}\&" "int64"
2548         ./make_store_indirect_test.sh indirect_store_bad_val_i8_${I} unverifiable "stind.i8" "int64\&" "${TYPE1}"
2549         I=`expr $I + 1`
2550 done
2551
2552
2553 I=1
2554 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>"
2555 do
2556         ./make_store_indirect_test.sh indirect_store_bad_addr_r4_${I} unverifiable "stind.r4" "${TYPE1}\&" "float32"
2557         if [ "$TYPE1" == "float64" ]; then
2558                 ./make_store_indirect_test.sh indirect_store_good_val_r4_${I} valid "stind.r4" "float32\&" "${TYPE1}"
2559         else
2560                 ./make_store_indirect_test.sh indirect_store_bad_val_r4_${I} unverifiable "stind.r4" "float32\&" "${TYPE1}"
2561         fi
2562         I=`expr $I + 1`
2563 done
2564
2565
2566 I=1
2567 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>"
2568 do
2569         ./make_store_indirect_test.sh indirect_store_bad_addr_r8_${I} unverifiable "stind.r8" "${TYPE1}\&" "float64"
2570         if [ "$TYPE1" == "float32" ]; then
2571                 ./make_store_indirect_test.sh indirect_store_good_val_r8_${I} valid "stind.r8" "float64\&" "${TYPE1}";
2572         else
2573                 ./make_store_indirect_test.sh indirect_store_bad_val_r8_${I} unverifiable "stind.r8" "float64\&" "${TYPE1}";
2574         fi
2575         I=`expr $I + 1`
2576 done
2577
2578
2579 I=1
2580 for TYPE1 in "int8" "bool" "int16" "char"
2581 do
2582         ./make_store_indirect_test.sh indirect_store_bad_addr_i_${I} unverifiable "stind.i" "${TYPE1}\&" "native int" 
2583         ./make_store_indirect_test.sh indirect_store_good_val_i_${I} valid "stind.i" "native int\&" "${TYPE1}"
2584         I=`expr $I + 1`
2585 done
2586
2587 for TYPE1 in "int64" "float32" "float64" "object" "string" "class Class" "valuetype MyStruct"  "int32[]" "int32[,]" "int32*" "method int32 *(int32)"  "class Template\`1<object>"
2588 do
2589         ./make_store_indirect_test.sh indirect_store_bad_addr_i_${I} unverifiable "stind.i" "${TYPE1}\&" "native int" 
2590         ./make_store_indirect_test.sh indirect_store_bad_val_i_${I} unverifiable "stind.i" "native int\&" "${TYPE1}"
2591         I=`expr $I + 1`
2592 done
2593
2594
2595 I=1
2596 for TYPE1 in "int8" "bool" "int16" "char" "int32" "int64" "float32" "float64" "native int"
2597 do
2598         ./make_store_indirect_test.sh indirect_store_bad_addr_ref_${I} unverifiable "stind.ref" "${TYPE1}\&" "object"
2599         ./make_store_indirect_test.sh indirect_store_bad_val_ref_${I} unverifiable "stind.ref" "object\&" "${TYPE1}"
2600         I=`expr $I + 1`
2601 done
2602
2603
2604 #underflow
2605 ./make_newobj_test.sh newobj_underflow invalid "newobj instance void class ClassA::.ctor(int32,int32)" "int32" "int32"
2606
2607 #good simple cases
2608 ./make_newobj_test.sh newobj_good_instantiation_1 valid "newobj instance void class ClassA::.ctor(int32)" "int32" "int32"
2609 ./make_newobj_test.sh newobj_good_instantiation_2 valid "newobj instance void class ClassA::.ctor(int32)" "native int" "int32"
2610 ./make_newobj_test.sh newobj_good_instantiation_3 valid "newobj instance void class ClassA::.ctor(native int)" "int32" "native int"
2611 ./make_newobj_test.sh newobj_good_instantiation_4 valid "newobj instance void class ClassA::.ctor(native int)" "int32" "native int"
2612 ./make_newobj_test.sh newobj_good_instantiation_5 valid "ldloc.0\n\tnewobj instance void int32[,]::.ctor(int32, int32)" "int32" "native int"
2613 ./make_newobj_test.sh newobj_good_instantiation_6 valid "newobj instance void class ClassA::.ctor(typedref)" "typedref" "typedref"
2614
2615 #unverifable types
2616 ./make_newobj_test.sh newobj_unverifiable_types_1 unverifiable "newobj instance void class ClassA::.ctor(int32*)" "int32*" "int32*"
2617 ./make_newobj_test.sh newobj_unverifiable_types_2 unverifiable "newobj instance void class ClassA::.ctor(method int32 *(int32))" "method int32 *(int32)" "method int32 *(int32)"
2618
2619
2620
2621 #abstract type
2622 ./make_newobj_test.sh newobj_bad_inst_1 unverifiable "newobj instance void class AbsClass::.ctor()" "int32" "int32"
2623
2624 #bad types
2625 ./make_newobj_test.sh newobj_bad_args_1 unverifiable "newobj instance void class ClassA::.ctor(int32)" "int64" "int32"
2626 ./make_newobj_test.sh newobj_bad_args_2 unverifiable "newobj instance void class ClassA::.ctor(int32)" "object" "int32"
2627 ./make_newobj_test.sh newobj_bad_args_3 unverifiable "newobj instance void class ClassA::.ctor(int32)" "int32\&" "int32"
2628 ./make_newobj_test.sh newobj_bad_args_4 unverifiable "newobj instance void class ClassA::.ctor(int32)" "float32" "int32"
2629
2630 ./make_newobj_test.sh newobj_bad_args_5 unverifiable "newobj instance void class ClassA::.ctor(int64)" "int32" "int64"
2631 ./make_newobj_test.sh newobj_bad_args_6 unverifiable "newobj instance void class ClassA::.ctor(int64)" "object" "int64"
2632 ./make_newobj_test.sh newobj_bad_args_7 unverifiable "newobj instance void class ClassA::.ctor(int64)" "int32\&" "int64"
2633 ./make_newobj_test.sh newobj_bad_args_8 unverifiable "newobj instance void class ClassA::.ctor(int64)" "float32" "int64"
2634
2635 ./make_newobj_test.sh newobj_bad_args_9 unverifiable "newobj instance void class ClassA::.ctor(object)" "int64" "object"
2636 ./make_newobj_test.sh newobj_bad_args_10 unverifiable "newobj instance void class ClassA::.ctor(object)" "int32" "object"
2637 ./make_newobj_test.sh newobj_bad_args_11 unverifiable "newobj instance void class ClassA::.ctor(object)" "int32\&" "object"
2638 ./make_newobj_test.sh newobj_bad_args_12 unverifiable "newobj instance void class ClassA::.ctor(object)" "float32" "object"
2639
2640 ./make_newobj_test.sh newobj_bad_args_13 unverifiable "newobj instance void class ClassA::.ctor(float32)" "int64" "float32"
2641 ./make_newobj_test.sh newobj_bad_args_14 unverifiable "newobj instance void class ClassA::.ctor(float32)" "object" "float32"
2642 ./make_newobj_test.sh newobj_bad_args_15 unverifiable "newobj instance void class ClassA::.ctor(float32)" "int32\&" "float32"
2643 ./make_newobj_test.sh newobj_bad_args_16 unverifiable "newobj instance void class ClassA::.ctor(float32)" "int32" "float32"
2644
2645 ./make_newobj_test.sh newobj_bad_args_17 unverifiable "newobj instance void class ClassA::.ctor(typedref)" "int32" "typedref"
2646 ./make_newobj_test.sh newobj_bad_args_18 unverifiable "newobj instance void class ClassA::.ctor(typedref)" "object" "typedref"
2647 ./make_newobj_test.sh newobj_bad_args_19 unverifiable "newobj instance void class ClassA::.ctor(typedref)" "int32\&" "typedref"
2648 ./make_newobj_test.sh newobj_bad_args_20 unverifiable "newobj instance void class ClassA::.ctor(typedref)" "float32" "typedref"
2649
2650
2651 #calling something that it's not an instance constructor
2652
2653 ./make_newobj_test.sh newobj_method_not_ctor_1 invalid "newobj instance void class ClassA::ctor(int32)" "int32" "int32"
2654 ./make_newobj_test.sh newobj_method_not_ctor_2 invalid "newobj instance void class ClassA::sctor(int32)" "int32" "int32"
2655 ./make_newobj_test.sh newobj_method_not_ctor_1 invalid "pop\n\tnewobj instance void class ClassA::.cctor()" "int32" "int32"
2656
2657
2658 #ldlen tests
2659 ./make_ldlen_test.sh ldlen_int_array valid "ldc.i4.0\n\tnewarr int32"
2660 ./make_ldlen_test.sh ldlen_array_array valid "ldc.i4.0\n\tnewarr string[]"
2661
2662 ./make_ldlen_test.sh ldlen_multi_dyn_array unverifiable "ldc.i4.0\n\tldc.i4.0\n\tnewobj instance void string[,]::.ctor(int32, int32)"
2663
2664 #TODO add tests for arrays that are not zero-based
2665 #./make_ldlen_test.sh ldlen_size_bounded_array unverifiable "call int32[1...5] mkarr()"
2666
2667 ./make_ldlen_test.sh ldlen_empty_stack invalid "nop"
2668
2669 I=1
2670 for OP in "ldc.i4.0" "ldc.r4 0" " newobj instance void object::.ctor()"
2671 do
2672   ./make_ldlen_test.sh ldlen_bad_stuff_on_stack_${I} unverifiable "$OP"
2673   I=`expr $I + 1`
2674 done
2675
2676
2677 #ldelema
2678
2679 #TODO add tests for CMMP (read only prefix)
2680 #TODO add tests for arrays that are not zero-based
2681
2682 ./make_ldelema_test.sh ldelema_int_array valid "newarr int32" "ldc.i4.0" "int32"
2683 ./make_ldelema_test.sh ldelema_null_array valid "pop\n\tldnull" "ldc.i4.0" "int32"
2684
2685 ./make_ldelema_test.sh ldelema_int_array_native_int valid "newarr int32" "ldc.i4.0\n\tconv.i" "int32"
2686 ./make_ldelema_test.sh ldelema_null_array_native_int valid "pop\n\tldnull" "ldc.i4.0\n\tconv.i" "int32"
2687
2688
2689 ./make_ldelema_test.sh ldelema_empty_stack_1 invalid "pop" "nop" "int32"
2690 ./make_ldelema_test.sh ldelema_empty_stack_2 invalid "newarr int32" "nop" "int32"
2691 ./make_ldelema_test.sh ldelema_empty_stack_3 invalid "pop" "ldc.i4.0" "int32"
2692
2693 I=1
2694 for ARR in "int8" "int16" "int32" 
2695 do
2696  ./make_ldelema_test.sh ldelema_size_compat_${I} valid "newarr ${ARR}" "ldc.i4.0" "unsigned ${ARR}"
2697   I=`expr $I + 1`
2698 done
2699
2700 for ARR in "int8" "int16" "int32"
2701 do
2702  ./make_ldelema_test.sh ldelema_size_compat_${I} valid "newarr unsigned ${ARR}" "ldc.i4.0" "${ARR}"
2703   I=`expr $I + 1`
2704 done
2705
2706 ./make_ldelema_test.sh ldelema_size_compat_nat_1 valid "newarr native int" "ldc.i4.0" "native unsigned int"
2707 ./make_ldelema_test.sh ldelema_size_compat_nat_2 valid "newarr native unsigned int" "ldc.i4.0" "native int"
2708
2709
2710 ./make_ldelema_test.sh ldelema_misc_size_compat_1 valid "newarr bool" "ldc.i4.0" "int8"
2711 ./make_ldelema_test.sh ldelema_misc_size_compat_2 valid "newarr char" "ldc.i4.0" "int16"
2712 ./make_ldelema_test.sh ldelema_misc_size_compat_3 valid "newarr native int" "ldc.i4.0" "int32"
2713 ./make_ldelema_test.sh ldelema_misc_size_compat_4 valid "newarr native unsigned int" "ldc.i4.0" "int32"
2714
2715 ./make_ldelema_test.sh ldelema_misc_size_compat_5 valid "newarr int8" "ldc.i4.0" "bool" 
2716 ./make_ldelema_test.sh ldelema_misc_size_compat_6 valid "newarr int16" "ldc.i4.0" "char"
2717 ./make_ldelema_test.sh ldelema_misc_size_compat_7 valid "newarr int32" "ldc.i4.0" "native int"
2718 ./make_ldelema_test.sh ldelema_misc_size_compat_8 valid "newarr int32" "ldc.i4.0" "native unsigned int"
2719
2720 ./make_ldelema_test.sh ldelema_misc_size_compat_9 valid "newarr unsigned int8" "ldc.i4.0" "bool" 
2721 ./make_ldelema_test.sh ldelema_misc_size_compat_10 valid "newarr unsigned int16" "ldc.i4.0" "char"
2722 ./make_ldelema_test.sh ldelema_misc_size_compat_11 valid "newarr unsigned int32" "ldc.i4.0" "native int"
2723 ./make_ldelema_test.sh ldelema_misc_size_compat_12 valid "newarr unsigned int32" "ldc.i4.0" "native unsigned int"
2724
2725
2726 I=1
2727 for ARR in "newobj instance void object::.ctor()" "ldc.i4.0\n\tldc.i4.0\n\tnewobj instance void string[,]::.ctor(int32, int32)" "ldc.r4 0" "ldc.r8 0" "ldc.i8 0" "ldc.i4.0" "ldc.i4.0\n\tconv.i"
2728 do
2729  ./make_ldelema_test.sh ldelema_bad_array_${I} unverifiable "pop\n\t${ARR}" "ldc.i4.0" "int32"
2730   I=`expr $I + 1`
2731 done
2732
2733
2734 I=1
2735 for IDX in "newobj instance void object::.ctor()" "ldc.i8 0" "ldc.r4 0"
2736 do
2737  ./make_ldelema_test.sh ldelema_bad_index_${I} unverifiable "newarr int32" "${IDX}" "int32"
2738   I=`expr $I + 1`
2739 done
2740
2741 I=1
2742 for TOKEN in "object" "int64" "int32[]"
2743 do
2744 ./make_ldelema_test.sh ldelema_type_mismatch_${I} unverifiable "newarr int32" "ldc.i4.0" "${TOKEN}"
2745   I=`expr $I + 1`
2746 done
2747
2748 for TOKEN in "object" "int32"
2749 do
2750 ./make_ldelema_test.sh ldelema_type_mismatch_${I} unverifiable "newarr string" "ldc.i4.0" "${TOKEN}"
2751   I=`expr $I + 1`
2752 done
2753
2754 for TOKEN in "object" "int32" "ClassSubA"
2755 do
2756 ./make_ldelema_test.sh ldelema_type_mismatch_${I} unverifiable "newarr ClassA" "ldc.i4.0" "${TOKEN}"
2757   I=`expr $I + 1`
2758 done
2759
2760
2761 #ldelem.X
2762
2763 #TODO add tests for CMMP (read only prefix)
2764 #TODO add tests for arrays that are not zero-based
2765
2766
2767 I=1
2768 for ARR in "int8" "bool" "unsigned int8" "ByteEnum"
2769 do
2770         ./make_ldelem_test.sh ldelem_base_types_i_${I} valid "newarr ${ARR}" "ldc.i4.0" "ldelem.i1"
2771         ./make_ldelem_test.sh ldelem_base_types_u_${I} valid "newarr ${ARR}" "ldc.i4.0" "ldelem.u1"
2772         I=`expr $I + 1`
2773 done
2774
2775 for ARR in "int16" "char" "unsigned int16" "int32" "unsigned int32" "native int" "native unsigned int" "int64" "unsigned int64" "float32" "float64" "object"
2776 do
2777         ./make_ldelem_test.sh ldelem_base_types_i_${I} unverifiable "newarr ${ARR}" "ldc.i4.0" "ldelem.i1"
2778         ./make_ldelem_test.sh ldelem_base_types_u_${I} unverifiable "newarr ${ARR}" "ldc.i4.0" "ldelem.u1"
2779         I=`expr $I + 1`
2780 done
2781
2782
2783 for ARR in "int16" "char" "unsigned int16" "ShortEnum"
2784 do
2785         ./make_ldelem_test.sh ldelem_base_types_i_${I} valid "newarr ${ARR}" "ldc.i4.0" "ldelem.i2"
2786         ./make_ldelem_test.sh ldelem_base_types_u_${I} valid "newarr ${ARR}" "ldc.i4.0" "ldelem.u2"
2787         I=`expr $I + 1`
2788 done
2789
2790 for ARR in "int8" "bool" "unsigned int8" "int32" "unsigned int32" "native int" "native unsigned int" "int64" "unsigned int64" "float32" "float64" "object"
2791 do
2792         ./make_ldelem_test.sh ldelem_base_types_i_${I} unverifiable "newarr ${ARR}" "ldc.i4.0" "ldelem.i2"
2793         ./make_ldelem_test.sh ldelem_base_types_u_${I} unverifiable "newarr ${ARR}" "ldc.i4.0" "ldelem.u2"
2794         I=`expr $I + 1`
2795 done
2796
2797 for ARR in "int32" "unsigned int32" "IntEnum" 
2798 do
2799         ./make_ldelem_test.sh ldelem_base_types_i_${I} valid "newarr ${ARR}" "ldc.i4.0" "ldelem.i4"
2800         ./make_ldelem_test.sh ldelem_base_types_u_${I} valid "newarr ${ARR}" "ldc.i4.0" "ldelem.u4"
2801         ./make_ldelem_test.sh ldelem_base_types_n_${I} strict "newarr ${ARR}" "ldc.i4.0" "ldelem.i"
2802         I=`expr $I + 1`
2803 done
2804
2805 for ARR in "native int" "native unsigned int" "NativeIntEnum"
2806 do
2807         ./make_ldelem_test.sh ldelem_base_types_i_${I} strict "newarr ${ARR}" "ldc.i4.0" "ldelem.i4"
2808         ./make_ldelem_test.sh ldelem_base_types_u_${I} strict "newarr ${ARR}" "ldc.i4.0" "ldelem.u4"
2809         ./make_ldelem_test.sh ldelem_base_types_n_${I} valid "newarr ${ARR}" "ldc.i4.0" "ldelem.i"
2810         I=`expr $I + 1`
2811 done
2812
2813 for ARR in "int8" "bool" "unsigned int8" "int16" "char" "unsigned int16" "int64" "unsigned int64" "float32" "float64" "object"
2814 do
2815         ./make_ldelem_test.sh ldelem_base_types_i_${I} unverifiable "newarr ${ARR}" "ldc.i4.0" "ldelem.i4"
2816         ./make_ldelem_test.sh ldelem_base_types_u_${I} unverifiable "newarr ${ARR}" "ldc.i4.0" "ldelem.u4"
2817         ./make_ldelem_test.sh ldelem_base_types_n_${I} unverifiable "newarr ${ARR}" "ldc.i4.0" "ldelem.i"
2818         I=`expr $I + 1`
2819 done
2820
2821
2822 for ARR in "int64" "unsigned int64" "LongEnum"
2823 do
2824         ./make_ldelem_test.sh ldelem_base_types_i_${I} valid "newarr ${ARR}" "ldc.i4.0" "ldelem.i8"
2825         ./make_ldelem_test.sh ldelem_base_types_u_${I} valid "newarr ${ARR}" "ldc.i4.0" "ldelem.u8"
2826         I=`expr $I + 1`
2827 done
2828
2829 for ARR in "int8" "bool" "unsigned int8" "int16" "char" "unsigned int16" "int32" "unsigned int32" "native int" "native unsigned int" "float32" "float64" "object"
2830 do
2831         ./make_ldelem_test.sh ldelem_base_types_i_${I} unverifiable "newarr ${ARR}" "ldc.i4.0" "ldelem.i8"
2832         ./make_ldelem_test.sh ldelem_base_types_u_${I} unverifiable "newarr ${ARR}" "ldc.i4.0" "ldelem.u8"
2833         I=`expr $I + 1`
2834 done
2835
2836
2837 for ARR in "float32"
2838 do
2839         ./make_ldelem_test.sh ldelem_base_types_f_${I} valid "newarr ${ARR}" "ldc.i4.0" "ldelem.r4"
2840         I=`expr $I + 1`
2841 done
2842
2843 for ARR in "int8" "bool" "unsigned int8" "int16" "char" "unsigned int16" "int32" "unsigned int32" "native int" "native unsigned int" "int64" "unsigned int64" "float64" "object"
2844 do
2845         ./make_ldelem_test.sh ldelem_base_types_f_${I} unverifiable "newarr ${ARR}" "ldc.i4.0" "ldelem.r4"
2846         I=`expr $I + 1`
2847 done
2848
2849
2850 for ARR in "float64"
2851 do
2852         ./make_ldelem_test.sh ldelem_base_types_f_${I} valid "newarr ${ARR}" "ldc.i4.0" "ldelem.r8"
2853         I=`expr $I + 1`
2854 done
2855
2856 for ARR in "int8" "bool" "unsigned int8" "int16" "char" "unsigned int16" "int32" "unsigned int32" "native int" "native unsigned int" "int64" "unsigned int64" "float32" "object"
2857 do
2858         ./make_ldelem_test.sh ldelem_base_types_f_${I} unverifiable "newarr ${ARR}" "ldc.i4.0" "ldelem.r8"
2859         I=`expr $I + 1`
2860 done
2861
2862
2863 for ARR in "object" "string" "ClassA"
2864 do
2865         ./make_ldelem_test.sh ldelem_base_types_o_${I} valid "newarr ${ARR}" "ldc.i4.0" "ldelem.ref"
2866         I=`expr $I + 1`
2867 done
2868
2869 for ARR in "valuetype MyStruct" "int8" "bool" "unsigned int8" "int16" "char" "unsigned int16" "int32" "unsigned int32" "native int" "native unsigned int" "int64" "unsigned int64" "float32" "float64" 
2870 do
2871         ./make_ldelem_test.sh ldelem_base_types_o_${I} unverifiable "newarr ${ARR}" "ldc.i4.0" "ldelem.ref"
2872         I=`expr $I + 1`
2873 done
2874
2875 I=1
2876 for OP in i1 u1 i2 u2 i4 u4 i8 u8 r4 r8 i ref
2877 do
2878         ./make_ldelem_test.sh ldelem_null_array_${I} valid "pop\n\tldnull" "ldc.i4.0" "ldelem.${OP}"
2879         I=`expr $I + 1`
2880 done
2881
2882
2883 I=1
2884 for OP in i1 u1 i2 u2 i4 u4 i8 u8 r4 r8 i ref
2885 do
2886         ./make_ldelem_test.sh ldelem_empty_stack_1_${I} invalid "pop" "nop" "ldelem.${OP}"
2887         ./make_ldelem_test.sh ldelem_empty_stack_2_${I} invalid "newarr int32" "nop" "ldelem.${OP}"
2888         ./make_ldelem_test.sh ldelem_empty_stack_3_${I} invalid "pop" "ldc.i4.0" "ldelem.${OP}"
2889         I=`expr $I + 1`
2890 done
2891
2892 I=1
2893 for OP in i1 u1 i2 u2 i4 u4 i8 u8 r4 r8 i ref
2894 do
2895         for ARR in "newobj instance void object::.ctor()" "ldc.i4.0\n\tldc.i4.0\n\tnewobj instance void string[,]::.ctor(int32, int32)" "ldc.r4 0" "ldc.r8 0" "ldc.i8 0" "ldc.i4.0" "ldc.i4.0\n\tconv.i"
2896         do
2897          ./make_ldelem_test.sh ldelema_bad_array_${I} unverifiable "pop\n\t${ARR}" "ldc.i4.0" "ldelem.${OP}"
2898           I=`expr $I + 1`
2899         done
2900 done
2901
2902
2903 I=1
2904 for OP in i1 u1 i2 u2 i4 u4 i8 u8 r4 r8 i ref
2905 do
2906         for IDX in "newobj instance void object::.ctor()" "ldc.i8 0" "ldc.r4 0"
2907         do
2908          ./make_ldelem_test.sh ldelema_bad_index_${I} unverifiable "pop\n\tldnull" "${IDX}" "ldelem.${OP}"
2909           I=`expr $I + 1`
2910         done
2911 done
2912
2913
2914 #adicional tests for ldelem
2915 I=1
2916 for ARR in "int8" "bool" "unsigned int8" "int16" "char" "unsigned int16" "int32" "unsigned int32" "native int" "native unsigned int" "int64" "unsigned int64" "float32" "float64" "object"
2917 do
2918         ./make_ldelem_test.sh ldelem_token_base_types_i_${I} valid "newarr ${ARR}" "ldc.i4.0" "ldelem ${ARR}"
2919         I=`expr $I + 1`
2920 done
2921
2922
2923 #stdelem.X
2924 #TODO add tests for arrays that are not zero-based
2925
2926 I=1
2927 for ARR in "int8" "bool" "unsigned int8"
2928 do
2929         ./make_stelem_test.sh stelem_base_types_${I} valid "newarr ${ARR}" "ldc.i4.0" "ldc.i4.0" "stelem.i1"
2930         I=`expr $I + 1`
2931 done
2932
2933 for ARR in "int16" "char" "unsigned int16" "int32" "unsigned int32" "native int" "native unsigned int" "int64" "unsigned int64" "float32" "float64" "object"
2934 do
2935         ./make_stelem_test.sh stelem_base_types_${I} unverifiable "newarr ${ARR}" "ldc.i4.0" "ldc.i4.0" "stelem.i1"
2936         I=`expr $I + 1`
2937 done
2938
2939
2940 for ARR in "int16" "char" "unsigned int16"
2941 do
2942         ./make_stelem_test.sh stelem_base_types_${I} valid "newarr ${ARR}" "ldc.i4.0" "ldc.i4.0" "stelem.i2"
2943         I=`expr $I + 1`
2944 done
2945
2946 for ARR in "int8" "bool" "unsigned int8" "int32" "unsigned int32" "native int" "native unsigned int" "int64" "unsigned int64" "float32" "float64" "object"
2947 do
2948         ./make_stelem_test.sh stelem_base_types_${I} unverifiable "newarr ${ARR}" "ldc.i4.0" "ldc.i4.0" "stelem.i2"
2949         I=`expr $I + 1`
2950 done
2951
2952
2953 for ARR in "int32" "unsigned int32" "native int" "native unsigned int"
2954 do
2955         ./make_stelem_test.sh stelem_base_types_i_${I} valid "newarr ${ARR}" "ldc.i4.0" "ldc.i4.0\n\tconv.i" "stelem.i4"
2956         ./make_stelem_test.sh stelem_base_types_i4_${I} valid "newarr ${ARR}" "ldc.i4.0" "ldc.i4.0" "stelem.i4"
2957         I=`expr $I + 1`
2958 done
2959
2960 for ARR in "int8" "bool" "unsigned int8" "int16" "char" "unsigned int16" "int64" "unsigned int64" "float32" "float64" "object"
2961 do
2962         ./make_stelem_test.sh stelem_base_types_i_${I} unverifiable "newarr ${ARR}" "ldc.i4.0" "ldc.i4.0\n\tconv.i" "stelem.i4"
2963         ./make_stelem_test.sh stelem_base_types_i4_${I} unverifiable "newarr ${ARR}" "ldc.i4.0" "ldc.i4.0" "stelem.i4"
2964         I=`expr $I + 1`
2965 done
2966
2967
2968 for ARR in "int64" "unsigned int64"
2969 do
2970         ./make_stelem_test.sh stelem_base_types_${I} valid "newarr ${ARR}" "ldc.i4.0" "ldc.i8 0" "stelem.i8"
2971         I=`expr $I + 1`
2972 done
2973
2974 for ARR in "int8" "bool" "unsigned int8" "int16" "char" "unsigned int16" "int32" "unsigned int32" "native int" "native unsigned int" "float32" "float64" "object"
2975 do
2976         ./make_stelem_test.sh stelem_base_types_${I} unverifiable "newarr ${ARR}" "ldc.i4.0" "ldc.i8 0" "stelem.i8"
2977         I=`expr $I + 1`
2978 done
2979
2980
2981 for ARR in "float32"
2982 do
2983         ./make_stelem_test.sh stelem_base_types_${I} valid "newarr ${ARR}" "ldc.i4.0" "ldc.r4 0" "stelem.r4"
2984         I=`expr $I + 1`
2985 done
2986
2987 for ARR in "int8" "bool" "unsigned int8" "int16" "char" "unsigned int16" "int32" "unsigned int32" "native int" "native unsigned int" "int64" "unsigned int64" "float64" "object"
2988 do
2989         ./make_stelem_test.sh stelem_base_types_${I} unverifiable "newarr ${ARR}" "ldc.i4.0" "ldc.r4 0" "stelem.r4"
2990         I=`expr $I + 1`
2991 done
2992
2993
2994 for ARR in "float64"
2995 do
2996         ./make_stelem_test.sh stelem_base_types_${I} valid "newarr ${ARR}" "ldc.i4.0" "ldc.r8 0" "stelem.r8"
2997         I=`expr $I + 1`
2998 done
2999
3000 for ARR in "int8" "bool" "unsigned int8" "int16" "char" "unsigned int16" "int32" "unsigned int32" "native int" "native unsigned int" "int64" "unsigned int64" "float32" "object"
3001 do
3002         ./make_stelem_test.sh stelem_base_types_${I} unverifiable "newarr ${ARR}" "ldc.i4.0" "ldc.r8 0" "stelem.r8"
3003         I=`expr $I + 1`
3004 done
3005
3006
3007 for ARR in "int32" "unsigned int32" "native int" "native unsigned int"
3008 do
3009         ./make_stelem_test.sh stelem_base_types_i_${I} valid "newarr ${ARR}" "ldc.i4.0" "ldc.i4.0\n\tconv.i" "stelem.i"
3010         ./make_stelem_test.sh stelem_base_types_i4_${I} valid "newarr ${ARR}" "ldc.i4.0" "ldc.i4.0" "stelem.i"
3011         I=`expr $I + 1`
3012 done
3013
3014 for ARR in "int8" "bool" "unsigned int8" "int16" "char" "unsigned int16"  "int64" "unsigned int64" "float32" "float64" "object"
3015 do
3016         ./make_stelem_test.sh stelem_base_types_i_${I} unverifiable "newarr ${ARR}" "ldc.i4.0" "ldc.i4.0\n\tconv.i" "stelem.i"
3017         ./make_stelem_test.sh stelem_base_types_i4_${I} unverifiable "newarr ${ARR}" "ldc.i4.0" "ldc.i4.0" "stelem.i"
3018         I=`expr $I + 1`
3019 done
3020
3021
3022 for ARR in object ClassA ClassSubA
3023 do
3024         ./make_stelem_test.sh stelem_base_types_${I} valid "newarr ${ARR}" "ldc.i4.0" "newobj instance void ${ARR}::.ctor()" "stelem.ref"
3025         I=`expr $I + 1`
3026 done
3027
3028 for ARR in "int8" "bool" "unsigned int8" "int16" "char" "unsigned int16" "int32" "unsigned int32" "native int" "native unsigned int" "int64" "unsigned int64" "float32" "float64"
3029 do
3030         ./make_stelem_test.sh stelem_base_types_${I} unverifiable "newarr ${ARR}" "ldc.i4.0" "ldc.i4.0" "stelem.ref"
3031         I=`expr $I + 1`
3032 done
3033
3034
3035
3036 ./make_stelem_test.sh stelem_native_int_index valid "newarr int32" "ldc.i4.0\n\tconv.i" "ldc.i4.0" "stelem.i4"
3037
3038
3039 #tests with null arrays and values (for ref types)
3040
3041 I=1
3042 for OP in i1 i2 i4 i
3043 do
3044         ./make_stelem_test.sh stelem_null_array_index_i_${I} valid "pop\n\tldnull" "ldc.i4.0" "ldc.i4.0" "stelem.${OP}"
3045         I=`expr $I + 1`
3046 done
3047
3048 ./make_stelem_test.sh stelem_null_array_index_i8 valid "pop\n\tldnull" "ldc.i4.0" "ldc.i8 0" "stelem.i8"
3049 ./make_stelem_test.sh stelem_null_array_index_r4 valid "pop\n\tldnull" "ldc.i4.0" "ldc.r4 0" "stelem.r4"
3050 ./make_stelem_test.sh stelem_null_array_index_r8 valid "pop\n\tldnull" "ldc.i4.0" "ldc.r8 0" "stelem.r4"
3051 ./make_stelem_test.sh stelem_null_array_index_ref valid "pop\n\tldnull" "ldc.i4.0" "newobj instance void object::.ctor()" "stelem.ref"
3052
3053 ./make_stelem_test.sh stelem_null_value_1 valid "newarr object" "ldc.i4.0" "ldnull" "stelem.ref"
3054 ./make_stelem_test.sh stelem_null_value_2 valid "newarr string" "ldc.i4.0" "ldnull" "stelem.ref"
3055
3056 #both need to be reference types
3057 ./make_stelem_test.sh stelem_variance_1 valid "newarr object" "ldc.i4.0" "newobj instance void ClassA::.ctor()" "stelem.ref"
3058 ./make_stelem_test.sh stelem_variance_2 valid "newarr object" "ldc.i4.0" "newobj instance void ClassSubA::.ctor()" "stelem.ref"
3059 ./make_stelem_test.sh stelem_variance_3 valid "newarr ClassA" "ldc.i4.0" "newobj instance void ClassSubA::.ctor()" "stelem.ref"
3060 ./make_stelem_test.sh stelem_variance_4 valid "newarr ClassSubA" "ldc.i4.0" "newobj instance void ClassA::.ctor()" "stelem.ref"
3061 ./make_stelem_test.sh stelem_variance_5 valid "newarr ClassSubA" "ldc.i4.0" "newobj instance void object::.ctor()" "stelem.ref"
3062 ./make_stelem_test.sh stelem_variance_6 valid "newarr string" "ldc.i4.0" "newobj instance void object::.ctor()" "stelem.ref"
3063
3064 ./make_stelem_test.sh stelem_value_type_1 unverifiable "newarr object" "ldc.i4.0" "ldloc.0" "stelem.ref"
3065 ./make_stelem_test.sh stelem_value_type_2 unverifiable "newarr object" "ldc.i4.0" "ldloca.s 0" "stelem.ref"
3066 ./make_stelem_test.sh stelem_value_type_3 unverifiable "newarr MyStruct" "ldc.i4.0" "newobj instance void object::.ctor()" "stelem.ref"
3067 ./make_stelem_test.sh stelem_value_type_4 unverifiable "newarr MyStruct" "ldc.i4.0" "ldloc.0" "stelem.ref"
3068 ./make_stelem_test.sh stelem_value_type_5 unverifiable "newarr MyStruct" "ldc.i4.0" "ldloca.s 0" "stelem.ref"
3069
3070
3071 #bad index values
3072 I=1
3073 for IDX in "ldc.i8 0" "ldc.r4 0" "ldc.r8 0" "newobj instance void ClassA::.ctor()"
3074 do
3075         ./make_stelem_test.sh stelem_bad_index_${I} unverifiable "newarr int32" "${IDX}" "ldc.i4.0" "stelem.i4"
3076         I=`expr $I + 1`
3077 done
3078
3079 #bad array values
3080 I=1
3081 for ARR in "ldc.i4.0" "ldc.i8 0" "ldc.r4 0" "ldc.r8 0" "newobj instance void ClassA::.ctor()"
3082 do
3083         ./make_stelem_test.sh stelem_bad_index_${I} unverifiable "pop\n\t${ARR}" "ldc.i4.0" "ldc.i4.0" "stelem.i4"
3084         I=`expr $I + 1`
3085 done
3086
3087
3088 #empty stack
3089 ./make_stelem_test.sh stelem_empty_stack_1 invalid "newarr object" "ldc.i4.0" "pop" "stelem.ref"
3090 ./make_stelem_test.sh stelem_empty_stack_2 invalid "newarr object" "nop" "ldnull" "stelem.ref"
3091 ./make_stelem_test.sh stelem_empty_stack_3 invalid "newarr object" "nop" "nop" "stelem.ref"
3092 ./make_stelem_test.sh stelem_empty_stack_4 invalid "pop" "nop" "nop" "stelem.ref"
3093
3094
3095 #test with multi-dim array
3096 ./make_stelem_test.sh stelem_multi_dim_array unverifiable "ldc.i4.0\n\tnewobj instance void string[,]::.ctor(int32, int32)" "ldc.i4.0" "ldc.i4.0" "stelem.i4"
3097
3098
3099
3100
3101 #adicional tests for stelem
3102 I=1
3103 for ARR in "int8" "bool" "unsigned int8" "int16" "char" "unsigned int16" "int32" "unsigned int32" "native int" "native unsigned int"
3104 do
3105         ./make_stelem_test.sh stelem_token_basic_types_${I} valid "newarr ${ARR}" "ldc.i4.0" "ldc.i4.0" "stelem ${ARR}"
3106         I=`expr $I + 1`
3107 done
3108
3109 ./make_stelem_test.sh stelem_token_basic_types_i8 valid "newarr int64" "ldc.i4.0" "ldc.i8 0" "stelem int64"
3110 ./make_stelem_test.sh stelem_token_basic_types_r4 valid "newarr float32" "ldc.i4.0" "ldc.r4 0" "stelem float32"
3111 ./make_stelem_test.sh stelem_token_basic_types_r8 valid "newarr float64" "ldc.i4.0" "ldc.r8 0" "stelem float64"
3112
3113 I=1
3114 for TYPE in "object" "ClassA" "ClassSubA"
3115 do
3116         ./make_stelem_test.sh stelem_token_simple_ref_${I} valid "newarr object" "ldc.i4.0" "newobj instance void ${TYPE}::.ctor()" "stelem object"
3117         I=`expr $I + 1`
3118 done
3119
3120 #the array elem type must be a super type of the stelem token
3121 ./make_stelem_test.sh stelem_token_ref_1 valid "newarr object" "ldc.i4.0" "newobj instance void ClassA::.ctor()" "stelem ClassA"
3122 ./make_stelem_test.sh stelem_token_ref_2 valid "newarr ClassA" "ldc.i4.0" "newobj instance void ClassA::.ctor()" "stelem ClassA"
3123 ./make_stelem_test.sh stelem_token_ref_3 unverifiable "newarr ClassSubA" "ldc.i4.0" "newobj instance void ClassA::.ctor()" "stelem ClassA"
3124
3125 #the value type must be assignment compatible with token
3126 ./make_stelem_test.sh stelem_token_ref_4 valid "newarr object" "ldc.i4.0" "newobj instance void ClassA::.ctor()" "stelem ClassA"
3127 ./make_stelem_test.sh stelem_token_ref_5 valid "newarr object" "ldc.i4.0" "newobj instance void ClassSubA::.ctor()" "stelem ClassA"
3128 ./make_stelem_test.sh stelem_token_ref_6 unverifiable "newarr object" "ldc.i4.0" "newobj instance void object::.ctor()" "stelem ClassA"
3129
3130
3131
3132 #cast class and isins tests
3133
3134 #empty stack
3135 ./make_cast_test.sh cast_empty_stack invalid "int32" "nop" "castclass object"
3136 ./make_cast_test.sh isinst_empty_stack invalid "int32"  "nop" "isinst object"
3137
3138 #type
3139 I=1
3140 for OBJ in int32 int64 float32 float64 "int32\&" "valuetype MyStruct" "int32*" "typedref" "method int32 *(int32)"
3141 do
3142         ./make_cast_test.sh cast_object_${I} unverifiable "$OBJ" "ldloc.0" "castclass object"
3143         ./make_cast_test.sh isinst_object_${I} unverifiable "$OBJ" "ldloc.0" "isinst object"
3144         I=`expr $I + 1`
3145 done
3146
3147 for OBJ in "int32[]" "string"
3148 do
3149         ./make_cast_test.sh cast_object_${I} valid "$OBJ" "ldloc.0" "castclass object"
3150         ./make_cast_test.sh isinst_object_${I} valid "$OBJ" "ldloc.0" "isinst object"
3151         I=`expr $I + 1`
3152 done
3153 #token
3154
3155 I=1
3156 for TOKEN in int32 int64 float32 float64 "valuetype MyStruct" "int32*" "typedref" "int32[]" "string" "method int32 *(int32)"
3157 do
3158         ./make_cast_test.sh cast_token_${I} valid "object" "ldloc.0" "castclass $TOKEN"
3159         ./make_cast_test.sh isinst_token_${I} valid "object" "ldloc.0" "isinst $TOKEN"
3160         I=`expr $I + 1`
3161 done
3162
3163 for TOKEN in "int32\&"
3164 do
3165         ./make_cast_test.sh cast_token_${I} invalid "object" "ldloc.0" "castclass $TOKEN"
3166         ./make_cast_test.sh isinst_token_${I} invalid "object" "ldloc.0" "isinst $TOKEN"
3167         I=`expr $I + 1`
3168 done
3169
3170 #object
3171
3172 I=1
3173 for LOAD in "ldloc.0" "ldnull" 
3174 do
3175         ./make_cast_test.sh cast_good_obj_${I} valid "object" "$LOAD" "castclass object"
3176         ./make_cast_test.sh isinst_good_obj_${I} valid "object" "$LOAD" "isinst object"
3177         I=`expr $I + 1`
3178 done
3179
3180
3181
3182 #throw tests
3183
3184 #empty stack
3185 ./make_throw_test.sh throw_empty_stack invalid int32 pop
3186
3187 #null literal
3188 ./make_throw_test.sh throw_null_literal valid int32 "pop\n\tldnull"
3189
3190 #valid types
3191 I=1
3192 for TYPE in object string "[mscorlib]System.Exception" "int32[]" "ClassA" "class [mscorlib]System.IComparable\`1<int32>" "int32[,]"
3193 do
3194         ./make_throw_test.sh throw_ref_type_${I} valid "${TYPE}"
3195         I=`expr $I + 1`
3196 done
3197
3198 #invalid types
3199 I=1
3200 for TYPE in "valuetype MyStruct" int32 int64 float32 float64 "native int" "int32*" "typedref" "object\&"
3201 do
3202         ./make_throw_test.sh throw_value_type_${I} unverifiable "${TYPE}"
3203         I=`expr $I + 1`
3204 done
3205
3206
3207 # Exception block branch tests (see 2.19)
3208
3209 for I in {1..2};
3210 do
3211         ./make_rethrow_test.sh rethrow_from_catch_${I} invalid ${I}
3212 done
3213
3214 for I in {3..10};
3215 do
3216         ./make_rethrow_test.sh rethrow_from_catch_${I} valid ${I}
3217 done
3218
3219
3220
3221 # endfinally / endfault
3222
3223 for I in {1..7};
3224 do
3225         ./make_endfinally_test.sh endfinally_block_${I} invalid finally ${I}
3226         ./make_endfinally_test.sh endfault_block_${I} invalid fault ${I}
3227 done
3228
3229 for I in {8..9};
3230 do
3231         ./make_endfinally_test.sh endfinally_block_${I} valid finally ${I}
3232         ./make_endfinally_test.sh endfault_block_${I} valid fault ${I}
3233 done
3234
3235 #stack can have stuff and endfinally or endfault will just empty it
3236
3237 ./make_endfinally_test.sh endfinally_clean_stack valid finally 8 "ldc.i4.0"
3238 ./make_endfinally_test.sh endfault_clean_stack valid fault 8 "ldc.i4.0"
3239
3240
3241
3242 # endfilter
3243
3244 #valid endfilter
3245 ./make_endfilter_test.sh endfilter_at_end_of_filter_block valid 9
3246
3247 #endfilter outside protected block
3248 ./make_endfilter_test.sh endfilter_outside_protected_block invalid 1 "ldc.i4.1\n\t\tendfilter"
3249
3250 #endfilter inside bad protected block
3251 ./make_endfilter_test.sh endfilter_inside_protected_block_3 invalid 3 "ldc.i4.1\n\t\tendfilter"
3252 ./make_endfilter_test.sh endfilter_inside_protected_block_5 strict 5 "ldc.i4.1\n\t\tendfilter"
3253
3254 for I in {2,4,6};
3255 do
3256         ./make_endfilter_test.sh endfilter_inside_protected_block_${I} unverifiable ${I} "ldc.i4.1\n\t\tendfilter"
3257 done
3258
3259
3260 #endfilter is the first instruction
3261 ./make_endfilter_test.sh endfilter_first_instruction_of_filter_block invalid 7 "ldc.i4.1\n\tendfilter"
3262 ./make_endfilter_test.sh endfilter_in_the_midle_instruction_of_filter_block invalid 8 "ldc.i4.1\n\t\tendfilter"
3263
3264 #stack sizes
3265
3266 ./make_endfilter_test.sh endfilter_empty_stack strict 9 "pop"
3267 ./make_endfilter_test.sh endfilter_too_big strict 9 "ldc.i4.0"
3268
3269
3270 I=1
3271 for OP in "ldc.i8 0" "ldnull" "ldc.r4 0" "ldc.r8 1" "ldc.i4.0\n\t\tconv.i" "ldc.r8 99999"
3272 do
3273         ./make_endfilter_test.sh endfilter_bad_arg_${I} strict 9 "pop\t\n\n${OP}"
3274         I=`expr $I + 1`
3275 done
3276
3277
3278 # leave
3279
3280 #leave in all positions
3281
3282 EXTRA="ldloc.0\n\tbrfalse END"
3283
3284 #it's "OK" to use leave as a br
3285 ./make_leave_test.sh "filter_block_test_1" valid "1" "leave END" "$EXTRA"
3286
3287 #but not ok to leave finally or filter
3288 for I in {2..3};
3289 do
3290         ./make_leave_test.sh "filter_block_test_${I}" unverifiable "${I}" "leave END" "${EXTRA}_${I}"
3291 done
3292
3293 #neither is to branch to invalid regions of code
3294 ./make_leave_test.sh "filter_branch_before_start" invalid "1" "leave -400" "$EXTRA"
3295 ./make_leave_test.sh "filter_branch_after_end" invalid "1" "leave 400" "$EXTRA"
3296
3297
3298 # br.X
3299 #valid tests
3300 for I in {1..6}; do
3301         ./make_branch_test.sh branch_inside_same_block_${I} valid ${I} "br BLOCK_${I}";
3302         ./make_branch_test.sh branch_inside_same_block_${I}_s valid ${I} "br.s BLOCK_${I}";
3303 done
3304
3305 #branching outside of the protected block
3306 for I in {2..6}; do
3307         ./make_branch_test.sh branch_outside_protected_block_${I} unverifiable ${I} "br END";
3308 done
3309
3310 #branching to a protected block from the outside
3311 for I in {2..6}; do
3312         if [ "$I" == "4" ]; then
3313                 ./make_branch_test.sh branch_inside_protected_block_from_outside_${I}_finally invalid 1 "br BLOCK_${I}" "finally";
3314                 ./make_branch_test.sh branch_inside_protected_block_from_outside_${I}_fault invalid 1 "br BLOCK_${I}" "fault";
3315         else
3316                 ./make_branch_test.sh branch_inside_protected_block_from_outside_${I} unverifiable 1 "br BLOCK_${I}";
3317         fi
3318 done
3319
3320
3321 #branching out of range
3322 ./make_branch_test.sh branch_out_of_bounds_before_start invalid 1 "br -1000";
3323 ./make_branch_test.sh branch_out_of_bounds_after_end invalid 1 "br 1000";
3324
3325 #branching in the middle of an instruction
3326 ./make_branch_test.sh branch_middle_of_instruction invalid 1 "br 2";
3327
3328 #branching in between prefix and instruction 
3329 ./make_branch_test.sh branch_middle_of_instruction_prefix_1 invalid 1 "br AFTER_FIRST_PREFIX";
3330 ./make_branch_test.sh branch_middle_of_instruction_prefix_2 invalid 1 "br AFTER_SECOND_PREFIX";
3331
3332 #TODO test the encoding of the switch table
3333 # switch
3334 #valid tests
3335 for I in {1..6}; do
3336         ./make_switch_test.sh switch_inside_same_block_${I} valid ${I} "ldloc.0" "switch (BLOCK_${I}, BLOCK_${I}_B)";
3337 done
3338
3339 ./make_switch_test.sh switch_with_native_int_on_stack valid 1 "ldloc.1" "switch (BLOCK_1, BLOCK_1_B)";
3340
3341 #branching outside of the protected block
3342 for I in {2..6}; do
3343         ./make_switch_test.sh switch_outside_protected_block_${I} unverifiable ${I} "ldloc.0" "switch (END, BLOCK_1, BLOCK_1_B)";
3344 done
3345
3346 #branching to a protected block from the outside
3347 for I in {2..6}; do
3348         if [ "$I" == "4" ]; then
3349                 ./make_switch_test.sh switch_inside_protected_block_from_outside_${I}_finally invalid 1 "ldloc.0" "switch (BLOCK_${I}, BLOCK_${I}_B)" "finally";
3350                 ./make_switch_test.sh switch_inside_protected_block_from_outside_${I}_fault invalid 1 "ldloc.0" "switch (BLOCK_${I}, BLOCK_${I}_B)" "fault";
3351         else
3352                 ./make_switch_test.sh switch_inside_protected_block_from_outside_${I} unverifiable 1 "ldloc.0" "switch (BLOCK_${I}, BLOCK_${I}_B)";
3353         fi
3354 done
3355
3356 #TODO branching out of range (FIX ilasm first)
3357 #./make_switch_test.sh switch_out_of_bounds_before_start invalid 1 "ldloc.0" "switch (-1000, -2000)"
3358 #./make_switch_test.sh switch_out_of_bounds_after_end invalid 1 "ldloc.0" "switch (BLOCK_1, 1000, 1500)"
3359
3360 #empty stack
3361 ./make_switch_test.sh switch_empty_stack invalid 1 "nop" "switch (BLOCK_1, BLOCK_1_B)"
3362
3363 #wrong type on stack
3364 I=1
3365 for TYPE in "ldnull" "ldc.i8 0" "ldc.r4 0" "ldc.r8 0"
3366 do
3367         ./make_switch_test.sh switch_bad_type_on_stack_${I} unverifiable 1 "$TYPE" "switch (BLOCK_1, BLOCK_1_B)"
3368         I=`expr $I + 1`
3369 done
3370
3371 #switch landing in the middle of instructions
3372 #FIXME (ilasm don't work with offsets on switch statements)
3373 #./make_switch_test.sh switch_target_middle_of_instruction invalid 1 "ldloc.1" "switch (BLOCK_1, BLOCK_1)";
3374
3375 ./make_switch_test.sh switch_target_between_prefix_1 invalid 1 "ldloc.1" "switch (AFTER_FIRST_PREFIX, BLOCK_1)";
3376 ./make_switch_test.sh switch_target_between_prefix_2 invalid 1 "ldloc.1" "switch (AFTER_SECOND_PREFIX, BLOCK_1)";
3377 ./make_switch_test.sh switch_target_bad_merge_point invalid 1 "ldloc.1" "switch (INVALID_MERGE_POINT, BLOCK_1)";
3378
3379
3380 #TESTS for exception clauses. As described in P1 12.4.2.7.
3381 #regions must not overlap with each other
3382 ./make_exception_overlap_test.sh exception_entry_overlap_separate_1 valid ".try TRY_BLOCK_1 to TRY_BLOCK_1_END catch [mscorlib]System.Exception handler CATCH_BLOCK_1 to CATCH_BLOCK_1_END" ".try TRY_BLOCK_2 to TRY_BLOCK_2_END catch [mscorlib]System.Exception handler CATCH_BLOCK_2 to CATCH_BLOCK_2_END"
3383
3384 ./make_exception_overlap_test.sh exception_entry_overlap_separate_2 valid ".try TRY_BLOCK_2 to TRY_BLOCK_2_END catch [mscorlib]System.Exception handler CATCH_BLOCK_2 to CATCH_BLOCK_2_END" ".try TRY_BLOCK_1 to TRY_BLOCK_1_END catch [mscorlib]System.Exception handler CATCH_BLOCK_1 to CATCH_BLOCK_1_END" 
3385
3386 ./make_exception_overlap_test.sh exception_entry_overlap_try_over_catch invalid ".try TRY_BLOCK_1 to CATCH_BLOCK_1_A catch [mscorlib]System.Exception handler CATCH_BLOCK_1 to CATCH_BLOCK_1_END" ".try TRY_BLOCK_2 to TRY_BLOCK_2_END catch [mscorlib]System.Exception handler CATCH_BLOCK_2 to CATCH_BLOCK_2_END"
3387
3388 ./make_exception_overlap_test.sh exception_entry_overlap_try_over_filter invalid ".try TRY_BLOCK_1 to FILTER_BLOCK_3_A filter FILTER_BLOCK_3 handler CATCH_BLOCK_1 to CATCH_BLOCK_1_END" ".try TRY_BLOCK_2 to TRY_BLOCK_2_END catch [mscorlib]System.Exception handler CATCH_BLOCK_2 to CATCH_BLOCK_2_END" "yes"
3389
3390 #blocks start in the middle of an intruction
3391 ./make_exception_overlap_test.sh try_block_start_in_the_middle_of_a_instruction invalid ".try AFTER_PREFIX_1 to TRY_BLOCK_1_END catch [mscorlib]System.Exception handler CATCH_BLOCK_1 to CATCH_BLOCK_1_END" ".try TRY_BLOCK_2 to TRY_BLOCK_2_END catch [mscorlib]System.Exception handler CATCH_BLOCK_2 to CATCH_BLOCK_2_END"
3392
3393 ./make_exception_overlap_test.sh catch_block_start_in_the_middle_of_a_instruction invalid ".try TRY_BLOCK_1 to TRY_BLOCK_1_END catch [mscorlib]System.Exception handler AFTER_PREFIX_2 to CATCH_BLOCK_1_END" ".try TRY_BLOCK_2 to TRY_BLOCK_2_END catch [mscorlib]System.Exception handler CATCH_BLOCK_2 to CATCH_BLOCK_2_END"
3394
3395 ./make_exception_overlap_test.sh filter_block_start_in_the_middle_of_a_instructior invalid ".try TRY_BLOCK_1 to TRY_BLOCK_1_END filter AFTER_PREFIX_4 handler CATCH_BLOCK_1 to CATCH_BLOCK_1_END" ".try TRY_BLOCK_2 to TRY_BLOCK_2_END catch [mscorlib]System.Exception handler CATCH_BLOCK_2 to CATCH_BLOCK_2_END" "yes"
3396
3397
3398 #block end in the middle of an instruction
3399 ./make_exception_overlap_test.sh try_block_end_in_the_middle_of_a_instruction invalid ".try TRY_BLOCK_1 to AFTER_PREFIX_4 catch [mscorlib]System.Exception handler CATCH_BLOCK_1 to CATCH_BLOCK_1_END" ".try TRY_BLOCK_2 to TRY_BLOCK_2_END catch [mscorlib]System.Exception handler CATCH_BLOCK_2 to CATCH_BLOCK_2_END"
3400
3401 ./make_exception_overlap_test.sh catch_block_end_in_the_middle_of_a_instruction invalid ".try TRY_BLOCK_1 to TRY_BLOCK_1_END catch [mscorlib]System.Exception handler CATCH_BLOCK_1 to AFTER_PREFIX_5" ".try TRY_BLOCK_2 to TRY_BLOCK_2_END catch [mscorlib]System.Exception handler CATCH_BLOCK_2 to CATCH_BLOCK_2_END"
3402
3403
3404 #regions are disjoint
3405 ./make_exception_overlap_test.sh exception_entry_overlap_disjoint_1 valid ".try TRY_BLOCK_1 to TRY_BLOCK_1_END catch [mscorlib]System.Exception handler CATCH_BLOCK_2 to CATCH_BLOCK_2_END" ".try TRY_BLOCK_2 to TRY_BLOCK_2_END catch [mscorlib]System.Exception handler CATCH_BLOCK_1 to CATCH_BLOCK_1_END"
3406
3407 ./make_exception_overlap_test.sh exception_entry_overlap_disjoint_2 valid ".try TRY_BLOCK_2 to TRY_BLOCK_2_END catch [mscorlib]System.Exception handler CATCH_BLOCK_1 to CATCH_BLOCK_1_END" ".try TRY_BLOCK_1 to TRY_BLOCK_1_END catch [mscorlib]System.Exception handler CATCH_BLOCK_2 to CATCH_BLOCK_2_END"
3408
3409 #nesting
3410 ./make_exception_overlap_test.sh nested_exception_entry_comes_first valid ".try TRY_BLOCK_1_A to TRY_BLOCK_1_END catch [mscorlib]System.Exception handler CATCH_BLOCK_1 to CATCH_BLOCK_1_END" ".try TRY_BLOCK_1 to TRY_BLOCK_2_END catch [mscorlib]System.Exception handler CATCH_BLOCK_2 to CATCH_BLOCK_2_END"
3411
3412 ./make_exception_overlap_test.sh nested_exception_entry_comes_after invalid ".try TRY_BLOCK_1 to TRY_BLOCK_2_END catch [mscorlib]System.Exception handler CATCH_BLOCK_2 to CATCH_BLOCK_2_END" ".try TRY_BLOCK_1_A to TRY_BLOCK_1_END catch [mscorlib]System.Exception handler CATCH_BLOCK_1 to CATCH_BLOCK_1_END"
3413
3414
3415 #mutual protectiong
3416 ./make_exception_overlap_test.sh exception_same_try valid ".try TRY_BLOCK_1 to TRY_BLOCK_1_END catch [mscorlib]System.Exception handler CATCH_BLOCK_1 to CATCH_BLOCK_1_END" ".try TRY_BLOCK_1 to TRY_BLOCK_1_END catch [mscorlib]System.Exception handler CATCH_BLOCK_2 to CATCH_BLOCK_2_END"
3417
3418 ./make_exception_overlap_test.sh exception_same_catch invalid ".try TRY_BLOCK_1 to TRY_BLOCK_1_END catch [mscorlib]System.Exception handler CATCH_BLOCK_1 to CATCH_BLOCK_1_END" ".try TRY_BLOCK_2 to TRY_BLOCK_2_END catch [mscorlib]System.Exception handler CATCH_BLOCK_1 to CATCH_BLOCK_1_END"
3419
3420 ./make_exception_overlap_test.sh exception_same_try_with_catch_and_filter valid ".try TRY_BLOCK_1 to TRY_BLOCK_1_END catch [mscorlib]System.Exception handler CATCH_BLOCK_2 to CATCH_BLOCK_2_END" ".try TRY_BLOCK_1 to TRY_BLOCK_1_END filter FILTER_BLOCK_3 handler CATCH_BLOCK_1 to CATCH_BLOCK_1_END" "yes"
3421
3422 ./make_exception_overlap_test.sh exception_same_try_with_catch_and_finally invalid ".try TRY_BLOCK_1 to TRY_BLOCK_1_END finally handler FINALLY_BLOCK_1 to FINALLY_BLOCK_1_END" ".try TRY_BLOCK_1 to TRY_BLOCK_1_END catch [mscorlib]System.Exception handler CATCH_BLOCK_1 to CATCH_BLOCK_1_END" "no" "yes"
3423
3424 ./make_exception_overlap_test.sh exception_same_try_with_catch_and_fault invalid ".try TRY_BLOCK_1 to TRY_BLOCK_1_END fault handler FINALLY_BLOCK_1 to FINALLY_BLOCK_1_END" ".try TRY_BLOCK_1 to TRY_BLOCK_1_END catch [mscorlib]System.Exception handler CATCH_BLOCK_1 to CATCH_BLOCK_1_END" "no" "yes"
3425
3426
3427 #ldftn
3428 ./make_ldftn_test.sh ldftn_static_method valid "ldftn void class Driver::Method()"
3429 ./make_ldftn_test.sh ldftn_virtual_method valid "ldftn instance void class Driver::VirtMethod()"
3430 ./make_ldftn_test.sh ldftn_corlib_method valid "ldftn instance string string::ToUpper()"
3431
3432 #this is encoded as a memberref
3433 ./make_ldftn_test.sh ldftn_bad_function invalid "ldftn void class Test::NonPresent()"
3434
3435 ./make_ldftn_test.sh ldftn_overflow invalid "ldftn instance void class Driver::Method()" "ldc.i4.0\n\tldc.i4.0"
3436
3437 ./make_ldftn_test.sh ldftn_ctor unverifiable "ldftn void class Test::.ctor()"
3438 ./make_ldftn_test.sh ldftn_static_method valid "ldftn void class Test::StaticMethod()"
3439 ./make_ldftn_test.sh ldftn_non_virtual_method valid "ldftn instance void class Test::Method()"
3440 ./make_ldftn_test.sh ldftn_virtual_method valid "ldftn instance void class Test::VirtMethod()"
3441
3442
3443 #ldvirtftn
3444 #TODO test visibility for ldftn and ldvirtftn
3445
3446 ./make_ldvirtftn_test.sh ldvirtftn_virt_method valid "ldvirtftn instance void class Test::VirtMethod()" "newobj void class Test::.ctor()"
3447 ./make_ldvirtftn_test.sh ldvirtftn_virt_underflow invalid "ldvirtftn instance void class Test::VirtMethod()" "nop"
3448 ./make_ldvirtftn_test.sh ldvirtftn_valid_obj_on_stack valid "ldvirtftn instance string object::ToString()" "newobj void object::.ctor()"
3449
3450 I=1
3451 for TYPE in "ldc.i4.0" "ldc.i8 0" "ldc.r4 2" "ldc.i4.1\n\tconv.i" "ldloca 0" "ldloc.1"
3452 do
3453         ./make_ldvirtftn_test.sh ldvirtftn_invalid_type_on_stack_${I} unverifiable "ldvirtftn instance string object::ToString()" "$TYPE"
3454         I=`expr $I + 1`
3455 done
3456
3457 ./make_ldvirtftn_test.sh ldvirtftn_non_virtual_method valid "ldvirtftn instance void class Test::Method()" "newobj void class Test::.ctor()"
3458
3459 ./make_ldvirtftn_test.sh ldvirtftn_ctor unverifiable "ldvirtftn void class Test::.ctor()" "newobj void class Test::.ctor()"
3460 ./make_ldvirtftn_test.sh ldvirtftn_static_method unverifiable "ldvirtftn void class Test::StaticMethod()" "newobj void class Test::.ctor()"
3461 ./make_ldvirtftn_test.sh ldvirtftn_method_not_present invalid "ldvirtftn void class Test::NonExistant()" "newobj void Test::.ctor()"
3462
3463
3464 ./make_ldvirtftn_test.sh ldvirtftn_method_stack_type_obj_compatible_1 valid "ldvirtftn instance string object::ToString()" "newobj void Test::.ctor()"
3465 ./make_ldvirtftn_test.sh ldvirtftn_method_stack_type_obj_compatible_2 valid "ldvirtftn void class Test::VirtMethod()" "newobj void Test::.ctor()"
3466 ./make_ldvirtftn_test.sh ldvirtftn_method_stack_type_obj_compatible_3 unverifiable "ldvirtftn void class Test::VirtMethod()" "newobj void object::.ctor()"
3467
3468
3469 #Delegates
3470 #ldftn delegates
3471 #pure native int
3472 ./make_delegate_test.sh delegate_with_native_int unverifiable "ldarg.1\n\tconv.i" "DelegateNoArg" "ldarg.0"
3473
3474 #random types
3475 I=1;
3476 for TYPE in "ldc.i4.0" "ldc.i8 0" "ldc.r4 0" "ldc.r8 1" "ldarga 1"
3477 do
3478         ./make_delegate_test.sh delegate_with_bad_type_${I} unverifiable "ldftn void Driver::Method()" "DelegateNoArg" "$TYPE"
3479         I=`expr $I + 1`
3480 done
3481
3482 #ldftn
3483 #static method
3484 ./make_delegate_test.sh delegate_ldftn_static_method_1 valid "ldftn void Driver::Method()" "DelegateNoArg" "ldnull"
3485 ./make_delegate_test.sh delegate_ldftn_static_method_2 valid "ldftn void Driver::Method2(int32)" "DelegateIntArg" "ldnull"
3486 ./make_delegate_test.sh delegate_ldftn_static_method_3 unverifiable "ldftn void Driver::Method2(int32)" "DelegateNoArg" "ldnull"
3487 ./make_delegate_test.sh delegate_ldftn_static_method_4 unverifiable "ldftn void Driver::Method()" "DelegateIntArg" "ldnull"
3488
3489 #non-virtual
3490 #null this
3491 ./make_delegate_test.sh delegate_ldftn_non_virtual_method_1 valid "ldftn instance void Driver::NonVirtMethod()" "DelegateNoArg" "ldnull"
3492 ./make_delegate_test.sh delegate_ldftn_non_virtual_method_2 valid "ldftn instance void Driver::NonVirtMethod2(int32)" "DelegateIntArg" "ldnull"
3493
3494 #method on this
3495 ./make_delegate_test.sh delegate_ldftn_non_virtual_method_3 valid "ldftn instance void Driver::NonVirtMethod()" "DelegateNoArg" "newobj instance void class Driver::.ctor()"
3496 ./make_delegate_test.sh delegate_ldftn_non_virtual_method_4 valid "ldftn instance void Driver::NonVirtMethod2(int32)" "DelegateIntArg" "newobj instance void class Driver::.ctor()"
3497 #method on parent
3498 ./make_delegate_test.sh delegate_ldftn_non_virtual_method_5 valid "ldftn instance void Parent::ParentMethod()" "DelegateNoArg" "newobj instance void class Driver::.ctor()"
3499
3500 #invalid this
3501 ./make_delegate_test.sh delegate_ldftn_non_virtual_method_6 unverifiable "ldftn instance void Driver::NonVirtMethod()" "DelegateNoArg" "newobj void object::.ctor()"
3502 ./make_delegate_test.sh delegate_ldftn_non_virtual_method_7 unverifiable "ldftn instance void Driver::NonVirtMethod()" "DelegateNoArg" "newobj void Parent::.ctor()"
3503
3504 #virtual methods
3505 ./make_delegate_test.sh delegate_ldftn_virtual_method_1 valid "ldftn instance void Driver::VirtMethod()" "DelegateNoArg" "ldarg.0"
3506 ./make_delegate_test.sh delegate_ldftn_virtual_method_2 valid "ldftn instance void Driver::VirtMethod2(int32)" "DelegateIntArg" "ldarg.0"
3507 ./make_delegate_test.sh delegate_ldftn_virtual_method_3 valid "ldftn instance void Driver::ParentVirtMethod()" "DelegateNoArg" "ldarg.0"
3508 ./make_delegate_test.sh delegate_ldftn_virtual_method_4 valid "ldftn instance void Parent::ParentVirtMethod()" "DelegateNoArg" "ldarg.0"
3509
3510 #other forms of ldarg
3511 ./make_delegate_test.sh delegate_ldftn_virtual_method_5 valid "ldftn instance void Driver::VirtMethod()" "DelegateNoArg" "ldarg.s 0"
3512 ./make_delegate_test.sh delegate_ldftn_virtual_method_6 valid "ldftn instance void Driver::VirtMethod()" "DelegateNoArg" "ldarg 0"
3513
3514 #object is not this
3515 ./make_delegate_test.sh delegate_ldftn_virtual_method_7 unverifiable "ldftn instance void Driver::VirtMethod()" "DelegateNoArg" "newobj instance void class Driver::.ctor()"
3516 ./make_delegate_test.sh delegate_ldftn_virtual_method_8 unverifiable "ldftn instance void Parent::VirtMethod()" "DelegateNoArg" "newobj instance void class Driver::.ctor()"
3517 ./make_delegate_test.sh delegate_ldftn_virtual_method_9 unverifiable "ldftn instance void Driver::ParentVirtMethod()" "DelegateNoArg" "newobj instance void class Driver::.ctor()"
3518 ./make_delegate_test.sh delegate_ldftn_virtual_method_10 unverifiable "ldftn instance void Parent::ParentVirtMethod()" "DelegateNoArg" "newobj instance void class Driver::.ctor()"
3519
3520 #static method
3521 ./make_delegate_test.sh delegate_ldftn_virtual_method_11 unverifiable "ldftn void Driver::VirtMethod()" "DelegateNoArg" "ldarg.0" "Driver"
3522 ./make_delegate_test.sh delegate_ldftn_virtual_method_12 unverifiable "ldftn void Parent::VirtMethod()" "DelegateNoArg" "ldarg.0" "Driver"
3523 ./make_delegate_test.sh delegate_ldftn_virtual_method_13 unverifiable "ldftn void Parent::ParentVirtMethod()" "DelegateNoArg" "ldarg.0" "Driver"
3524
3525 #final virtual
3526 ./make_delegate_test.sh delegate_ldftn_virtual_method_14 valid "ldftn instance void Driver::SealedVirtMethod()" "DelegateNoArg" "ldarg.0" "Driver"
3527 ./make_delegate_test.sh delegate_ldftn_virtual_method_15 unverifiable "ldftn instance void Parent::SealedVirtMethod()" "DelegateNoArg" "ldarg.0" "Driver"
3528 ./make_delegate_test.sh delegate_ldftn_virtual_method_16 unverifiable "ldftn instance void Parent::SealedVirtMethod()" "DelegateNoArg" "ldarg.0" "Parent"
3529
3530
3531 #instruction sequence
3532 ./make_delegate_test.sh delegate_ldftn_bad_sequence unverifiable "ldftn void Driver::Method()\n\t\tnop" "DelegateNoArg" "ldarg.0"
3533 #this one is terribly hard to read
3534
3535 ./make_delegate_test.sh delegate_ldftn_different_basic_block unverifiable "pop\n\t\tpop\n\t\tldarg.0\n\t\tldftn void Driver::Method()" "DelegateNoArg" "ldarg.0\n\t\tldftn void Driver::Method()\n\t\tldarg.1\n\t\tbrfalse DELEGATE_OP"
3536
3537 #it's not necessary to test split due to a protected block since the stack must be empty at the beginning.
3538
3539
3540 #virtual method with starg.0
3541 ./make_delegate_test.sh delegate_ldftn_virtual_method_with_starg0_1 unverifiable "ldftn instance void Driver::VirtMethod()" "DelegateNoArg" "ldarg.0\n\tstarg.s 0\n\tldarg.0"
3542 ./make_delegate_test.sh delegate_ldftn_virtual_method_with_starg0_2 unverifiable "ldftn instance void Driver::VirtMethod()" "DelegateNoArg" "ldarg.0\n\tstarg 0\n\tldarg.0"
3543
3544 #value types
3545 ./make_delegate_test.sh delegate_ldftn_non_virtual_method_valuetype valid "ldftn instance void MyValueType::NonVirtMethod()" "DelegateNoArg" "ldloc.0\n\tbox MyValueType"
3546 ./make_delegate_test.sh delegate_ldftn_virtual_method_valuetype valid "ldftn instance string MyValueType::ToString()" "ToStringDelegate" "ldloc.0\n\tbox MyValueType"
3547
3548 ./make_delegate_test.sh delegate_ldftn_virtual_method_valuetype_byref unverifiable "ldftn instance string MyValueType::ToString()" "ToStringDelegate" "ldloca 0"
3549
3550
3551 #ldvirtftn
3552 #ok cases
3553 ./make_delegate_test.sh delegate_ldvirtftn_non_virtual_method valid "ldvirtftn instance void Driver::NonVirtMethod()" "DelegateNoArg" "ldarg.0\n\tdup"
3554 ./make_delegate_test.sh delegate_ldvirtftn_virtual_method valid "ldvirtftn instance void Driver::VirtMethod()" "DelegateNoArg" "ldarg.0\n\tdup"
3555
3556 #wrong instruction sequence
3557 ./make_delegate_test.sh delegate_ldvirtftn_bad_sequence unverifiable "ldvirtftn instance void Driver::VirtMethod()" "DelegateNoArg" "ldarg.0\n\tldarg.0"
3558
3559 ./make_delegate_test.sh delegate_ldvirtftn_different_basic_block unverifiable "pop\n\t\tdup\n\t\tldvirtftn instance void Driver::VirtMethod()" "DelegateNoArg" "ldarg.0\n\t\tldarg.0\n\t\tldvirtftn instance void Driver::VirtMethod()\n\t\tldarg.1\n\t\tbrfalse DELEGATE_OP"
3560
3561 ./make_delegate_test.sh delegate_ldvirtftn_different_basic_block_dup unverifiable "DUP_OP: ldvirtftn instance void Driver::VirtMethod()" "DelegateNoArg" "ldarg.0\n\t\tdup\n\t\tldarg.1\n\t\tbrfalse DUP_OP\n\t\tpop\n\t\tdup"
3562
3563
3564 #tests for ovf opcodes
3565 I=1
3566 for OP in "add.ovf" "add.ovf.un" "mul.ovf" "mul.ovf.un" "sub.ovf" "sub.ovf.un" 
3567 do
3568         for TYPE in "object" "string" "float32" "float64" "int32*" "typedref" "int32[]" "int32[,]" "method int32 *(int32)"
3569         do
3570                 ./make_bin_test.sh bin_ovf_math_1_${I} unverifiable $OP int32 "${TYPE}"
3571                 ./make_bin_test.sh bin_ovf_math_2_${I} unverifiable $OP int64 "${TYPE}"
3572                 ./make_bin_test.sh bin_ovf_math_3_${I} unverifiable $OP "native int" "${TYPE}"
3573                 ./make_bin_test.sh bin_ovf_math_4_${I} unverifiable $OP "int32&" "${TYPE}"
3574                 I=`expr $I + 1`
3575         done
3576
3577         for TYPE in "int32" "native int"
3578         do
3579                 ./make_bin_test.sh bin_ovf_math_5_${I} valid $OP int32 "${TYPE}"
3580                 I=`expr $I + 1`
3581         done
3582
3583         for TYPE in "int32" "native int"
3584         do
3585                 ./make_bin_test.sh bin_ovf_math_6_${I} valid $OP "native int" "${TYPE}"
3586                 I=`expr $I + 1`
3587         done
3588 done
3589         
3590 for OP in "add.ovf.un" "sub.ovf.un" 
3591 do
3592         for TYPE in "int32" "native int" "int32&"
3593         do
3594                 ./make_bin_test.sh bin_ovf_math_7_${I} unverifiable $OP "int32&" "${TYPE}"
3595                 I=`expr $I + 1`
3596         done
3597
3598         for TYPE in "int32" "native int" "int32&"
3599         do
3600                 ./make_bin_test.sh bin_ovf_math_8_${I} unverifiable $OP "${TYPE}" "int32&"
3601                 I=`expr $I + 1`
3602         done
3603 done
3604
3605 #should be invalid
3606 for OP in "add.ovf" "mul.ovf" "mul.ovf.un" "sub.ovf"
3607 do
3608         for TYPE in "int32" "native int" "int32&"
3609         do
3610                 ./make_bin_test.sh bin_ovf_math_7_${I} unverifiable $OP "int32&" "${TYPE}"
3611                 I=`expr $I + 1`
3612         done
3613
3614         for TYPE in "int32" "native int" "int32&"
3615         do
3616                 ./make_bin_test.sh bin_ovf_math_8_${I} unverifiable $OP "${TYPE}" "int32&"
3617                 I=`expr $I + 1`
3618         done
3619 done
3620
3621 #ovf math doesn't work with floats
3622 I=1
3623 for OP in "add.ovf.un" "add.ovf" "sub.ovf.un" "sub.ovf" "mul.ovf.un" "mul.ovf"
3624 do
3625         for TYPE in "float32" "float64"
3626         do
3627                 ./make_bin_test.sh bin_ovf_math_f_${I} unverifiable $OP "${TYPE}" "${TYPE}"
3628                 I=`expr $I + 1`
3629         done
3630 done
3631
3632 #unbox.any
3633
3634 ./make_unbox_any_test.sh unbox_any_valuetype valid object int32 "stloc.1" "ldc.i4.0\n\tbox int32"
3635 ./make_unbox_any_test.sh unbox_any_reference valid object string "stloc.1" "ldstr \"str\""
3636 ./make_unbox_any_test.sh unbox_any_reference_null valid object string "stloc.1" "ldnull"
3637
3638 #object is not a reference type
3639 I=1
3640 for TYPE in "ldc.i4.0" "ldc.i8 0" "ldc.r8 0" "ldloca 0" "ldc.i4.0\n\tconv.u"
3641 do
3642         ./make_unbox_any_test.sh unbox_any_bad_object_${I} unverifiable object int32 "stloc.1" "$TYPE"
3643         I=`expr $I + 1`
3644 done
3645
3646 #token is byref, byref-like or void
3647 ./make_unbox_any_test.sh unbox_any_bad_token_1 invalid object "int32\&" "pop" "ldnull"
3648 ./make_unbox_any_test.sh unbox_any_bad_token_2 unverifiable object typedref "pop" "ldnull"
3649 ./make_unbox_any_test.sh unbox_any_bad_token_3 invalid object void "pop" "ldnull"
3650
3651
3652
3653 #stobj
3654 #bad src
3655 I=1
3656 for TYPE in "int32" "int64" "float32" "float64" Class MyStruct string object "int32[]" "int32[,]" "native int"
3657 do
3658         ./make_stobj_test.sh stobj_simple_${I} valid "$TYPE" "$TYPE\&" "$TYPE" 
3659         I=`expr $I + 1`
3660 done
3661
3662
3663 for TYPE in "int32*" "typedref" "method int32 *(int32)"
3664 do
3665         ./make_stobj_test.sh stobj_simple_${I} unverifiable "$TYPE" "$TYPE\&" "$TYPE" 
3666         I=`expr $I + 1`
3667 done
3668
3669 for TYPE in "int32\&" "void"
3670 do
3671         ./make_stobj_test.sh stobj_simple_${I} invalid "$TYPE" "$TYPE\&" "$TYPE" 
3672         I=`expr $I + 1`
3673 done
3674
3675 #src should not be ptr or byref
3676 I=1
3677 for TYPE in "int32\&" "int32*" "typedref"
3678 do
3679         ./make_stobj_test.sh stobj_bad_src_${I} unverifiable "$TYPE" "int32\&" "int32" 
3680         I=`expr $I + 1`
3681 done
3682
3683 #dest type is not a managed pointer
3684 I=1
3685 for TYPE in "int32" "int64" "float32" "float64" Class MyStruct string object "int32[]" "int32[,]" "native int"
3686 do
3687         ./make_stobj_test.sh stobj_dest_not_managed_pointer_${I} unverifiable "$TYPE" "$TYPE" "$TYPE" 
3688         I=`expr $I + 1`
3689 done
3690
3691 #src is compat to dest
3692 I=1
3693 for TYPE in "int8" "unsigned int8" "bool" "int16" "unsigned int16" "char" "int32" "unsigned int32" "native int" "native unsigned int"
3694 do 
3695         ./make_stobj_test.sh stobj_src_compat_to_token_${I} valid "$TYPE" "int32\&" "int32" 
3696         I=`expr $I + 1`
3697 done
3698
3699 for TYPE in "int64" "unsigned int64" "float32" "float64" string object
3700 do 
3701         ./make_stobj_test.sh stobj_src_compat_to_token_${I} unverifiable "$TYPE" "int32\&" "int32" 
3702         I=`expr $I + 1`
3703 done
3704
3705 for TYPE in string object Class
3706 do 
3707         ./make_stobj_test.sh stobj_src_compat_to_token_${I} valid "$TYPE" "object\&" "object" 
3708         I=`expr $I + 1`
3709 done
3710
3711 ./make_stobj_test.sh stobj_src_compat_to_token_boxed_vt valid "int32" "object\&" "object" "box int32"
3712 ./make_stobj_test.sh stobj_src_compat_to_token_null_literal valid "object" "object\&" "object" "pop\n\tldnull"
3713
3714
3715 #token type subtype of dest_type
3716 for TYPE in string object Class "int32[]" "int32[,]"
3717 do 
3718         ./make_stobj_test.sh stobj_token_subtype_of_dest_${I} valid "$TYPE" "object\&" "$TYPE" 
3719         I=`expr $I + 1`
3720 done
3721
3722
3723
3724
3725 #initobj
3726 I=1
3727 for TYPE in int32 int64 float32 float64 object string MyStruct Class "valuetype StructTemplate\`1<object>" "native int"
3728 do
3729         ./make_initobj_test.sh initobj_good_types_${I} valid "${TYPE}\&" "${TYPE}"
3730         I=`expr $I + 1`
3731 done
3732
3733 #pointers
3734 I=1
3735 for TYPE in "native int" "int32*"
3736 do
3737         ./make_initobj_test.sh initobj_pointer_like_types_${I} unverifiable "${TYPE}" "${TYPE}"
3738         I=`expr $I + 1`
3739 done
3740
3741 #bad dest
3742 I=1
3743 for TYPE in int32 int64 float32 float64 string MyStruct typedref
3744 do
3745         ./make_initobj_test.sh initobj_wrong_on_stack_types_${I} unverifiable "${TYPE}" "${TYPE}"
3746         I=`expr $I + 1`
3747 done
3748
3749
3750 #invalid token
3751 I=1
3752 for TYPE in "int32\&" void
3753 do
3754         ./make_initobj_test.sh initobj_bad_token_type_${I} invalid "int32\&" "${TYPE}"
3755         I=`expr $I + 1`
3756 done
3757
3758 #bad token
3759 I=1
3760 for TYPE in int64 float32 float64 object string MyStruct Class "valuetype StructTemplate\`1<object>"
3761 do
3762         ./make_initobj_test.sh initobj_wrong_type_on_stack_${I} unverifiable "int32\&" "${TYPE}"
3763         I=`expr $I + 1`
3764 done
3765
3766 #type and token are compatible
3767 ./make_initobj_test.sh initobj_compatible_type_on_stack_1 valid "int32\&" "native int"
3768 ./make_initobj_test.sh initobj_compatible_type_on_stack_2 strict "object\&" "string"
3769 ./make_initobj_test.sh initobj_compatible_type_on_stack_3 unverifiable "string\&" "object"
3770
3771 ./make_initobj_test.sh initobj_stack_underflow invalid "int32\&" "int32" "pop"
3772
3773 ./make_initobj_test.sh initobj_null_literal unverifiable "int32\&" "int32" "pop\n\tldnull"
3774 ./make_initobj_test.sh initobj_boxed_value unverifiable "int32\&" "int32" "pop\n\tldc.i4.0\n\tbox int32"
3775
3776
3777
3778 #cpobj
3779 I=1
3780 for TYPE in int32 int64 float32 float64 object string "valuetype MyStruct" "int32[]" "int32[,]" "native int"
3781 do
3782         ./make_cpobj_test.sh cpobj_simple_${I} valid "${TYPE}\&" "${TYPE}\&" "${TYPE}"
3783         I=`expr $I + 1`
3784 done
3785
3786 #should be able to use unmanaged types
3787 for TYPE in "int32*" "typedref" "method int32 *(int32)"
3788 do
3789         ./make_cpobj_test.sh cpobj_simple_${I} unverifiable "${TYPE}\&" "${TYPE}\&" "${TYPE}"
3790         I=`expr $I + 1`
3791 done
3792
3793 #should be able to use invalid types
3794 for TYPE in "int32\&" "void"
3795 do
3796         ./make_cpobj_test.sh cpobj_simple_${I} invalid "${TYPE}\&" "${TYPE}\&" "${TYPE}"
3797         I=`expr $I + 1`
3798 done
3799
3800 #src not a managed pointer
3801 I=1
3802 for TYPE in "int32" "int64" "float32" "float64" Class MyStruct string object "int32[]" "int32[,]" "native int"
3803 do
3804         ./make_cpobj_test.sh cpobj_src_not_byref_${I} unverifiable "${TYPE}" "${TYPE}\&" "${TYPE}"
3805         I=`expr $I + 1`
3806 done
3807
3808 #dest not a managed pointer
3809 I=1
3810 for TYPE in "int32" "int64" "float32" "float64" Class MyStruct string object "int32[]" "int32[,]" "native int"
3811 do
3812         ./make_cpobj_test.sh cpobj_dest_not_byref_${I} unverifiable "${TYPE}\&" "${TYPE}" "${TYPE}"
3813         I=`expr $I + 1`
3814 done
3815
3816 #src and dest not a managed pointer
3817 I=1
3818 for TYPE in "int32" "int64" "float32" "float64" Class MyStruct string object "int32[]" "int32[,]" "native int"
3819 do
3820         ./make_cpobj_test.sh cpobj_src_and_dest_not_byref_${I} unverifiable "${TYPE}" "${TYPE}" "${TYPE}"
3821         I=`expr $I + 1`
3822 done
3823
3824
3825 #bad token type
3826 I=1
3827 for TYPE in "int32\&" "void"
3828 do
3829         ./make_cpobj_test.sh cpobj_bad_token_type_${I} invalid "int32\&" "int32\&" "${TYPE}"
3830         I=`expr $I + 1`
3831 done
3832
3833 #src compat to token
3834 ./make_cpobj_test.sh cpobj_src_compat_1 valid "int32\&" "int32\&" "native int"
3835 ./make_cpobj_test.sh cpobj_src_compat_2 valid "native int\&" "int32\&" "int32"
3836
3837 ./make_cpobj_test.sh cpobj_src_compat_3 valid "string\&" "object\&" "object"
3838 ./make_cpobj_test.sh cpobj_src_compat_4 valid "Class\&" "object\&" "object"
3839
3840 ./make_cpobj_test.sh cpobj_src_compat_5 unverifiable "object\&" "string\&" "string"
3841 ./make_cpobj_test.sh cpobj_src_compat_6 unverifiable "object\&" "Class\&" "Class"
3842
3843
3844 #src not compat to token
3845 I=1
3846 for TYPE in  "int64" "float32" "float64" Class MyStruct string object "int32[]" "int32[,]"
3847 do
3848         ./make_cpobj_test.sh cpobj_src_not_compat_to_token_${I} unverifiable "${TYPE}\&" "int32\&" "int32"
3849         I=`expr $I + 1`
3850 done
3851
3852 #token compat to dest
3853 ./make_cpobj_test.sh cpobj_token_compat_1 valid "int32\&" "int32\&" "native int"
3854 ./make_cpobj_test.sh cpobj_token_compat_2 valid "int32\&" "native int\&" "int32"
3855
3856 ./make_cpobj_test.sh cpobj_token_compat_3 valid "Class\&" "object\&" "Class"
3857 ./make_cpobj_test.sh cpobj_token_compat_4 valid "string\&" "object\&" "string"
3858
3859 ./make_cpobj_test.sh cpobj_token_compat_5 unverifiable "object\&" "Class\&" "object"
3860 ./make_cpobj_test.sh cpobj_token_compat_6 unverifiable "object\&" "string\&" "object"
3861
3862 #token to compat to dest
3863 I=1
3864 for TYPE in  "int64" "float32" "float64" Class MyStruct string object "int32[]" "int32[,]"
3865 do
3866         ./make_cpobj_test.sh cpobj_token_not_compat_to_dest${I} unverifiable "int32\&" "int32\&" "${TYPE}"
3867         I=`expr $I + 1`
3868 done
3869
3870 #src and dest not a managed pointer
3871 ./make_cpobj_test.sh cpobj_bad_src_and_dest unverifiable "int32" "int32" "int32"
3872
3873 #src or dest are null or boxed
3874 ./make_cpobj_test.sh cpobj_src_is_null unverifiable "int32\&" "int32\&" "int32" "pop\n\tldnull"
3875 ./make_cpobj_test.sh cpobj_dest_is_null unverifiable "int32\&" "int32\&" "int32" "pop\n\tpop\n\tldnull\n\tldloc.0"
3876
3877 ./make_cpobj_test.sh cpobj_src_is_boxed unverifiable "int32" "int32\&" "int32" "box int32"
3878 ./make_cpobj_test.sh cpobj_dest_is_boxed unverifiable "int32\&" "int32" "int32" "pop\n\tbox int32\n\tldloc.0"
3879
3880 ./make_cpobj_test.sh cpobj_underflow_1 invalid "int32\&" "int32\&" "int32" "pop"
3881 ./make_cpobj_test.sh cpobj_underflow_2 invalid "int32\&" "int32\&" "int32" "pop\n\tpop"
3882
3883
3884
3885 #sizeof
3886 I=1
3887 for TYPE in int32 object string "int32[]" "native int" "int32[,]" typedref "int32*" "method int32 *(int32)" "class Template\`1<int32>" "valuetype MyStruct"
3888 do
3889         ./make_sizeof_test.sh sizeof_${I} valid "$TYPE"
3890         I=`expr $I + 1`
3891 done
3892
3893 for TYPE in void "int32&"
3894 do
3895         ./make_sizeof_test.sh sizeof_${I} invalid "$TYPE"
3896         I=`expr $I + 1`
3897 done
3898
3899
3900 #localloc
3901
3902 #valid types
3903 I=1
3904 for INIT in "ldc.i4.1" "ldc.i4.1\n\tconv.i" 
3905 do
3906         ./make_localloc_test.sh localloc_stack_type_$I unverifiable "$INIT"
3907         I=`expr $I + 1`
3908 done
3909
3910 #these types should be invalid
3911 for INIT in "ldc.i8 2" "ldc.r4 2.2" "ldc.r8 2.2" "ldloca 1"
3912 do
3913         ./make_localloc_test.sh localloc_stack_type_$I unverifiable "$INIT"
3914         I=`expr $I + 1`
3915 done
3916
3917 #stack underflow
3918 ./make_localloc_test.sh localloc_empty_stack invalid 
3919 ./make_localloc_test.sh localloc_stack_with_more_than_2_items invalid "ldc.i4.1\n\tldc.i4.1"
3920
3921 #inside exception blocks
3922 ./make_localloc_test.sh localloc_inside_catch_handler invalid "ldc.i4.1" "catch"
3923 ./make_localloc_test.sh localloc_inside_filter invalid "ldc.i4.1" "filter"
3924 ./make_localloc_test.sh localloc_inside_handler invalid "ldc.i4.1" "handler"
3925 ./make_localloc_test.sh localloc_inside_finally invalid "ldc.i4.1" "finally"
3926 ./make_localloc_test.sh localloc_inside_fault invalid "ldc.i4.1" "fault"
3927
3928
3929
3930
3931
3932
3933 #tests for call and callvirt
3934
3935 #call test
3936 #invalid method token
3937 #valid
3938 #validate the this pointer for signatures with HASTHIS. 
3939 #this ptr: reference types must be a value, value type can be a MP or a BT.
3940 #number of args
3941 #args are compatible
3942 #method is abstract
3943 #calling base class constructor
3944 #calling a value type constructor
3945 #visibility
3946 #calling non-final virtual calls on something not a boxed valuetype, this arg must have THIS_POINTER_MASK and no starg.0 or ldarga.0 happens
3947
3948
3949 I=1
3950 for CTYPE in "call" "callvirt"
3951 do
3952         ./make_call_test.sh call_${I}_non_virtual_1 valid "${CTYPE} instance void ClassA::Method1()" "newobj instance void ClassA::.ctor()"
3953         ./make_call_test.sh call_${I}_non_virtual_2 valid "${CTYPE} instance void ClassA::Method1()" "ldnull"
3954         ./make_call_test.sh call_${I}_non_virtual_3 valid "${CTYPE} instance void ClassA::Method2(int32)" "newobj instance void ClassA::.ctor()\n\t\tldc.i4.0"
3955         ./make_call_test.sh call_${I}_non_virtual_underflow invalid "${CTYPE} instance void ClassA::Method12(int32)" "newobj instance void ClassA::.ctor()"
3956         ./make_call_test.sh call_${I}_non_virtual_bad_this invalid "${CTYPE} instance void ClassA::Method12(int32)" "newobj instance void ClassB::.ctor()"
3957
3958         ./make_call_test.sh call_${I}_non_virtual_compat_this_1 valid "${CTYPE} instance void ClassA::Method1()" "newobj instance void ClassC::.ctor()"
3959         ./make_call_test.sh call_${I}_non_virtual_compat_this_2 valid "${CTYPE} instance void ClassC::Method1()" "newobj instance void ClassC::.ctor()"
3960         ./make_call_test.sh call_${I}_non_virtual_compat_this_3 unverifiable "${CTYPE} instance void ClassC::Method1()" "newobj instance void ClassA::.ctor()"
3961
3962         ./make_call_test.sh call_${I}_final_virtual_method_1 valid "${CTYPE} instance void ClassC::VirtMethod()" "newobj instance void ClassC::.ctor()"
3963
3964         ./make_call_test.sh call_${I}_virtual_method_1 valid "${CTYPE} instance void Driver::VirtMethod()" "ldarg.0" "instance"
3965         ./make_call_test.sh call_${I}_virtual_method_2 valid "${CTYPE} instance void BaseClass::VirtMethod()" "ldarg.0" "instance"
3966
3967         I=`expr $I + 1`
3968 done
3969
3970
3971 #tests for call only
3972 ./make_call_test.sh call_global_1 valid "call void GlobalMethod1()"
3973 ./make_call_test.sh call_global_2 valid "call void GlobalMethod2(int32)" "ldc.i4.0"
3974 ./make_call_test.sh call_global_underflow invalid "call void GlobalMethod2(int32)" ""
3975 ./make_call_test.sh call_abstract_method unverifiable "call instance void InterfaceA::AbsMethod()" "newobj instance void ImplIfaceA::.ctor()"
3976 ./make_call_test.sh call_final_virtual_method_2 unverifiable "call instance void ClassC::VirtMethod()" "newobj instance void ClassA::.ctor()"
3977 ./make_call_test.sh call_final_virtual_method_3 unverifiable "call instance void ClassA::VirtMethod()" "newobj instance void ClassA::.ctor()"
3978
3979 ./make_call_test.sh call_virtual_method_3 unverifiable "call instance void BaseClass::VirtMethod()" "ldarg.0" "instance" "ldarg.0\n\t\tstarg 0" 
3980 ./make_call_test.sh call_virtual_method_4 unverifiable "call instance void BaseClass::VirtMethod()" "ldarg.0" "instance" "ldarga 0\n\t\tpop"
3981
3982 #value type (we can call non final virtual on boxed VT)
3983 ./make_call_test.sh call_valuetype_1 valid "call instance void MyValueType::Method()" "ldloca 0"
3984 ./make_call_test.sh call_valuetype_2 unverifiable "call instance void MyValueType::Method()" "ldloc.0\n\t\tbox MyValueType"
3985 ./make_call_test.sh call_valuetype_3 unverifiable "call instance void MyValueType::Method()" "ldloc.0"
3986
3987 ./make_call_test.sh call_valuetype_4 unverifiable "call instance int32 [mscorlib]System.ValueType::GetHashCode()" "ldloca 0" "static" "pop"
3988 ./make_call_test.sh call_valuetype_5 valid "call instance int32 MyValueType::GetHashCode()" "ldloca 0" "static" "pop"
3989
3990 ./make_call_test.sh call_valuetype_6 valid "call instance int32 [mscorlib]System.ValueType::GetHashCode()"  "ldloc.0\n\t\tbox MyValueType" "static" "pop"
3991 ./make_call_test.sh call_valuetype_7 valid "call instance bool object::Equals(object)" "ldloc.0\n\t\tbox MyValueType\n\t\tldnull" "static" "pop"
3992
3993 ./make_call_test.sh call_valuetype_8 valid "call instance int32 [mscorlib]System.Object::GetHashCode()"  "ldloc.0\n\t\tbox MyValueType" "static" "pop"
3994
3995 #tests for callvirt only
3996 #FIXME ilasm encode the signature with instance even if it doesn't state so.
3997 #./make_call_test.sh call_virt_global_1 invalid "callvirt void GlobalMethod1()"
3998
3999 ./make_call_test.sh callvirt_abstract_method valid "callvirt instance void InterfaceA::AbsMethod()" "newobj instance void ImplIfaceA::.ctor()"
4000 ./make_call_test.sh callvirt_final_virtual_method_2 unverifiable "callvirt instance void ClassC::VirtMethod()" "newobj instance void ClassA::.ctor()"
4001 ./make_call_test.sh callvirt_final_virtual_method_3 valid "callvirt instance void ClassA::VirtMethod()" "newobj instance void ClassA::.ctor()"
4002
4003 ./make_call_test.sh callvirt_virtual_method_3 valid "callvirt instance void BaseClass::VirtMethod()" "ldarg.0" "instance" "ldarg.0\n\t\tstarg 0" 
4004 ./make_call_test.sh callvirt_virtual_method_4 valid "callvirt instance void BaseClass::VirtMethod()" "ldarg.0" "instance" "ldarga 0\n\t\tpop"
4005
4006 #value type (we can call non final virtual on boxed VT)
4007 ./make_call_test.sh callvirt_valuetype_1 unverifiable "callvirt instance void MyValueType::Method()" "ldloca 0"
4008 ./make_call_test.sh callvirt_valuetype_2 unverifiable "callvirt instance void MyValueType::Method()" "ldloc.0\n\t\tbox MyValueType"
4009 ./make_call_test.sh callvirt_valuetype_3 unverifiable "callvirt instance void MyValueType::Method()" "ldloc.0"
4010
4011 ./make_call_test.sh callvirt_valuetype_4 unverifiable "callvirt instance int32 [mscorlib]System.ValueType::GetHashCode()" "ldloca 0" "static" "pop"
4012 ./make_call_test.sh callvirt_valuetype_5 unverifiable "callvirt instance int32 MyValueType::GetHashCode()" "ldloca 0" "static" "pop"
4013
4014 ./make_call_test.sh callvirt_valuetype_6 valid "callvirt instance int32 [mscorlib]System.ValueType::GetHashCode()"  "ldloc.0\n\t\tbox MyValueType" "static" "pop"
4015 ./make_call_test.sh callvirt_valuetype_7 valid "callvirt instance bool object::Equals(object)" "ldloc.0\n\t\tbox MyValueType\n\t\tldnull" "static" "pop"
4016 ./make_call_test.sh callvirt_valuetype_8 valid "callvirt instance int32 [mscorlib]System.Object::GetHashCode()"  "ldloc.0\n\t\tbox MyValueType" "static" "pop"
4017
4018
4019 #mkrefany
4020 ./make_mkrefany.sh mkrefany_empty_stack invalid int32 int32 "pop"
4021
4022 ./make_mkrefany.sh mkrefany_good_type_1 valid int32 int32
4023 ./make_mkrefany.sh mkrefany_good_type_2 valid int32 "unsigned int32"
4024 ./make_mkrefany.sh mkrefany_good_type_3 valid int32 "native int"
4025 ./make_mkrefany.sh mkrefany_good_type_4 valid object object
4026
4027 ./make_mkrefany.sh mkrefany_type_not_compat_1 unverifiable string object
4028 ./make_mkrefany.sh mkrefany_type_not_compat_2 unverifiable int32 int8
4029 ./make_mkrefany.sh mkrefany_type_not_compat_3 unverifiable object string
4030
4031 ./make_mkrefany.sh mkrefany_native_int unverifiable int32 int32 "conv.i"
4032
4033 ./make_mkrefany.sh mkrefany_bad_type_1 unverifiable int32 int32 "pop\n\t\tldc.i4.0"
4034
4035 ./make_mkrefany.sh mkrefany_bad_type_2 invalid int32 "int32\&"
4036
4037
4038 #method definition return type validation
4039 ./make_invalid_ret_type.sh ret_type_byref unverifiable "int32\&"
4040 ./make_invalid_ret_type.sh ret_type_typedref unverifiable "typedref"
4041 ./make_invalid_ret_type.sh ret_type_arg_interator unverifiable "valuetype [mscorlib]System.ArgIterator"
4042 ./make_invalid_ret_type.sh ret_type_arg_handle unverifiable "valuetype [mscorlib]System.RuntimeArgumentHandle"
4043
4044
4045
4046 #delegate compat tests P. II 14.6
4047 #TODO generic related testss
4048
4049 #for T in {}
4050 #./make_delegate_compat_test.sh valid
4051
4052
4053 #all types
4054 #int32 int64 "native int" float64 "valuetype MyValueType" "class ClassA" "int8\&" "int16\&" "int32\&" "int64\&" "native int\&" "float32\&" "float64\&" "valuetype MyValueType\&" "class ClassA\&" "int32*" "method int32 *(int32)" "method float32 *(int32)" "method int32 *(float64)" "method vararg int32 *(int32)"
4055 #verifiable
4056 #int32 int64 "native int" float64 "valuetype MyValueType" "class ClassA" "int8\&" "int16\&" "int32\&" "int64\&" "native int\&" "float32\&" "float64\&" "valuetype MyValueType\&" "class ClassA\&"
4057
4058 I=1
4059 for TYPE1 in int32 int64 "native int" float64 "valuetype MyValueType" "class ClassA" "int8\&" "int16\&" "int32\&" "int64\&" "native int\&" "float32\&" "float64\&" "valuetype MyValueType\&" "class ClassA\&"
4060 do
4061         ./make_delegate_compat_test.sh delegate_compat_basic_types_${I} valid int32 int32 "$TYPE1" "$TYPE1"
4062         I=`expr $I + 1`
4063 done
4064
4065 for TYPE1 in "int32*" "method int32 *(int32)" "method float32 *(int32)" "method int32 *(float64)" "method vararg int32 *(int32)"
4066 do
4067         ./make_delegate_compat_test.sh delegate_compat_basic_types_${I} unverifiable int32 int32 "$TYPE1" "$TYPE1"
4068         I=`expr $I + 1`
4069 done
4070
4071 #D is delegate and T is target method
4072 #arguments
4073 #3. D:=T if T is a base type or an interface implemented by D. D is not valuetype (primitive, pointers, etc)
4074
4075 ./make_delegate_compat_test.sh delegate_super_type_arg_1 valid int32 int32 string object
4076 ./make_delegate_compat_test.sh delegate_super_type_arg_2 valid int32 int32 ImplA InterfaceA
4077
4078 ./make_delegate_compat_test.sh delegate_super_type_arg_3 unverifiable int32 int32 object string
4079 ./make_delegate_compat_test.sh delegate_super_type_arg_4 unverifiable int32 int32 InterfaceA ImplA
4080
4081 ./make_delegate_compat_test.sh delegate_super_type_arg_5 unverifiable int32 int32 object int32
4082 ./make_delegate_compat_test.sh delegate_super_type_arg_6 unverifiable int32 int32 object "int32\&"
4083 ./make_delegate_compat_test.sh delegate_super_type_arg_7 unverifiable int32 int32 object "object\&"
4084
4085
4086 #primitive type size based conversion - don't work with delegates
4087 ./make_delegate_compat_test.sh delegate_primitive_arg_same_size_1 unverifiable int32 int32 "unsigned int32" int32
4088 ./make_delegate_compat_test.sh delegate_primitive_arg_same_size_2 unverifiable int32 int32 "native int" int32
4089
4090 ./make_delegate_compat_test.sh delegate_primitive_arg_same_size_3 unverifiable int32 int32 int32 "unsigned int32"
4091 ./make_delegate_compat_test.sh delegate_primitive_arg_same_size_4 unverifiable int32 int32 int32 "native int"
4092
4093 #value types
4094 ./make_delegate_compat_test.sh delegate_valuetype_arg_1 valid int32 int32 "valuetype MyValueType" "valuetype MyValueType"
4095 ./make_delegate_compat_test.sh delegate_valuetype_arg_2 unverifiable int32 int32 "valuetype MyValueType" int32
4096
4097
4098 #4. D:=T if both are interfaces and implementation D requires implementation of T (D is a supertype of T)
4099 ./make_delegate_compat_test.sh delegate_super_iface_arg_1 valid int32 int32 InterfaceB InterfaceA
4100 ./make_delegate_compat_test.sh delegate_super_iface_arg_2 unverifiable int32 int32 InterfaceA InterfaceB
4101
4102
4103 #5. D[]:=T[] if D:=T and are both vector or both have the same rank
4104 ./make_delegate_compat_test.sh delegate_array_arg_1 valid int32 int32 "int32[]" "int32[]"
4105 ./make_delegate_compat_test.sh delegate_array_arg_2 valid int32 int32 "string[]" "object[]"
4106
4107 ./make_delegate_compat_test.sh delegate_array_arg_3 unverifiable int32 int32 "object[]" "object[,]"
4108 ./make_delegate_compat_test.sh delegate_array_arg_4 unverifiable int32 int32 "object[,]" "object[]"
4109 ./make_delegate_compat_test.sh delegate_array_arg_5 unverifiable int32 int32 "object[]" "string[]"
4110
4111 #6. D:=T if both are method pointers and obey this rules for all args and params
4112 #TODO how can we cook a test that will be verifiable but use such types
4113 ./make_delegate_compat_test.sh delegate_method_ptr_arg_1 unverifiable int32 int32 "method int32 *(float64)" "method int32 *(float64)"
4114 #no way do say this is invalid
4115 ./make_delegate_compat_test.sh delegate_method_ptr_arg_2 unverifiable int32 int32 "method int32 *(float64)" "method int32 *(int32)"
4116 #and that is is valid
4117 ./make_delegate_compat_test.sh delegate_method_ptr_arg_2 unverifiable int32 int32 "method int32 *(string)" "method int32 *(object)"
4118
4119
4120 #TODO we don't perform proper type load verification
4121 #./make_delegate_compat_test.sh delegate_void_args invalid int32 int32 void void
4122
4123 ./make_delegate_compat_test.sh delegate_enum_args_1 unverifiable int32 int32 Int32Enum int32
4124 ./make_delegate_compat_test.sh delegate_enum_args_2 unverifiable int32 int32 int32 Int32Enum
4125
4126 #TODO check using native method
4127 ./make_delegate_compat_test.sh delegate_pointers_args_1 unverifiable int32 int32 "string*" "object*"
4128 ./make_delegate_compat_test.sh delegate_pointers_args_2 unverifiable int32 int32 "ImplA*" "InterfaceA*"
4129 ./make_delegate_compat_test.sh delegate_pointers_args_3 unverifiable int32 int32 "object*" "string*"
4130 ./make_delegate_compat_test.sh delegate_pointers_args_4 unverifiable int32 int32 "int32*" "int32*"
4131
4132
4133 #TODO: 7,8,9 generic related.
4134
4135 #call conv
4136 ./make_delegate_compat_test.sh delegate_bad_cconv_1 unverifiable int32 int32 int32 int32 "default" "vararg"
4137 ./make_delegate_compat_test.sh delegate_bad_cconv_2 unverifiable int32 int32 int32 int32 "vararg" "     "
4138
4139 #return type
4140
4141 #3. D:=T if D is a basetype or implemented interface of T and T is not a valuetype
4142
4143 ./make_delegate_compat_test.sh delegate_super_type_ret_1 valid object string int32 int32
4144 ./make_delegate_compat_test.sh delegate_super_type_ret_2 valid InterfaceA ImplA int32 int32
4145
4146 ./make_delegate_compat_test.sh delegate_super_type_ret_3 unverifiable string object int32 int32
4147 ./make_delegate_compat_test.sh delegate_super_type_ret_4 unverifiable ImplA InterfaceA int32 int32
4148
4149 ./make_delegate_compat_test.sh delegate_super_type_ret_5 unverifiable object int32 int32 int32
4150 ./make_delegate_compat_test.sh delegate_super_type_ret_6 unverifiable object "int32\&" int32 int32
4151 ./make_delegate_compat_test.sh delegate_super_type_ret_7 unverifiable object "object\&" int32 int32
4152
4153
4154 #primitive type size based conversion - don't work with delegates
4155 ./make_delegate_compat_test.sh delegate_primitive_ret_same_size_1 unverifiable "unsigned int32" int32 int32 int32
4156 ./make_delegate_compat_test.sh delegate_primitive_ret_same_size_2 unverifiable "native int" int32 int32 int32
4157
4158 ./make_delegate_compat_test.sh delegate_primitive_ret_same_size_3 unverifiable int32 "unsigned int32" int32 int32
4159 ./make_delegate_compat_test.sh delegate_primitive_ret_same_size_4 unverifiable int32 "native int" int32 int32
4160
4161 #value types
4162 ./make_delegate_compat_test.sh delegate_valuetype_ret_1 valid "valuetype MyValueType" "valuetype MyValueType" int32 int32
4163 ./make_delegate_compat_test.sh delegate_valuetype_ret_2 unverifiable "valuetype MyValueType" int32 int32 int32
4164 ./make_delegate_compat_test.sh delegate_valuetype_ret_2 unverifiable int32 "valuetype MyValueType" int32 int32
4165
4166
4167 #4. D:=T if both are interfaces and implementation T requires implementation of D (T is a supertype of D)
4168 ./make_delegate_compat_test.sh delegate_super_iface_arg_1 valid InterfaceA InterfaceB int32 int32
4169 ./make_delegate_compat_test.sh delegate_super_iface_arg_2 valid InterfaceA InterfaceA int32 int32
4170 ./make_delegate_compat_test.sh delegate_super_iface_arg_3 unverifiable InterfaceB InterfaceA int32 int32
4171
4172
4173 #5. D[]:=T[] if D:=T and are both vector or both have the same rank
4174 ./make_delegate_compat_test.sh delegate_array_ret_1 valid "int32[]" "int32[]" int32 int32
4175 ./make_delegate_compat_test.sh delegate_array_ret_2 valid "object[]" "string[]" int32 int32
4176
4177 ./make_delegate_compat_test.sh delegate_array_ret_3 unverifiable "object[]" "object[,]" int32 int32
4178 ./make_delegate_compat_test.sh delegate_array_ret_4 unverifiable "object[,]" "object[]" int32 int32
4179 ./make_delegate_compat_test.sh delegate_array_ret_5 unverifiable "string[]" "object[]" int32 int32
4180
4181 #6. D:=T if both are method pointers and obey this rules for all args and params
4182 #TODO how can we cook a test that will be verifiable but use such types
4183 ./make_delegate_compat_test.sh delegate_method_ptr_arg_1 unverifiable "method int32 *(float64)" "method int32 *(float64)" int32 int32
4184 #no way do say this is invalid
4185 ./make_delegate_compat_test.sh delegate_method_ptr_arg_2 unverifiable "method int32 *(float64)" "method int32 *(int32)" int32 int32
4186 #and that is is valid
4187 ./make_delegate_compat_test.sh delegate_method_ptr_arg_2 unverifiable "method int32 *(object)" "method int32 *(string)" int32 int32
4188
4189 #TODO: 7,8,9 generic related.
4190
4191
4192 ./make_delegate_compat_test.sh delegate_void_ret valid void void int32 int32
4193
4194 ./make_delegate_compat_test.sh delegate_enum_ret_1 unverifiable int32 int32 Int32Enum int32
4195 ./make_delegate_compat_test.sh delegate_enum_ret_2 unverifiable int32 int32 int32 Int32Enum
4196
4197 ./make_delegate_compat_test.sh delegate_pointers_ret_1 unverifiable "object*" "string*" int32 int32
4198 ./make_delegate_compat_test.sh delegate_pointers_ret_2 unverifiable "InterfaceA*" "ImplA*" int32 int32
4199 ./make_delegate_compat_test.sh delegate_pointers_ret_3 unverifiable "string*" "object*" int32 int32 
4200 ./make_delegate_compat_test.sh delegate_pointers_ret_4 unverifiable  "int32*" "int32*" int32 int32
4201
4202
4203 #pointer tests using native method and not invoking
4204 ./make_delegate_compat_test.sh delegate_method_ptr_pinvoke_arg_1 valid int32 int32 "method int32 *(float64)" "method int32 *(float64)" "" "" "pinvoke"
4205 #no way do say this is invalid
4206 ./make_delegate_compat_test.sh delegate_method_ptr_pinvoke_arg_2 unverifiable int32 int32 "method int32 *(float64)" "method int32 *(int32)" "" "" "pinvoke"
4207
4208
4209 #constrained prefix
4210
4211 #good type tests
4212 I=1
4213 for TYPE in object string MyValueType
4214 do
4215         ./make_constrained_test.sh contrained_prefix_basic_types_$I valid "$TYPE" "$TYPE" "callvirt string object::ToString()"
4216         I=`expr $I + 1`
4217 done
4218
4219 #method that exist on the value type
4220 ./make_constrained_test.sh contrained_prefix_basic_types_$I valid "MyValueType" "MyValueType" "callvirt int32 object::GetHashCode()"
4221
4222
4223 #mismatch between constrained. type token and this argument
4224 ./make_constrained_test.sh contrained_prefix_type_mismatch_1 unverifiable "object" "string" "callvirt instance int32 object::GetHashCode()"
4225 ./make_constrained_test.sh contrained_prefix_type_mismatch_2 unverifiable "string" "object" "callvirt instance int32 object::GetHashCode()"
4226
4227 ./make_constrained_test.sh contrained_prefix_type_mismatch_3 unverifiable "object" "MyValueType" "callvirt instance int32 object::GetHashCode()"
4228 ./make_constrained_test.sh contrained_prefix_type_mismatch_4 unverifiable "MyValueType" "object" "callvirt instance int32 object::GetHashCode()"
4229
4230 #bad contrained token
4231 ./make_constrained_test.sh contrained_prefix_bad_token_1 unverifiable "object" "object&" "callvirt instance int32 object::GetHashCode()"
4232 ./make_constrained_test.sh contrained_prefix_bad_token_1 unverifiable "object*" "object*" "callvirt instance int32 object::GetHashCode()"
4233
4234 #contrained no before a callvirt
4235 ./make_constrained_test.sh contrained_prefix_not_before_a_callvirt invalid "string" "string" "call instance string string::Trim()"
4236
4237 #wrong stack type
4238
4239 ./make_constrained_test.sh contrained_prefix_bad_stack_type_1 unverifiable "object" "object" "callvirt instance int32 object::GetHashCode()" "ldloc.0"
4240 ./make_constrained_test.sh contrained_prefix_bad_stack_type_2 unverifiable "object" "object" "callvirt instance int32 object::GetHashCode()" "ldnull"
4241 ./make_constrained_test.sh contrained_prefix_bad_stack_type_3 unverifiable "object" "object" "callvirt instance int32 object::GetHashCode()" "ldc.i4.0"
4242
4243
4244
4245 #cmmp support
4246 #ldind.x tests
4247 I=1
4248 for TYPE in "ldind.i1 int8" "ldind.u1 int8" "ldind.i2 int16" "ldind.u2 int16" "ldind.i4 int32" "ldind.u4 int32" "ldind.i8 int64" "ldind.u8 int64" "ldind.i native int" "ldind.r4 float32" "ldind.r8 float64"
4249 do
4250         LOAD=`echo $TYPE | cut -d' ' -f 1` 
4251         TYPE=`echo $TYPE | cut -d' ' -f 2-` 
4252         ./make_cmmp_test.sh cmmp_basic_test_ro_$I valid "readonly. ldelema $TYPE" "$LOAD" "$TYPE"
4253         ./make_cmmp_test.sh cmmp_basic_test_ub_$I valid "unbox $TYPE" "$LOAD" "$TYPE"
4254         I=`expr $I + 1`
4255 done
4256
4257 #unbox is only for value types, so cannot be paired with ldind.ref
4258 ./make_cmmp_test.sh cmmp_basic_test_ro_$I valid "readonly. ldelema object" "ldind.ref" "object"
4259
4260 ./make_cmmp_test.sh cmmp_basic_test_ro_ldobj valid "readonly. ldelema int32" "ldobj int32" "int32"
4261 ./make_cmmp_test.sh cmmp_basic_test_ub_ldobj valid "unbox int32" "ldobj int32" "int32"
4262
4263 ./make_cmmp_test.sh cmmp_basic_test_ro_ldfld valid "readonly. ldelema valuetype MyStruct" "ldfld int32 MyStruct::foo" "valuetype MyStruct"
4264 ./make_cmmp_test.sh cmmp_basic_test_ub_ldfld valid "unbox valuetype MyStruct" "ldfld int32 MyStruct::foo" "valuetype MyStruct "
4265
4266 ./make_cmmp_test.sh cmmp_basic_test_ro_ldflda valid "readonly. ldelema valuetype MyStruct" "ldflda int32 MyStruct::foo" "valuetype MyStruct"
4267 ./make_cmmp_test.sh cmmp_basic_test_ub_ldflda valid "unbox valuetype MyStruct" "ldflda int32 MyStruct::foo" "valuetype MyStruct "
4268
4269 #as the object parameter of callvirt, constrained. callvirt
4270 #ldobj
4271
4272 ./make_cmmp_test.sh cmmp_basic_test_ro_stfld_ptr valid "readonly. ldelema valuetype MyStruct" "ldc.i4.0\n\tstfld int32 MyStruct::foo" "valuetype MyStruct"
4273 ./make_cmmp_test.sh cmmp_basic_test_ub_stfld_ptr valid "unbox valuetype MyStruct" "ldc.i4.0\n\tstfld int32 MyStruct::foo" "valuetype MyStruct "
4274
4275 #testing for second argument in stfld is pointless as fields cannot be a byref type
4276
4277 #can be the this ptr for call
4278 ./make_cmmp_test.sh cmmp_basic_test_ro_call_this valid "readonly. ldelema int32" "ldc.i4.0\n\tcall instance int32 int32::CompareTo(int32)" "int32"
4279 ./make_cmmp_test.sh cmmp_basic_test_ub_call_this valid "unbox int32" "ldc.i4.0\n\tcall instance int32 int32::CompareTo(int32)" "int32"
4280
4281
4282 #cannot be parameter
4283 ./make_cmmp_test.sh cmmp_basic_test_ro_call_arg unverifiable "readonly. ldelema valuetype MyStruct" "call void MyStruct::Test(MyStruct\&)" "valuetype MyStruct"
4284 ./make_cmmp_test.sh cmmp_basic_test_ub_call_arg unverifiable "unbox valuetype MyStruct" "call void MyStruct::Test(MyStruct\&)" "valuetype MyStruct"
4285
4286
4287 #FIXME it's not possible to use a managed pointer with an unconstrained callvirt
4288
4289 #constrained. callvirt
4290 ./make_cmmp_test.sh cmmp_basic_test_ro_callvirt_this valid "readonly. ldelema int32" "constrained. int32 callvirt instance int32 object::GetHashCode()" "int32"
4291 ./make_cmmp_test.sh cmmp_basic_test_ub_callvirt_this valid "unbox int32" "constrained. int32 callvirt instance int32 object::GetHashCode()" "int32"
4292
4293
4294 #constrained. callvirt as parameter
4295 ./make_cmmp_test.sh cmmp_basic_test_ro_callvirt_arg unverifiable "readonly. ldelema ClassA" "dup\n\tconstrained. ClassA callvirt instance void ClassA::VirtTest(ClassA\&)" "ClassA"
4296
4297
4298 #invalid instructions with cmmp argument
4299 #test, at least, stobj, cpobj, stind, initobj, mkrefany, newobj, ceq
4300
4301 #stind.x
4302 I=1
4303 for TYPE in "stind.i1 int8" "stind.i2 int16" "stind.i4 int32" "stind.i8 int64" "stind.r4 float32" "stind.r8 float64" "stind.i native int"
4304 do
4305         STORE=`echo $TYPE | cut -d' ' -f 1` 
4306         TYPE=`echo $TYPE | cut -d' ' -f 2-` 
4307         ./make_cmmp_test.sh cmmp_bad_ops_test_ro_$I unverifiable "readonly. ldelema $TYPE" "ldloc.0\n\t$STORE" "$TYPE"
4308         ./make_cmmp_test.sh cmmp_bad_ops_test_ub_$I unverifiable "unbox $TYPE" "ldloc.0\n\t$STORE" "$TYPE"
4309         I=`expr $I + 1`
4310 done
4311
4312 #unbox is only for value types, so cannot be paired with ldind.ref
4313 ./make_cmmp_test.sh cmmp_bad_ops_test_ro_$I unverifiable "readonly. ldelema object" "ldloc.0\n\tstind.ref" "object"
4314
4315
4316 ./make_cmmp_test.sh cmmp_stobj_test_ro unverifiable "readonly. ldelema int32" "ldloc.0\n\tstobj int32" "int32"
4317 ./make_cmmp_test.sh cmmp_stobj_test_ub unverifiable "unbox int32" "ldloc.0\n\tstobj int32" "int32"
4318
4319 ./make_cmmp_test.sh cmmp_cpobj_src_ro valid "readonly. ldelema int32" "cpobj int32" "int32" "ldloca 0"
4320 ./make_cmmp_test.sh cmmp_cpobj_src_ub valid "unbox int32" "cpobj int32" "int32" "ldloca 0"
4321
4322 ./make_cmmp_test.sh cmmp_cpobj_dst_ro unverifiable "readonly. ldelema int32" "ldloca 0\n\tcpobj int32" "int32"
4323 ./make_cmmp_test.sh cmmp_cpobj_dst_ub unverifiable "unbox int32" "ldloca 0\n\tcpobj int32" "int32"
4324
4325 ./make_cmmp_test.sh cmmp_initobj_test_ro unverifiable "readonly. ldelema int32" "initobj int32" "int32"
4326 ./make_cmmp_test.sh cmmp_initobj_test_ub unverifiable "unbox int32" "initobj int32" "int32"
4327
4328 ./make_cmmp_test.sh cmmp_mkrefany_test_ro unverifiable "readonly. ldelema int32" "mkrefany int32" "int32"
4329 ./make_cmmp_test.sh cmmp_mkrefany_test_ub unverifiable "unbox int32" "mkrefany int32" "int32"
4330
4331 ./make_cmmp_test.sh cmmp_newobj_test_ro unverifiable "readonly. ldelema int32" "newobj instance void class ClassA::.ctor(int32\&)" "int32"
4332 ./make_cmmp_test.sh cmmp_newobj_test_ub unverifiable "unbox int32" "newobj instance void class ClassA::.ctor(int32\&)" "int32"
4333
4334 ./make_cmmp_test.sh cmmp_ceq_test_ro valid "readonly. ldelema int32" "dup\n\tceq" "int32"
4335 ./make_cmmp_test.sh cmmp_ceq_test_ub valid "unbox int32" "dup\n\tceq" "int32"
4336
4337 ./make_cmmp_test.sh cmmp_basic_test_address_method_1 valid "ldc.i4.1\n\tldc.i4.1\n\tnewobj instance void int32[,]::.ctor(int32, int32)\n\tldc.i4.0\n\tldc.i4.0\n\tcall instance int32\&  int32[,]::Address(int32, int32)" "ldloc.0\n\tstind.i4" "int32"
4338
4339 ./make_cmmp_test.sh cmmp_basic_test_address_method_2 unverifiable "ldc.i4.1\n\tldc.i4.1\n\tnewobj instance void int32[,]::.ctor(int32, int32)\n\tldc.i4.0\n\tldc.i4.0\n\treadonly. call instance int32\&  int32[,]::Address(int32, int32)" "ldloc.0\n\tstind.i4" "int32"
4340
4341
4342 #readonly before an invalid instruction
4343 ./make_cmmp_test.sh readonly_before_invalid_instruction_1 invalid "readonly. ldelem int32" "nop" "int32"
4344 ./make_cmmp_test.sh readonly_before_invalid_instruction_2 invalid "ldstr \"tst\"\n\treadonly. call string int32::Parse(string)" "nop" "int32"
4345
4346
4347
4348 #type constraint verification
4349 #see PII 10.1.7 for details
4350
4351 #TODO test usage of open types
4352 #TODO test recursive types
4353
4354 I=1
4355 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"
4356 do
4357         ./make_type_constraint_test.sh type_constraint_no_ct_$I valid "$TYPE" ""
4358         ./make_type_constraint_test.sh type_constraint_object_ct_$I valid "$TYPE" "(class [mscorlib]System.Object)"
4359         I=`expr $I + 1`
4360 done
4361
4362
4363 I=1
4364 for TYPE in object ClassNoDefaultCtor AbstractClass ClassWithDefaultCtorNotVisible ClassWithDefaultCtor "[mscorlib]System.ValueType" "[mscorlib]System.Enum" IFace IFaceImpl
4365 do
4366         ./make_type_constraint_test.sh type_constraint_class_ct_$I valid "$TYPE" "class "
4367         ./make_type_constraint_test.sh type_constraint_class_object_ct_$I valid "$TYPE" "class (class [mscorlib]System.Object)"
4368         I=`expr $I + 1`
4369 done
4370
4371 for TYPE in "valuetype MyValueType" "valuetype [mscorlib]System.Nullable\`1<valuetype MyValueType>" "valuetype MyEnum"
4372 do
4373         ./make_type_constraint_test.sh type_constraint_class_ct_$I invalid "$TYPE" "class "
4374         ./make_type_constraint_test.sh type_constraint_class_object_ct_$I invalid "$TYPE" "class (class [mscorlib]System.Object)"
4375         I=`expr $I + 1`
4376 done
4377
4378
4379 I=1
4380 for TYPE in object AbstractClass ClassWithDefaultCtor IFaceImpl
4381 do
4382         ./make_type_constraint_test.sh type_constraint_class_ctor_ct_$I valid "$TYPE" "class .ctor"
4383         ./make_type_constraint_test.sh type_constraint_class_ctor_object_ct_$I valid "$TYPE" "class .ctor(class [mscorlib]System.Object)"
4384         I=`expr $I + 1`
4385 done
4386
4387 for TYPE in ClassNoDefaultCtor ClassWithDefaultCtorNotVisible "valuetype MyValueType" "valuetype [mscorlib]System.Nullable\`1<valuetype MyValueType>" "[mscorlib]System.ValueType" "[mscorlib]System.Enum" IFace "valuetype MyEnum"
4388 do
4389         ./make_type_constraint_test.sh type_constraint_class_ctor_ct_$I invalid "$TYPE" "class .ctor"
4390         ./make_type_constraint_test.sh type_constraint_class_ctor_object_ct_$I invalid "$TYPE" "class .ctor(class [mscorlib]System.Object)"
4391         I=`expr $I + 1`
4392 done
4393
4394
4395 I=1
4396 for TYPE in object ClassNoDefaultCtor AbstractClass ClassWithDefaultCtorNotVisible ClassWithDefaultCtor "valuetype [mscorlib]System.Nullable\`1<valuetype MyValueType>" "[mscorlib]System.ValueType" "[mscorlib]System.Enum" IFace IFaceImpl
4397 do
4398         ./make_type_constraint_test.sh type_constraint_vt_ct_$I invalid "$TYPE" "valuetype"
4399         ./make_type_constraint_test.sh type_constraint_vt_object_ct_$I invalid "$TYPE" "valuetype(class [mscorlib]System.Object)"
4400         I=`expr $I + 1`
4401 done
4402
4403 for TYPE in "valuetype MyValueType" "valuetype MyEnum"
4404 do
4405         ./make_type_constraint_test.sh type_constraint_vt_ct_$I valid "$TYPE" "valuetype"
4406         ./make_type_constraint_test.sh type_constraint_vt_object_ct_$I valid "$TYPE" "valuetype(class [mscorlib]System.Object)"
4407         I=`expr $I + 1`
4408 done
4409
4410
4411 I=1
4412 for TYPE in object ClassNoDefaultCtor AbstractClass ClassWithDefaultCtorNotVisible ClassWithDefaultCtor "valuetype [mscorlib]System.Nullable\`1<valuetype MyValueType>" "[mscorlib]System.ValueType" "[mscorlib]System.Enum" IFace IFaceImpl
4413 do
4414         ./make_type_constraint_test.sh type_constraint_vt_ctor_ct_$I invalid "$TYPE"  "valuetype .ctor"
4415         ./make_type_constraint_test.sh type_constraint_vt_ctor_object_ct_$I invalid "$TYPE"  "valuetype .ctor(class [mscorlib]System.Object)"
4416         I=`expr $I + 1`
4417 done
4418
4419 for TYPE in "valuetype MyValueType" "valuetype MyEnum"
4420 do
4421         ./make_type_constraint_test.sh type_constraint_vt_ctor_ct_$I valid "$TYPE"  "valuetype .ctor"
4422         ./make_type_constraint_test.sh type_constraint_vt_ctor_object_ct_$I valid "$TYPE"  "valuetype .ctor(class [mscorlib]System.Object)"
4423         I=`expr $I + 1`
4424 done
4425
4426
4427 I=1
4428 for TYPE in object AbstractClass ClassWithDefaultCtor "valuetype MyValueType" "valuetype [mscorlib]System.Nullable\`1<valuetype MyValueType>" IFaceImpl "valuetype MyEnum"
4429 do
4430         ./make_type_constraint_test.sh type_constraint_ctor_ct_$I valid "$TYPE" ".ctor"
4431         ./make_type_constraint_test.sh type_constraint_ctor_object_ct_$I valid "$TYPE" ".ctor(class [mscorlib]System.Object)"
4432         I=`expr $I + 1`
4433 done
4434
4435 for TYPE in ClassNoDefaultCtor ClassWithDefaultCtorNotVisible "[mscorlib]System.ValueType" "[mscorlib]System.Enum" IFace
4436 do
4437         ./make_type_constraint_test.sh type_constraint_ctor_ct_$I invalid "$TYPE" ".ctor"
4438         ./make_type_constraint_test.sh type_constraint_ctor_object_ct_$I invalid "$TYPE" ".ctor(class [mscorlib]System.Object)"
4439         I=`expr $I + 1`
4440 done
4441
4442
4443 I=1
4444 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"
4445 do
4446         ./make_type_constraint_test.sh type_constraint_class_vt_ct_$I invalid "$TYPE" "class valuetype"
4447         ./make_type_constraint_test.sh type_constraint_class_vt_object_ct_$I invalid "$TYPE" "class valuetype(class [mscorlib]System.Object)"
4448         I=`expr $I + 1`
4449 done
4450
4451 I=1
4452 for TYPE in ClassNoDefaultCtor AbstractClass ClassWithDefaultCtorNotVisible "[mscorlib]System.ValueType" "[mscorlib]System.Enum" IFace
4453 do
4454         ./make_type_constraint_test.sh type_constraint_class_vt_ctor_ct_$I invalid "$TYPE" "class valuetype .ctor"
4455         ./make_type_constraint_test.sh type_constraint_class_vt_ctor_object_ct_$I invalid "$TYPE" "class valuetype .ctor(class [mscorlib]System.Object)"
4456         I=`expr $I + 1`
4457 done
4458
4459
4460
4461 I=1
4462 for TYPE in "valuetype MyValueType" "valuetype [mscorlib]System.Nullable\`1<valuetype MyValueType>" "valuetype MyEnum"
4463 do
4464         ./make_type_constraint_test.sh type_constraint_system_valuetype_ctor_ct_$I valid "$TYPE" ".ctor (class [mscorlib]System.ValueType)"
4465         I=`expr $I + 1`
4466 done
4467
4468 for TYPE in object ClassNoDefaultCtor AbstractClass ClassWithDefaultCtorNotVisible ClassWithDefaultCtor "[mscorlib]System.ValueType" "[mscorlib]System.Enum" IFace IFaceImpl
4469 do
4470         ./make_type_constraint_test.sh type_constraint_system_valuetype_ctor_ct_$I invalid "$TYPE" ".ctor (class [mscorlib]System.ValueType)"
4471         I=`expr $I + 1`
4472 done
4473
4474
4475 I=1
4476 for TYPE in "valuetype MyValueType" "valuetype MyEnum"
4477 do
4478         ./make_type_constraint_test.sh type_constraint_system_valuetype_vt_ct_$I valid "$TYPE" "valuetype(class [mscorlib]System.ValueType)"
4479         I=`expr $I + 1`
4480 done
4481
4482 for TYPE in object ClassNoDefaultCtor AbstractClass ClassWithDefaultCtorNotVisible ClassWithDefaultCtor  "valuetype [mscorlib]System.Nullable\`1<valuetype MyValueType>" "[mscorlib]System.ValueType" "[mscorlib]System.Enum" IFace IFaceImpl
4483 do
4484         ./make_type_constraint_test.sh type_constraint_system_valuetype_vt_ct_$I invalid "$TYPE" "valuetype(class [mscorlib]System.ValueType)"
4485         I=`expr $I + 1`
4486 done
4487
4488
4489 I=1
4490 for TYPE in "valuetype MyValueType" "valuetype MyEnum"
4491 do
4492         ./make_type_constraint_test.sh type_constraint_system_valuetype_vt_ctor_ct_$I valid "$TYPE" "valuetype .ctor(class [mscorlib]System.ValueType)"
4493         I=`expr $I + 1`
4494 done
4495
4496 for TYPE in object ClassNoDefaultCtor AbstractClass ClassWithDefaultCtorNotVisible ClassWithDefaultCtor "valuetype [mscorlib]System.Nullable\`1<valuetype MyValueType>" "[mscorlib]System.ValueType" "[mscorlib]System.Enum" IFace IFaceImpl
4497 do
4498         ./make_type_constraint_test.sh type_constraint_system_valuetype_vt_ctor_ct_$I invalid "$TYPE" "valuetype .ctor(class [mscorlib]System.ValueType)"
4499         I=`expr $I + 1`
4500 done
4501
4502
4503 I=1
4504 for TYPE in "valuetype MyValueType" "valuetype [mscorlib]System.Nullable\`1<valuetype MyValueType>" "[mscorlib]System.ValueType" "[mscorlib]System.Enum"  "valuetype MyEnum"
4505 do
4506         ./make_type_constraint_test.sh type_constraint_system_valuetype_ct_$I valid "$TYPE" "(class [mscorlib]System.ValueType)"
4507         I=`expr $I + 1`
4508 done
4509
4510 for TYPE in object ClassNoDefaultCtor AbstractClass ClassWithDefaultCtorNotVisible ClassWithDefaultCtor IFace IFaceImpl
4511 do
4512         ./make_type_constraint_test.sh type_constraint_system_valuetype_ct_$I invalid "$TYPE" "(class [mscorlib]System.ValueType)"
4513         I=`expr $I + 1`
4514 done
4515
4516
4517 I=1
4518 for TYPE in object ClassNoDefaultCtor AbstractClass ClassWithDefaultCtorNotVisible ClassWithDefaultCtor "valuetype MyValueType" "valuetype [mscorlib]System.Nullable\`1<valuetype MyValueType>" IFace IFaceImpl "valuetype MyEnum"
4519 do
4520         ./make_type_constraint_test.sh type_constraint_system_valuetype_class_ct_$I invalid "$TYPE" "class (class [mscorlib]System.ValueType)"
4521         I=`expr $I + 1`
4522 done
4523
4524 for TYPE in "[mscorlib]System.ValueType" "[mscorlib]System.Enum"
4525 do
4526         ./make_type_constraint_test.sh type_constraint_system_valuetype_class_ct_$I valid "$TYPE" "class (class [mscorlib]System.ValueType)"
4527         I=`expr $I + 1`
4528 done
4529
4530
4531 I=1
4532 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"
4533 do
4534         ./make_type_constraint_test.sh type_constraint_system_valuetype_class_ctor_ct_$I invalid "$TYPE" "class .ctor(class [mscorlib]System.ValueType)"
4535         I=`expr $I + 1`
4536 done
4537
4538
4539
4540 I=1
4541 for TYPE in "valuetype MyEnum"
4542 do
4543         ./make_type_constraint_test.sh type_constraint_system_enum_ctor_ct_$I valid "$TYPE" ".ctor (class [mscorlib]System.Enum)"
4544         ./make_type_constraint_test.sh type_constraint_system_enum_vt_ct_$I valid "$TYPE" "valuetype (class [mscorlib]System.Enum)"
4545         ./make_type_constraint_test.sh type_constraint_system_enum_vt_ctor_ct_$I valid "$TYPE" "valuetype .ctor(class [mscorlib]System.Enum)"
4546         I=`expr $I + 1`
4547 done
4548
4549 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 
4550 do
4551         ./make_type_constraint_test.sh type_constraint_system_enum_ctor_ct_$I invalid "$TYPE" ".ctor (class [mscorlib]System.Enum)"
4552         ./make_type_constraint_test.sh type_constraint_system_enum_vt_ct_$I invalid "$TYPE" "valuetype (class [mscorlib]System.Enum)"
4553         ./make_type_constraint_test.sh type_constraint_system_enum_vt_ctor_ct_$I invalid "$TYPE" "valuetype .ctor(class [mscorlib]System.Enum)"
4554         I=`expr $I + 1`
4555 done
4556
4557
4558 I=1
4559 for TYPE in "[mscorlib]System.Enum" "valuetype MyEnum"
4560 do
4561         ./make_type_constraint_test.sh type_constraint_system_enum_ct_$I valid "$TYPE" "(class [mscorlib]System.Enum)"
4562         I=`expr $I + 1`
4563 done
4564
4565 for TYPE in object ClassNoDefaultCtor AbstractClass ClassWithDefaultCtorNotVisible ClassWithDefaultCtor "valuetype MyValueType" "valuetype [mscorlib]System.Nullable\`1<valuetype MyValueType>" "[mscorlib]System.ValueType" IFace IFaceImpl
4566 do
4567         ./make_type_constraint_test.sh type_constraint_system_enum_ct_$I invalid "$TYPE" "(class [mscorlib]System.Enum)"
4568         I=`expr $I + 1`
4569 done
4570
4571
4572 I=1
4573 for TYPE in "[mscorlib]System.Enum"
4574 do
4575         ./make_type_constraint_test.sh type_constraint_system_enum_class_ct_$I valid "$TYPE" "class (class [mscorlib]System.Enum)"
4576         I=`expr $I + 1`
4577 done
4578
4579 for TYPE in object ClassNoDefaultCtor AbstractClass ClassWithDefaultCtorNotVisible ClassWithDefaultCtor "valuetype MyValueType" "valuetype [mscorlib]System.Nullable\`1<valuetype MyValueType>" "[mscorlib]System.ValueType" IFace IFaceImpl "valuetype MyEnum"
4580 do
4581         ./make_type_constraint_test.sh type_constraint_system_enum_class_ct_$I invalid "$TYPE" "class (class [mscorlib]System.Enum)"
4582         I=`expr $I + 1`
4583 done
4584
4585
4586 I=1
4587 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"
4588 do
4589         ./make_type_constraint_test.sh type_constraint_system_enum_class_ctor_ct_$I invalid "$TYPE" "class .ctor(class [mscorlib]System.Enum)"
4590         I=`expr $I + 1`
4591 done
4592
4593
4594 I=1
4595 for TYPE in IFace IFaceImpl
4596 do
4597         ./make_type_constraint_test.sh type_constraint_iface_ct_$I valid "$TYPE" "(IFace)"
4598         I=`expr $I + 1`
4599 done
4600
4601 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"
4602 do
4603         ./make_type_constraint_test.sh type_constraint_iface_ct_$I invalid "$TYPE" "(IFace)"
4604         I=`expr $I + 1`
4605 done
4606
4607 #misc tests
4608 ./make_type_constraint_test.sh type_constraint_nested_class invalid "class TemplateTarget<valuetype MyValueType>" "class"
4609
4610
4611 #prefixes volatile. and unaligned
4612
4613 #stind.x
4614 I=1
4615 for TYPE in "stind.i1 int8" "stind.i2 int16" "stind.i4 int32" "stind.i8 int64" "stind.r4 float32" "stind.r8 float64" "stind.i native int"
4616 do
4617         STORE=`echo $TYPE | cut -d' ' -f 1` 
4618         TYPE=`echo $TYPE | cut -d' ' -f 2-` 
4619         ./make_prefix_test.sh "prefix_test_stind_volatile_$I" valid "volatile. $STORE" "ldloca 0\n\tldloc.0" "$TYPE"
4620         ./make_prefix_test.sh "prefix_test_stind_unaligned_$I" valid  "unaligned. 1 $STORE" "ldloca 0\n\tldloc.0" "$TYPE"
4621         I=`expr $I + 1`
4622 done
4623
4624 ./make_prefix_test.sh "prefix_test_stind_volatile_$I" valid "volatile. stind.ref" "ldloca 0\n\tldnull" "object"
4625 ./make_prefix_test.sh "prefix_test_stind_unaligned_$I" valid  "unaligned. 1 stind.ref" "ldloca 0\n\tldnull" "object"
4626
4627
4628 #ldind.x
4629 I=1
4630 for TYPE in "ldind.i1 int8" "ldind.u1 unsigned int8" "ldind.i2 int16" "ldind.u2 unsigned int16" "ldind.i4 int32" "ldind.u4 unsigned int32" "ldind.i8 int64" "ldind.u8 unsigned int64" "ldind.r4 float32" "ldind.r8 float64" "ldind.i native int"
4631 do
4632         STORE=`echo $TYPE | cut -d' ' -f 1` 
4633         TYPE=`echo $TYPE | cut -d' ' -f 2-` 
4634         ./make_prefix_test.sh "prefix_test_ldind_volatile_$I" valid "volatile. $STORE" "ldloca 0" "$TYPE"
4635         ./make_prefix_test.sh "prefix_test_ldind_unaligned_$I" valid  "unaligned. 1 $STORE" "ldloca 0" "$TYPE"
4636         I=`expr $I + 1`
4637 done
4638
4639 ./make_prefix_test.sh "prefix_test_ldind_volatilee_$I" valid "volatile. ldind.ref" "ldloca 0" "object"
4640 ./make_prefix_test.sh "prefix_test_ldind_unalignede_$I" valid  "unaligned. 1 ldind.ref" "ldloca 0" "object"
4641
4642
4643 ./make_prefix_test.sh "prefix_test_ldfld_volatile" valid "volatile. ldfld int32 MyStruct::foo" "ldloca 0" "MyStruct"
4644 ./make_prefix_test.sh "prefix_test_ldfld_unaligned" valid  "unaligned. 1 ldfld int32 MyStruct::foo " "ldloca 0" "MyStruct"
4645
4646
4647 ./make_prefix_test.sh "prefix_test_stfld_volatile" valid "volatile. stfld int32 MyStruct::foo" "ldloca 0\n\tldc.i4.0" "MyStruct"
4648 ./make_prefix_test.sh "prefix_test_stfld_unaligned" valid  "unaligned. 1 stfld int32 MyStruct::foo" "ldloca 0\n\tldc.i4.0" "MyStruct"
4649
4650 ./make_prefix_test.sh "prefix_test_ldobj_volatile" valid "volatile. ldobj MyStruct" "ldloca 0" "MyStruct"
4651 ./make_prefix_test.sh "prefix_test_ldobj_unaligned" valid  "unaligned. 1 ldobj MyStruct" "ldloca 0" "MyStruct"
4652
4653 ./make_prefix_test.sh "prefix_test_stobj_volatile" valid "volatile. stobj MyStruct" "ldloca 0\n\tldloc.0" "MyStruct"
4654 ./make_prefix_test.sh "prefix_test_stobj_unaligned" valid  "unaligned. 1 stobj MyStruct" "ldloca 0\n\tldloc.0" "MyStruct"
4655
4656 ./make_prefix_test.sh "prefix_test_cpblk_volatile" unverifiable "volatile. cpblk" "ldloca 0\n\tldloca 0\n\tldc.i4.1" "MyStruct"
4657 ./make_prefix_test.sh "prefix_test_cpblk_unaligned" unverifiable  "unaligned. 1 cpblk" "ldloca 0\n\tldloca 0\n\tldc.i4.1" "MyStruct"
4658
4659 ./make_prefix_test.sh "prefix_test_initblk_volatile" unverifiable "volatile. initblk" "ldloca 0\n\tldc.i4.0\n\tldc.i4.1" "MyStruct"
4660 ./make_prefix_test.sh "prefix_test_initblk_unaligned" unverifiable  "unaligned. 1 initblk" "ldloca 0\n\tldc.i4.0\n\tldc.i4.1" "MyStruct"
4661
4662 ./make_prefix_test.sh "prefix_test_stsfld_volatile" valid "volatile. stsfld int32 MyStruct::stFoo" "ldc.i4.0" "MyStruct"
4663 ./make_prefix_test.sh "prefix_test_stsfld_unaligned" invalid  "unaligned. 1 stsfld int32 MyStruct::stFoo" "ldc.i4.0" "MyStruct"
4664
4665 ./make_prefix_test.sh "prefix_test_ldsfld_volatile" valid "volatile. ldsfld int32 MyStruct::stFoo" "" "MyStruct"
4666 ./make_prefix_test.sh "prefix_test_ldsfld_unaligned" invalid  "unaligned. 1 ldsfld int32 MyStruct::stFoo" "" "MyStruct"
4667
4668
4669 I=1
4670 for TYPE in "nop" "new object::.ctor()" "call void MyStruct::Test()"
4671 do
4672         ./make_prefix_test.sh "prefix_test_invalid_op_volatile_$I" invalid  "volatile. $OP" "nop" "int32"
4673         ./make_prefix_test.sh "prefix_test_invalid_op_unaligned_$I" invalid  "unaligned. 1 nop" "nop" "int32"
4674         I=`expr $I + 1`
4675 done
4676
4677