X-Git-Url: http://wien.tomnetworks.com/gitweb/?a=blobdiff_plain;f=mono%2Fmini%2Ftest_op_il_seq_point.sh;h=ee235f5c739cb4a91bb87edfe55e0b5bb5a14f3c;hb=HEAD;hp=9866dbba4b81ae671d38e99753fa1b1f76d9fb4c;hpb=93ce056a764e8048f33548a3744ba2bd84072043;p=mono.git diff --git a/mono/mini/test_op_il_seq_point.sh b/mono/mini/test_op_il_seq_point.sh index 9866dbba4b8..ee235f5c739 100755 --- a/mono/mini/test_op_il_seq_point.sh +++ b/mono/mini/test_op_il_seq_point.sh @@ -1,24 +1,34 @@ #!/bin/bash -TEST_FILE=$1 -USE_AOT=$2 +DEFAULT_PROFILE=$1 +TEST_FILE=$2 +USE_AOT=$3 TMP_FILE_PREFIX=$(basename $0).tmp BASEDIR=$(dirname $0) -MONO_PATH=$BASEDIR/../../mcs/class/lib/net_4_5:$BASEDIR +case "$(uname -s)" in + CYGWIN*) PLATFORM_PATH_SEPARATOR=';';; + *) PLATFORM_PATH_SEPARATOR=':';; +esac + +MONO_PATH=$BASEDIR/../../mcs/class/lib/$DEFAULT_PROFILE$PLATFORM_PATH_SEPARATOR$BASEDIR RUNTIME=$BASEDIR/../../runtime/mono-wrapper trap "rm -rf ${TMP_FILE_PREFIX}*" EXIT tmp_file () { - mktemp ./${TMP_FILE_PREFIX}XXXX + mktemp ./${TMP_FILE_PREFIX}XXXXXX } clean_aot () { - rm -rf *.exe..so *.exe.dylib *.exe.dylib.dSYM + rm -rf *.exe.so *.exe.dylib *.exe.dylib.dSYM *.exe.dll } +# The test compares the generated native code size between a compilation with and without seq points. +# In some architectures ie:amd64 when possible 32bit instructions and registers are used instead of 64bit ones. +# Using MONO_DEBUG=single-imm-size avoids 32bit optimizations thus mantaining the native code size between compilations. + get_methods () { if [ -z $4 ]; then MONO_PATH=$1 $2 -v --compile-all=1 $3 | grep '^Method .*code length' | sed 's/emitted[^()]*//' | sort @@ -38,15 +48,19 @@ get_method () { } diff_methods () { - TMP_FILE=$(tmp_file) - echo "$(get_methods $1 $2 $3 $4)" >$TMP_FILE - diff <(cat $TMP_FILE) <(echo "$(MONO_DEBUG=gen-compact-seq-points get_methods $1 $2 $3 $4)") + TMP_FILE1=$(tmp_file) + TMP_FILE2=$(tmp_file) + echo "$(MONO_DEBUG=no-compact-seq-points,single-imm-size get_methods $1 $2 $3 $4)" >$TMP_FILE1 + echo "$(MONO_DEBUG=single-imm-size get_methods $1 $2 $3 $4)" >$TMP_FILE2 + diff $TMP_FILE1 $TMP_FILE2 } diff_method () { - TMP_FILE=$(tmp_file) - echo "$(get_method $1 $2 $3 $4 $5)" >$TMP_FILE - sdiff -w 150 <(cat $TMP_FILE) <(echo "$(MONO_DEBUG=gen-compact-seq-points get_method $1 $2 $3 $4 $5 | grep -Ev il_seq_point)") + TMP_FILE1=$(tmp_file) + TMP_FILE2=$(tmp_file) + echo "$(MONO_DEBUG=no-compact-seq-points,single-imm-size get_method $1 $2 $3 $4 $5)" >$TMP_FILE1 + echo "$(MONO_DEBUG=single-imm-size get_method $1 $2 $3 $4 $5 | grep -Ev il_seq_point)" >$TMP_FILE2 + sdiff -w 150 $TMP_FILE1 $TMP_FILE2 } get_method_name () { @@ -85,10 +99,30 @@ while read line; do fi done < $TMP_FILE +TESTRESULT_FILE=TestResult-op_il_seq_point.tmp + +echo -n " > $TESTRESULT_FILE + if [ $CHANGES != 0 ] then METHOD_NAME=$(get_method_name "$METHOD") + echo "False\">" >> $TESTRESULT_FILE + echo " " >> $TESTRESULT_FILE + echo -n " > $TESTRESULT_FILE + echo "Detected OP_IL_SEQ_POINT incompatibility on $TEST_FILE" >> $TESTRESULT_FILE + echo " $CHANGES methods differ when sequence points are enabled." >> $TESTRESULT_FILE + echo ' This is probably caused by a runtime optimization that is not handling OP_IL_SEQ_POINT' >> $TESTRESULT_FILE + echo '' >> $TESTRESULT_FILE + echo "Diff $METHOD_NAME" >> $TESTRESULT_FILE + echo "Without IL_OP_SEQ_POINT With IL_OP_SEQ_POINT" >> $TESTRESULT_FILE + echo -n "$(diff_method $MONO_PATH $RUNTIME $TEST_FILE $METHOD_NAME $USE_AOT)" >> $TESTRESULT_FILE + echo "]]>" >> $TESTRESULT_FILE + echo " " >> $TESTRESULT_FILE + echo " " >> $TESTRESULT_FILE + echo " " >> $TESTRESULT_FILE + echo " " >> $TESTRESULT_FILE + echo '' echo "Detected OP_IL_SEQ_POINT incompatibility on $TEST_FILE" echo " $CHANGES methods differ when sequence points are enabled." @@ -99,4 +133,6 @@ then echo "Without IL_OP_SEQ_POINT With IL_OP_SEQ_POINT" echo "$(diff_method $MONO_PATH $RUNTIME $TEST_FILE $METHOD_NAME $USE_AOT)" exit 1 +else + echo "True\" />" >> $TESTRESULT_FILE fi