[runtime] Fix "make distcheck"
[mono-project.git] / mono / tests / verifier / make_overlapped_test.sh
blobbaa46d38ae6d56e4973925cadeb8f8089763783c
1 #! /bin/sh
3 SED="sed"
4 if [ `which gsed 2> /dev/null` ] ; then
5 SED="gsed"
6 fi
8 TEST_NAME=$1
9 TEST_VALIDITY=$2
10 TEST_POS_0=$3
11 TEST_POS_1=$4
12 TEST_POS_2=$5
13 TEST_TYPE_0=$6
15 if [ "$TEST_TYPE_0" == "" ] ; then
16 TEST_TYPE_0="int32";
19 TEST_FILE=`echo ${TEST_VALIDITY}_${TEST_NAME} | $SED -e 's/ /_/g' -e 's/\./_/g' -e 's/&/mp/g' -e 's/\[/_/g' -e 's/\]/_/g'`_generated.il
20 echo $TEST_FILE
21 TEST_TYPE1=`echo $TEST_TYPE1 | $SED -s 's/&/\\\&/'`
22 $SED -e "s/VALIDITY/${TEST_VALIDITY}/g" -e "s/TYPE_0/${TEST_TYPE_0}/g"> $TEST_FILE <<//EOF
24 // VALIDITY CIL which breaks the ECMA-335 rules.
25 // this CIL should fail verification by a conforming CLI verifier.
27 .assembly '${TEST_NAME}_generated'
29 .hash algorithm 0x00008004
30 .ver 0:0:0:0
33 .class explicit sealed Overlapped extends [mscorlib]System.ValueType
35 .field [${TEST_POS_0}] public TYPE_0 intVal
36 .field [${TEST_POS_1}] public object objVal
37 .field [${TEST_POS_2}] public int32 intVal2
39 .method public hidebysig specialname rtspecialname instance default void '.ctor' () cil managed
41 .maxstack 8
42 ret
46 .method public static int32 Main() cil managed
48 .entrypoint
49 .maxstack 2
50 .locals init (Overlapped val)
51 ldloca 0
52 initobj Overlapped
54 leave branch_target
55 branch_target:
56 ldc.i4.0
57 ret
59 //EOF