[llvm] Refactor the calling convention handling code a bit, add support for returning...
[mono.git] / mono / mini / test_op_il_seq_point.sh
index e204d25c25a3b88b584754706e1d5d49da80418e..d29b282e2ba2889f6753055501a717ea08383f64 100755 (executable)
@@ -21,7 +21,7 @@ clean_aot () {
 
 get_methods () {
        if [ -z $4 ]; then
-               MONO_PATH=$1 $2 -v $3 -q | grep '^Method .*code length' | sed 's/emitted[^()]*//' | sort
+               MONO_PATH=$1 $2 -v --compile-all=1 $3 | grep '^Method .*code length' | sed 's/emitted[^()]*//' | sort
        else
                clean_aot
                MONO_PATH=$1 $2 -v --aot $3 | grep '^Method .*code length' | sed 's/emitted[^()]*//' | sort
@@ -30,7 +30,7 @@ get_methods () {
 
 get_method () {
        if [ -z $5 ]; then
-               MONO_VERBOSE_METHOD="$4" MONO_PATH=$1 $2 $3 -q | sed 's/0x[0-9a-fA-F]*/0x0/g'
+               MONO_VERBOSE_METHOD="$4" MONO_PATH=$1 $2 --compile-all=1 $3 | sed 's/0x[0-9a-fA-F]*/0x0/g'
        else
                clean_aot
                MONO_VERBOSE_METHOD="$4" MONO_PATH=$1 $2 --aot $3 | sed 's/0x[0-9a-fA-F]*/0x0/g'
@@ -38,13 +38,13 @@ get_method () {
 }
 
 diff_methods () {
-       TMP_FILE=tmp_file
+       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)")
 }
 
 diff_method () {
-       TMP_FILE=tmp_file
+       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)")
 }
@@ -63,7 +63,7 @@ else
        echo "Checking unintended native code changes in $TEST_FILE with AOT"
 fi
 
-TMP_FILE=tmp_file
+TMP_FILE=$(tmp_file)
 
 echo "$(diff_methods $MONO_PATH $RUNTIME $TEST_FILE $USE_AOT)" > $TMP_FILE
 
@@ -85,10 +85,28 @@ while read line; do
        fi
 done < $TMP_FILE
 
+echo -n "              <test-case name=\"MonoTests.op_il_seq_point.${TEST_FILE}${USE_AOT}\" executed=\"True\" time=\"0\" asserts=\"0\" success=\"" >> TestResults_op_il_seq_point.xml
+
 if [ $CHANGES != 0 ]
 then
        METHOD_NAME=$(get_method_name "$METHOD")
 
+       echo "False\">" >> TestResults_op_il_seq_point.xml
+       echo "                <failure>" >> TestResults_op_il_seq_point.xml
+       echo -n "                  <message><![CDATA[" >> TestResults_op_il_seq_point.xml
+       echo "Detected OP_IL_SEQ_POINT incompatibility on $TEST_FILE" >> TestResults_op_il_seq_point.xml
+       echo "  $CHANGES methods differ when sequence points are enabled." >> TestResults_op_il_seq_point.xml
+       echo '  This is probably caused by a runtime optimization that is not handling OP_IL_SEQ_POINT' >> TestResults_op_il_seq_point.xml
+       echo '' >> TestResults_op_il_seq_point.xml
+       echo "Diff $METHOD_NAME" >> TestResults_op_il_seq_point.xml
+       echo "Without IL_OP_SEQ_POINT                                                         With IL_OP_SEQ_POINT" >> TestResults_op_il_seq_point.xml
+       echo -n "$(diff_method $MONO_PATH $RUNTIME $TEST_FILE $METHOD_NAME $USE_AOT)" >> TestResults_op_il_seq_point.xml
+       echo "]]></message>" >> TestResults_op_il_seq_point.xml
+       echo "                  <stack-trace>" >> TestResults_op_il_seq_point.xml
+       echo "                  </stack-trace>" >> TestResults_op_il_seq_point.xml
+       echo "                </failure>" >> TestResults_op_il_seq_point.xml
+       echo "              </test-case>" >> TestResults_op_il_seq_point.xml
+
        echo ''
        echo "Detected OP_IL_SEQ_POINT incompatibility on $TEST_FILE"
        echo "  $CHANGES methods differ when sequence points are enabled."
@@ -99,4 +117,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\" />" >> TestResults_op_il_seq_point.xml
 fi