merge r67228-r67235, r67237, r67251 and r67256-67259 to trunk (they are
[mono.git] / mono / tests / verifier / make_stack_0_pop_test.sh
1 #! /bin/sh
2
3 TEST_OP=$1
4
5 TEST_OP_SHORT=`echo $TEST_OP | cut -d " " -f 1`
6 TEST_FILE=`echo invalid_stack_0_${TEST_OP_SHORT} | sed -e "s/ /_/g" -e "s/\./_/g" -e "s/&/mp/g"`_generated.il
7 echo $TEST_FILE
8 sed -e "s/OPCODE/${TEST_OP}/g" > $TEST_FILE <<//EOF
9 // invalid CIL which breaks the ECMA-335 rules. 
10 // This CIL should fail verification by a conforming CLI verifier.
11
12 .assembly '${TEST_NAME}_generated'
13 {
14   .hash algorithm 0x00008004
15   .ver  0:0:0:0
16 }
17
18 .class Class extends [mscorlib]System.Object
19 {
20     .field public int32 fld
21 }
22
23 .method public static int32 Main() cil managed
24 {
25         .entrypoint
26         .maxstack 1
27         .locals init (
28             int32 V_0
29         )
30         OPCODE // invalid, stack empty.
31         branch_target:
32         pop
33         ldc.i4.0
34         ret
35 }
36 //EOF