Run DCE after a LoopFlatten test to reduce spurious output [nfc]
[llvm-project.git] / openmp / tools / archer / tests / deflake.bash
blob5700c134edf83915fc6e19cd54c123c521447bcf
1 #!/usr/bin/env bash
2 # This script is used to deflake inherently flaky archer tests.
3 # It is invoked from lit tests as:
4 # %deflake mybinary
5 # which is then substituted by lit to:
6 # $(dirname %s)/deflake.bash mybinary
7 # The script runs the target program up to 10 times,
8 # until it fails (i.e. produces a race report).
10 for i in $(seq 1 10); do
11 OUT=`$@ 2>&1`
12 if [[ $? != 0 ]]; then
13 echo "$OUT"
14 exit 0
16 done
17 exit 1