1 // Check that we can operate on files from /dev/fd. 2 // REQUIRES: dev-fd-fs 3 4 // It has not been working since r169831 on freebsd. 5 // XFAIL: freebsd 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 12 // 13 // DEV-FD-INPUT: int x; 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 32 int x; 33