summaryrefslogtreecommitdiff
path: root/test/Misc
diff options
context:
space:
mode:
authorDaniel Dunbar <daniel@zuster.org>2012-11-15 20:06:10 +0000
committerDaniel Dunbar <daniel@zuster.org>2012-11-15 20:06:10 +0000
commit0b95bd00533620ec5cb81041afbf790dfe976ca9 (patch)
tree1d2b75eb09518890674e957f1adc390842f528f2 /test/Misc
parent71f49f5d8fc3c4980bed4bb7790c8d0e50586d3b (diff)
downloadclang-0b95bd00533620ec5cb81041afbf790dfe976ca9.tar.gz
tests: Add a test for reading from named pipes.
- Realized I could use the /dev/fd filesystem to make a simple portable test. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@168079 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/Misc')
-rw-r--r--test/Misc/dev-fd-fs.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/test/Misc/dev-fd-fs.c b/test/Misc/dev-fd-fs.c
new file mode 100644
index 0000000000..2eff138f42
--- /dev/null
+++ b/test/Misc/dev-fd-fs.c
@@ -0,0 +1,12 @@
+// Check that we can operate on files from /dev/fd.
+// REQUIRES: dev-fd-fs
+
+
+// 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.
+//
+// RUN: cat %s | %clang -x c /dev/fd/0 -E > %t
+// RUN: FileCheck --check-prefix DEV-FD-INPUT < %t %s
+
+// DEV-FD-INPUT: int x;
+int x;