[lit] Fix the return code for "not not" after evaluating "not" internally
authorMartin Storsjö <martin@martin.st>
Sun, 18 Apr 2021 21:37:13 +0000 (00:37 +0300)
committerMartin Storsjö <martin@martin.st>
Sun, 18 Apr 2021 21:37:13 +0000 (00:37 +0300)
commitd0b03ec401e8465b88893a4c56aeb0c787a54ad9
tree82916eff94dbc3fdc94cc4ca35138804a56cc1bc
parentf08b171b18744a2e75f13e7d4860a51eebd4d5e8
[lit] Fix the return code for "not not" after evaluating "not" internally

This fixes cases where "not not <command>" is supposed to return
only the error codes 0 or 1, but after efee57925c3f46c74c6697,
it passed the original error code through.

This was visible on AIX in the shtest-output-printing.py testcase,
where 'wc' returns 2, while it returns 1 on other platforms, and the
test required "not not" to normalize it to 1.
llvm/utils/lit/lit/TestRunner.py
llvm/utils/lit/tests/Inputs/shtest-not/fail2.py [new file with mode: 0644]
llvm/utils/lit/tests/Inputs/shtest-not/not-calls-fail2.txt [new file with mode: 0644]
llvm/utils/lit/tests/shtest-not.py