diff options
author | Daniel Dunbar <daniel@zuster.org> | 2012-11-15 20:06:10 +0000 |
---|---|---|
committer | Daniel Dunbar <daniel@zuster.org> | 2012-11-15 20:06:10 +0000 |
commit | 523855929becac2e6c06f465633da1243f6a3690 (patch) | |
tree | eb46b6eda46d8a66e5e749f6f12491c250f01f20 | |
parent | 5fdeac326864d3cb3dda3765405eede60c06c5cc (diff) | |
download | bcm5719-llvm-523855929becac2e6c06f465633da1243f6a3690.tar.gz bcm5719-llvm-523855929becac2e6c06f465633da1243f6a3690.zip |
tests: Add a test for reading from named pipes.
- Realized I could use the /dev/fd filesystem to make a simple portable test.
llvm-svn: 168079
-rw-r--r-- | clang/test/Misc/dev-fd-fs.c | 12 | ||||
-rw-r--r-- | clang/test/lit.cfg | 4 |
2 files changed, 16 insertions, 0 deletions
diff --git a/clang/test/Misc/dev-fd-fs.c b/clang/test/Misc/dev-fd-fs.c new file mode 100644 index 00000000000..2eff138f421 --- /dev/null +++ b/clang/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; diff --git a/clang/test/lit.cfg b/clang/test/lit.cfg index e91e66052e2..1180f72f5bf 100644 --- a/clang/test/lit.cfg +++ b/clang/test/lit.cfg @@ -237,6 +237,10 @@ def is_filesystem_case_insensitive(): 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') |