[runtime] Fix "make distcheck"
[mono-project.git] / mono / tests / verifier / make_mkrefany.sh
blob3e3f6a88377d695f5c5c44180591997890ffff3f
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_TYPE1=$3
11 TEST_TYPE2=$4
12 TEST_OP=$5
15 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
16 echo $TEST_FILE
17 $SED -e "s/TYPE1/${TEST_TYPE1}/g" -e "s/TYPE2/${TEST_TYPE2}/g" -e "s/VALIDITY/${TEST_VALIDITY}/g" -e "s/CODE/${TEST_OP}/g" > $TEST_FILE <<//EOF
19 .assembly extern mscorlib
21 .ver 2:0:0:0
22 .publickeytoken = (B7 7A 5C 56 19 34 E0 89 ) // .z\V.4..
25 .assembly 'mkrefany_test'
27 .hash algorithm 0x00008004
28 .ver 0:0:0:0
31 .module mkrefany.exe
34 .class Class extends [mscorlib]System.Object
36 .field public int32 valid
39 .class public Template\`1<T>
40 extends [mscorlib]System.Object
44 .class sealed public StructTemplate\`1<T>
45 extends [mscorlib]System.ValueType
47 .field public !0 t
50 .class sealed public StructTemplate2\`1<T>
51 extends [mscorlib]System.ValueType
53 .field public !0 t
57 .class public auto ansi sealed MyStruct
58 extends [mscorlib]System.ValueType
60 .field public int32 foo
64 .class public auto ansi sealed MyStruct2
65 extends [mscorlib]System.ValueType
67 .field public int32 foo
70 .method public static int32 Main ()
72 .entrypoint
73 .maxstack 8
74 .locals init (TYPE1 V_0)
76 ldloca 0
78 CODE
79 mkrefany TYPE2
80 pop
82 ldc.i4.0
83 ret
86 //EOF