summaryrefslogtreecommitdiffstats
path: root/test/Misc/dev-fd-fs.c
diff options
context:
space:
mode:
authordim <dim@FreeBSD.org>2013-04-08 18:45:10 +0000
committerdim <dim@FreeBSD.org>2013-04-08 18:45:10 +0000
commitc72c57c9e9b69944e3e009cd5e209634839581d3 (patch)
tree4fc2f184c499d106f29a386c452b49e5197bf63d /test/Misc/dev-fd-fs.c
parent5b20025c30d23d521e12c1f33ec8fa6b821952cd (diff)
downloadFreeBSD-src-c72c57c9e9b69944e3e009cd5e209634839581d3.zip
FreeBSD-src-c72c57c9e9b69944e3e009cd5e209634839581d3.tar.gz
Vendor import of clang trunk r178860:
http://llvm.org/svn/llvm-project/cfe/trunk@178860
Diffstat (limited to 'test/Misc/dev-fd-fs.c')
-rw-r--r--test/Misc/dev-fd-fs.c32
1 files changed, 32 insertions, 0 deletions
diff --git a/test/Misc/dev-fd-fs.c b/test/Misc/dev-fd-fs.c
new file mode 100644
index 0000000..2bc4f29
--- /dev/null
+++ b/test/Misc/dev-fd-fs.c
@@ -0,0 +1,32 @@
+// Check that we can operate on files from /dev/fd.
+// REQUIRES: dev-fd-fs
+
+// It has not been working since r169831 on freebsd.
+// XFAIL: freebsd
+
+// 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;
+
+
+// Check writing to /dev/fd named pipes. We use cat here as before to ensure we
+// get a named pipe.
+//
+// RUN: %clang -x c %s -E -o /dev/fd/1 | cat > %t
+// RUN: FileCheck --check-prefix DEV-FD-FIFO-OUTPUT < %t %s
+//
+// DEV-FD-FIFO-OUTPUT: int x;
+
+
+// Check writing to /dev/fd regular files.
+//
+// RUN: %clang -x c %s -E -o /dev/fd/1 > %t
+// RUN: FileCheck --check-prefix DEV-FD-REG-OUTPUT < %t %s
+//
+// DEV-FD-REG-OUTPUT: int x;
+
+int x;
OpenPOWER on IntegriCloud