]> granicus.if.org Git - clang/commitdiff
tests: Check that we can output to /dev/fd filesystem.
authorDaniel Dunbar <daniel@zuster.org>
Thu, 15 Nov 2012 20:24:58 +0000 (20:24 +0000)
committerDaniel Dunbar <daniel@zuster.org>
Thu, 15 Nov 2012 20:24:58 +0000 (20:24 +0000)
 - An LLVM unique_file() bug could cause us to infinite loop on the later test
   case.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@168082 91177308-0d34-0410-b5e6-96231b3b80d8

test/Misc/dev-fd-fs.c

index 2eff138f421311ec3926c2a41bbc1a986df36b68..e35486ebe29a23581512797a3ee914b49419af6d 100644 (file)
@@ -7,6 +7,24 @@
 //
 // 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;