Skip to content

Commit 5bd8d4f

Browse files
[𝘀𝗽𝗿] initial version
Created using spr 1.3.6
1 parent c70b9c8 commit 5bd8d4f

File tree

3 files changed

+7
-1
lines changed

3 files changed

+7
-1
lines changed

clang/test/Misc/dev-fd-fs.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
// Check that we can operate on files from /dev/fd.
22
// REQUIRES: dev-fd-fs
3-
// REQUIRES: shell
43

54
// Check reading from named pipes. We cat the input here instead of redirecting
65
// it to ensure that /dev/fd/0 is a named pipe, not just a redirected file.

llvm/utils/lit/lit/builtin_commands/cat.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,9 @@ def main(argv):
4949
import os, msvcrt
5050

5151
msvcrt.setmode(sys.stdout.fileno(), os.O_BINARY)
52+
if len(filenames) == 0:
53+
sys.stdout.write(sys.stdin.read())
54+
sys.exit(0)
5255
for filename in filenames:
5356
try:
5457
contents = None

llvm/utils/lit/tests/Inputs/shtest-cat/cat.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,3 +70,7 @@
7070
# NP-CAT-OUTPUT-NEXT:M-HM-IM-JM-KM-LM-MM-NM-OM-PM-QM-RM-SM-TM-UM-VM-WM-XM-YM-ZM-[
7171
# 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
7272
# NP-CAT-OUTPUT-NEXT:M-pM-qM-rM-sM-tM-uM-vM-wM-xM-yM-zM-{M-|M-}M-~M-^?
73+
74+
## Test that cat will pipe stdin to stdout if no other files are specified.
75+
# RUN: echo test | cat | FileCheck --check-prefix=CAT-STDIN %s
76+
# CAT-STDIN: test

0 commit comments

Comments
 (0)