xref: /llvm-project/llvm/utils/lit/tests/Inputs/shtest-shell/redirects.txt (revision cc2404c01d40df744baf1bdffd554b6bcf10815a)
1# Check stdout redirect (> and >>).
2#
3# RUN: echo "not-present" > %t.stdout-write
4# RUN: echo "is-present" > %t.stdout-write
5# RUN: FileCheck --check-prefix=STDOUT-WRITE < %t.stdout-write %s
6#
7# STDOUT-WRITE-NOT: not-present
8# STDOUT-WRITE: is-present
9#
10# RUN: echo "appended-line" >> %t.stdout-write
11# RUN: FileCheck --check-prefix=STDOUT-APPEND < %t.stdout-write %s
12#
13# STDOUT-APPEND: is-present
14# STDOUT-APPEND: appended-line
15
16
17# Check stderr redirect (2> and 2>>).
18#
19# RUN: echo "not-present" > %t.stderr-write
20# RUN: %{python} %S/write-to-stderr.py 2> %t.stderr-write
21# RUN: FileCheck --check-prefix=STDERR-WRITE < %t.stderr-write %s
22#
23# STDERR-WRITE-NOT: not-present
24# STDERR-WRITE: a line on stderr
25#
26# RUN: %{python} %S/write-to-stderr.py 2>> %t.stderr-write
27# RUN: FileCheck --check-prefix=STDERR-APPEND < %t.stderr-write %s
28#
29# STDERR-APPEND: a line on stderr
30# STDERR-APPEND: a line on stderr
31
32
33# Check combined redirect (&>).
34#
35# RUN: echo "not-present" > %t.combined
36# RUN: %{python} %S/write-to-stdout-and-stderr.py &> %t.combined
37# RUN: FileCheck --check-prefix=COMBINED-WRITE < %t.combined %s
38#
39# COMBINED-WRITE-NOT: not-present
40# COMBINED-WRITE: a line on stdout
41# COMBINED-WRITE: a line on stderr
42