[llvm-dev] Heads-up: Change output change in MIR testing

Quentin Colombet via llvm-dev llvm-dev at lists.llvm.org
Wed Jul 13 13:49:55 PDT 2016

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).

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20160713/d9556032/attachment.html>

More information about the llvm-dev mailing list