Keep running "not --crash" via the external "not" executable, but
for plain negations, and for cases that use the shell "!" operator,
just skip that argument and invert the return code.
The libcxx tests only use the shell operator "!" for negations,
never the "not" executable, because libcxx tests can be run without
having a fully built llvm tree available providing the "not"
executable.
This allows using the internal shell for libcxx tests.
Hello, this logic is not actually sound: There are tests that are sensitive to the specific return code and not just whether the result is zero or not.
From http://lab.llvm.org:8014/#/builders/126/builds/273/steps/5/logs/stdio:
/scratch/powerllvm/powerllvm_env/aix-ppc64-ppc64le/clang-ppc64-aix-ppc64le/stage1/utils/lit/tests/shtest-output-printing.py:15:15: error: CHECK-NEXT: expected string not found in input # CHECK-NEXT: Exit Code: 1 ^ /scratch/powerllvm/powerllvm_env/aix-ppc64-ppc64le/clang-ppc64-aix-ppc64le/stage1/utils/lit/tests/Output/shtest-output-printing.py.tmp.out:9:3: note: scanning from here -- ^ /scratch/powerllvm/powerllvm_env/aix-ppc64-ppc64le/clang-ppc64-aix-ppc64le/stage1/utils/lit/tests/Output/shtest-output-printing.py.tmp.out:10:1: note: possible intended match here Exit Code: 2 ^ Input file: /scratch/powerllvm/powerllvm_env/aix-ppc64-ppc64le/clang-ppc64-aix-ppc64le/stage1/utils/lit/tests/Output/shtest-output-printing.py.tmp.out Check file: /scratch/powerllvm/powerllvm_env/aix-ppc64-ppc64le/clang-ppc64-aix-ppc64le/stage1/utils/lit/tests/shtest-output-printing.py -dump-input=help explains the following input dump. Input was: <<<<<< 1: -- Testing: 1 tests, 1 workers --_ 2: FAIL: shtest-output-printing :: basic.txt (1 of 1)_ 3: ******************** TEST 'shtest-output-printing :: basic.txt' FAILED ********************_ 4: Script:_ 5: --_ 6: : 'RUN: at line 1'; true_ 7: : 'RUN: at line 2'; echo hi_ 8: : 'RUN: at line 3'; not not wc missing-file &> /scratch/powerllvm/powerllvm_env/aix-ppc64-ppc64le/clang-ppc64-aix-ppc64le/stage1/utils/lit/tests/Inputs/shtest-output-printing/Output/basic.txt.tmp.out_ 9: --_ next:15'0 X error: no match found 10: Exit Code: 2_ next:15'0 ~~~~~~~~~~~~~ next:15'1 ? possible intended match@mstorsjo, please revert if a fix (with an appropriate test) is not forthcoming.