Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion clang/test/Misc/dev-fd-fs.c
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
// Check that we can operate on files from /dev/fd.
// REQUIRES: dev-fd-fs
// REQUIRES: shell

// Check reading from named pipes. We cat the input here instead of redirecting
// it to ensure that /dev/fd/0 is a named pipe, not just a redirected file.
Expand Down
3 changes: 3 additions & 0 deletions llvm/utils/lit/lit/builtin_commands/cat.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,9 @@ def main(argv):
import os, msvcrt

msvcrt.setmode(sys.stdout.fileno(), os.O_BINARY)
if len(filenames) == 0:
sys.stdout.write(sys.stdin.read())
sys.exit(0)
for filename in filenames:
try:
contents = None
Expand Down
4 changes: 4 additions & 0 deletions llvm/utils/lit/tests/Inputs/shtest-cat/cat.txt
Original file line number Diff line number Diff line change
Expand Up @@ -70,3 +70,7 @@
# NP-CAT-OUTPUT-NEXT:M-HM-IM-JM-KM-LM-MM-NM-OM-PM-QM-RM-SM-TM-UM-VM-WM-XM-YM-ZM-[
# NP-CAT-OUTPUT-NEXT:M-\M-]M-^M-_M-`M-aM-bM-cM-dM-eM-fM-gM-hM-iM-jM-kM-lM-mM-nM-o
# NP-CAT-OUTPUT-NEXT:M-pM-qM-rM-sM-tM-uM-vM-wM-xM-yM-zM-{M-|M-}M-~M-^?

## Test that cat will pipe stdin to stdout if no other files are specified.
# RUN: echo test | cat | FileCheck --check-prefix=CAT-STDIN %s
# CAT-STDIN: test
Loading