blob: 2bc4f291a216ceaac496ddb53a4bef0195b87c53 [file] [log] [blame]
Daniel Dunbar0b95bd02012-11-15 20:06:10 +00001// Check that we can operate on files from /dev/fd.
2// REQUIRES: dev-fd-fs
3
NAKAMURA Takumia4906702012-12-18 05:14:30 +00004// It has not been working since r169831 on freebsd.
5// XFAIL: freebsd
Daniel Dunbar0b95bd02012-11-15 20:06:10 +00006
7// Check reading from named pipes. We cat the input here instead of redirecting
8// it to ensure that /dev/fd/0 is a named pipe, not just a redirected file.
9//
10// RUN: cat %s | %clang -x c /dev/fd/0 -E > %t
11// RUN: FileCheck --check-prefix DEV-FD-INPUT < %t %s
Daniel Dunbar5564e6c2012-11-15 20:24:58 +000012//
Daniel Dunbar0b95bd02012-11-15 20:06:10 +000013// DEV-FD-INPUT: int x;
Daniel Dunbar5564e6c2012-11-15 20:24:58 +000014
15
16// Check writing to /dev/fd named pipes. We use cat here as before to ensure we
17// get a named pipe.
18//
19// RUN: %clang -x c %s -E -o /dev/fd/1 | cat > %t
20// RUN: FileCheck --check-prefix DEV-FD-FIFO-OUTPUT < %t %s
21//
22// DEV-FD-FIFO-OUTPUT: int x;
23
24
25// Check writing to /dev/fd regular files.
26//
27// RUN: %clang -x c %s -E -o /dev/fd/1 > %t
28// RUN: FileCheck --check-prefix DEV-FD-REG-OUTPUT < %t %s
29//
30// DEV-FD-REG-OUTPUT: int x;
31
Daniel Dunbar0b95bd02012-11-15 20:06:10 +000032int x;