99a5fed7cf75a3892934e955b1aa4a1bc3c2c097
[mono.git] / mono / tests / verifier / make_stack_1_pop_test.sh
1 #! /bin/sh
2
3 TEST_OP=$1
4 TEST_TYPE=$2
5
6 TEST_OP_SHORT=`echo $TEST_OP | cut -d " " -f 1`
7 TEST_FILE=`echo invalid_stack_1_${TEST_OP_SHORT}_${TEST_TYPE} | sed -e "s/ /_/g" -e "s/\./_/g" -e "s/&/mp/g"`_generated.cil
8 echo $TEST_FILE
9 sed -e "s/OPCODE/${TEST_OP}/g" -e "s/TYPE/${TEST_TYPE}/g" > $TEST_FILE <<//EOF
10 // invalid CIL which breaks the ECMA-335 rules.
11 // This CIL should fail verification by a conforming CLI verifier.
12
13 .class Class extends [mscorlib]System.Object
14 {
15     .field public int32 fld
16 }
17
18 .method public static int32 Main(int32 arg) cil managed
19 {
20         .entrypoint
21         .maxstack 1
22         .locals init (
23             TYPE V_0
24         )
25         ldloc.0
26         OPCODE // invalid, only 1 value on stack.
27         branch_target:
28         pop
29         ldc.i4.0
30         ret
31 }
32 //EOF