a4526d1d5a22a5a13605ea5da1f48e47147f53bd
[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.cil
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 .class Class extends [mscorlib]System.Object
13 {
14     .field public int32 fld
15 }
16
17 .method public static int32 Main(int32 arg) cil managed
18 {
19         .entrypoint
20         .maxstack 1
21         .locals init (
22             int32 V_0
23         )
24         OPCODE // invalid, stack empty.
25         branch_target:
26         pop
27         ldc.i4.0
28         ret
29 }
30 //EOF