Heads-up: Change output change in MIR testing

Hi all,

As of r275314, the MIR testing infrastructure won’t print the regular output on stderr but in the file specified by -o like every llc invocation.
I’ve updated all the in-tree test cases, but for out-of-tree targets/test case, here is what to do to update your test cases:

  • Get rid of 2>&1, unless you actually check errors.
  • Replace -o /dev/null by -o -.

For your convenience, here is the script I used to update the llvm repository and that left my only a couple of tests to fix:

for file in grep -r 'RUN: .*llc .*\(\(start\|stop\)-after\|run-pass\)' test/ -l; do grep /dev/null $file > /dev/null ; if [ $? -eq 0 ] ; then echo $file ; cat $file | sed -e ‘s#(RUN: .) -o /dev/null (.)#\1 -o - \2#g’ | sed ‘s#(RUN: .) 2>&1 (.)#\1 \2#g’ > tmp.txt ; mv tmp.txt $file ; grep ‘RUN: not’ $file > /dev/null ; if [ $? -eq 0 ] ; then cat $file | sed -e ‘s#(RUN: not .) -o - (.)#\1 -o /dev/null \2#g’ | sed -e ‘s#(RUN: not .) | FileCheck (.)#\1 2>&1 | FileCheck \2#g’ > tmp.txt ; mv tmp.txt $file ; fi ; fi ; done

Replace test/ at the beginning with test/CodeGen/YourTarget and you may also want to use a different temporary file (here tmp.txt).