6 TMP_FILE_PREFIX=$(basename $0).tmp
9 MONO_PATH=$BASEDIR/../../mcs/class/lib/net_4_5:$BASEDIR
10 RUNTIME=$BASEDIR/../../runtime/mono-wrapper
12 trap "rm -rf ${TMP_FILE_PREFIX}*" EXIT
15 mktemp ./${TMP_FILE_PREFIX}XXXX
19 rm -rf *.exe..so *.exe.dylib *.exe.dylib.dSYM
24 MONO_PATH=$1 $2 -v $3 | grep '^Method .*code length' | sed 's/emitted[^()]*//' | sort
27 MONO_PATH=$1 $2 -v $3 | grep '^Method .*code length' | sed 's/emitted[^()]*//' | sort
33 MONO_VERBOSE_METHOD="$4" MONO_PATH=$1 $2 $3 | sed 's/0x[0-9a-fA-F]*/0x0/g'
36 MONO_VERBOSE_METHOD="$4" MONO_PATH=$1 $2 $3 | sed 's/0x[0-9a-fA-F]*/0x0/g'
42 echo "$(get_methods $1 $2 $3 $4)" >$TMP_FILE
43 sdiff -s -w 1000 <(cat $TMP_FILE) <(echo "$(MONO_DEBUG=gen-compact-seq-points get_methods $1 $2 $3 $4)")
48 echo "$(get_method $1 $2 $3 $4 $5)" >$TMP_FILE
49 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)")
53 echo $1 | sed -E 's/Method (\([^)]*\) )?([^ ]*).*/\2/g'
56 get_method_length () {
57 echo $1 | sed 's/.*code length \([0-9]*\).*/\1/'
60 if [ -z $USE_AOT ]; then
61 echo "Checking unintended native code changes in $TEST_FILE without AOT"
63 echo "Checking unintended native code changes in $TEST_FILE with AOT"
68 echo "$(diff_methods $MONO_PATH $RUNTIME $TEST_FILE $USE_AOT)" > $TMP_FILE
75 if [ "$line" != "" ]; then
76 echo $line | sed 's/000.*//g'
77 CHANGES=$((CHANGES+1))
78 SIZE=$(get_method_length "$line")
79 if [[ SIZE -lt MIN_SIZE ]]; then
88 METHOD_NAME=$(get_method_name "$METHOD")
91 echo "Detected OP_IL_SEQ_POINT incompatibility on $TEST_FILE"
92 echo " $CHANGES methods differ when sequence points are enabled."
93 echo ' This is probably caused by a runtime optimization that is not handling OP_IL_SEQ_POINT'
96 echo "Diff $METHOD_NAME"
97 echo "Without IL_OP_SEQ_POINT With IL_OP_SEQ_POINT"
98 echo "$(diff_method $MONO_PATH $RUNTIME $TEST_FILE $METHOD_NAME $USE_AOT)"