| Daniel Dunbar | 0b95bd0 | 2012-11-15 20:06:10 +0000 | [diff] [blame] | 1 | // Check that we can operate on files from /dev/fd. |
| 2 | // REQUIRES: dev-fd-fs |
| 3 | |
| NAKAMURA Takumi | a490670 | 2012-12-18 05:14:30 +0000 | [diff] [blame] | 4 | // It has not been working since r169831 on freebsd. |
| 5 | // XFAIL: freebsd |
| Daniel Dunbar | 0b95bd0 | 2012-11-15 20:06:10 +0000 | [diff] [blame] | 6 | |
| 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 Dunbar | 5564e6c | 2012-11-15 20:24:58 +0000 | [diff] [blame] | 12 | // |
| Daniel Dunbar | 0b95bd0 | 2012-11-15 20:06:10 +0000 | [diff] [blame] | 13 | // DEV-FD-INPUT: int x; |
| Daniel Dunbar | 5564e6c | 2012-11-15 20:24:58 +0000 | [diff] [blame] | 14 | |
| 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 Dunbar | 0b95bd0 | 2012-11-15 20:06:10 +0000 | [diff] [blame] | 32 | int x; |