diff --git a/llvm/test/Other/pipefail.txt b/llvm/test/Other/pipefail.txt deleted file mode 100644 index 241080aab661c..0000000000000 --- a/llvm/test/Other/pipefail.txt +++ /dev/null @@ -1,2 +0,0 @@ -REQUIRES: shell -RUN: ((false | true) && echo true || echo false) | grep false diff --git a/llvm/utils/lit/tests/Inputs/shtest-shell/pipefail.txt b/llvm/utils/lit/tests/Inputs/shtest-shell/pipefail.txt new file mode 100644 index 0000000000000..b0d9dee4a2ced --- /dev/null +++ b/llvm/utils/lit/tests/Inputs/shtest-shell/pipefail.txt @@ -0,0 +1,4 @@ +# Check that we fail if earlier operations in a pipe fail. +# +# RUN: false | echo test +# \ No newline at end of file diff --git a/llvm/utils/lit/tests/shtest-shell.py b/llvm/utils/lit/tests/shtest-shell.py index b8bdc6e532e3d..498f6bb0adc11 100644 --- a/llvm/utils/lit/tests/shtest-shell.py +++ b/llvm/utils/lit/tests/shtest-shell.py @@ -580,6 +580,11 @@ # CHECK: # error: command failed with exit status: 127 # CHECK: *** +# CHECK: FAIL: shtest-shell :: pipefail.txt +# CHECK: *** TEST 'shtest-shell :: pipefail.txt' FAILED *** +# CHECK: error: command failed with exit status: 1 +# CHECK: *** + # CHECK: PASS: shtest-shell :: redirects.txt # CHECK: FAIL: shtest-shell :: rm-error-0.txt @@ -629,4 +634,4 @@ # CHECK: PASS: shtest-shell :: valid-shell.txt # CHECK: Unresolved Tests (1) -# CHECK: Failed Tests (36) +# CHECK: Failed Tests (37)