- 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
--- /dev/null
+// 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;
if is_filesystem_case_insensitive():
config.available_features.add('case-insensitive-filesystem')
+# Tests that require the /dev/fd filesystem.
+if os.path.exists("/dev/fd/0"):
+ config.available_features.add('dev-fd-fs')
+
# [PR8833] LLP64-incompatible tests
if not re.match(r'^x86_64.*-(win32|mingw32)$', config.target_triple):
config.available_features.add('LP64')