Run DCE after a LoopFlatten test to reduce spurious output [nfc]
[llvm-project.git] / llvm / utils / lit / tests / shtest-run-at-line.py
blobdc0b78c6b81cad095cd9ad338d3b881562eb0493
1 # Check that -a/-v/-vv makes the line number of the failing RUN command clear.
4 # RUN: not %{lit} -a %{inputs}/shtest-run-at-line | %{filter-lit} | FileCheck %s
5 # RUN: not %{lit} -v %{inputs}/shtest-run-at-line | %{filter-lit} | FileCheck %s
6 # RUN: not %{lit} -vv %{inputs}/shtest-run-at-line | %{filter-lit} | FileCheck %s
7 # END.
10 # CHECK: Testing: 8 tests
13 # In the case of the external shell, we check for only RUN lines in stderr in
14 # case some shell implementations format "set -x" output differently.
16 # CHECK-LABEL: FAIL: shtest-run-at-line :: external-shell/basic.txt
18 # CHECK: Command Output (stderr)
19 # CHECK-NEXT: --
20 # CHECK-NEXT: {{^}}RUN: at line 4: true{{$}}
21 # CHECK-NEXT: true
22 # CHECK-NEXT: {{^}}RUN: at line 5: false{{$}}
23 # CHECK-NEXT: false
24 # CHECK-EMPTY:
25 # CHECK-NEXT: --
27 # CHECK-LABEL: FAIL: shtest-run-at-line :: external-shell/empty-run-line.txt
29 # CHECK: Command Output (stderr)
30 # CHECK-NEXT: --
31 # CHECK-NEXT: {{^}}RUN: at line 2 has no command after substitutions{{$}}
32 # CHECK-NEXT: {{^}}RUN: at line 3: false{{$}}
33 # CHECK-NEXT: false
34 # CHECK-EMPTY:
35 # CHECK-NEXT: --
37 # CHECK-LABEL: FAIL: shtest-run-at-line :: external-shell/line-continuation.txt
39 # The execution trace from an external sh-like shell might print the commands
40 # from a pipeline in any order, so this time just check that lit suppresses the
41 # trace of the echo command for each 'RUN: at line N: cmd-line'.
43 # CHECK: Command Output (stderr)
44 # CHECK-NEXT: --
45 # CHECK-NEXT: {{^}}RUN: at line 4: echo 'foo bar' | FileCheck
46 # CHECK-NOT: RUN
47 # CHECK: {{^}}RUN: at line 6: echo 'foo baz' | FileCheck
48 # CHECK-NOT: RUN
49 # CHECK: --
51 # CHECK-LABEL: FAIL: shtest-run-at-line :: external-shell/run-line-with-newline.txt
53 # CHECK: Command Output (stderr)
54 # CHECK-NEXT: --
55 # CHECK-NEXT: {{^}}RUN: at line 1: echo abc |
56 # CHECK-NEXT: FileCheck {{.*}} &&
57 # CHECK-NEXT: false
58 # CHECK-NOT: RUN
61 # CHECK-LABEL: FAIL: shtest-run-at-line :: internal-shell/basic.txt
63 # CHECK: Command Output (stdout)
64 # CHECK-NEXT: --
65 # CHECK-NEXT: # RUN: at line 1
66 # CHECK-NEXT: true
67 # CHECK-NEXT: # executed command: true
68 # CHECK-NEXT: # RUN: at line 2
69 # CHECK-NEXT: false
70 # CHECK-NEXT: # executed command: false
71 # CHECK-NOT: RUN
73 # CHECK-LABEL: FAIL: shtest-run-at-line :: internal-shell/empty-run-line.txt
75 # CHECK: Command Output (stdout)
76 # CHECK-NEXT: --
77 # CHECK-NEXT: # RUN: at line 2 has no command after substitutions
78 # CHECK-NEXT: # RUN: at line 3
79 # CHECK-NEXT: false
80 # CHECK-NEXT: # executed command: false
81 # CHECK-NOT: RUN
83 # CHECK-LABEL: FAIL: shtest-run-at-line :: internal-shell/line-continuation.txt
85 # CHECK: Command Output (stdout)
86 # CHECK-NEXT: --
87 # CHECK-NEXT: # RUN: at line 1
88 # CHECK-NEXT: : first line continued to second line
89 # CHECK-NEXT: # executed command: : first line continued to second line
90 # CHECK-NEXT: # RUN: at line 3
91 # CHECK-NEXT: echo 'foo bar' | FileCheck {{.*}}
92 # CHECK-NEXT: # executed command: echo 'foo bar'
93 # CHECK-NEXT: # executed command: FileCheck {{.*}}
94 # CHECK-NEXT: # RUN: at line 5
95 # CHECK-NEXT: echo 'foo baz' | FileCheck {{.*}}
96 # CHECK-NEXT: # executed command: echo 'foo baz'
97 # CHECK-NEXT: # executed command: FileCheck {{.*}}
98 # CHECK-NOT: RUN
100 # CHECK-LABEL: FAIL: shtest-run-at-line :: internal-shell/run-line-with-newline.txt
102 # CHECK: Command Output (stdout)
103 # CHECK-NEXT: --
104 # CHECK-NEXT: # RUN: at line 1
105 # CHECK-NEXT: echo abc |
106 # CHECK-NEXT: FileCheck {{.*}} &&
107 # CHECK-NEXT: false
108 # CHECK-NEXT: # executed command: echo abc
109 # CHECK-NEXT: # executed command: FileCheck {{.*}}
110 # CHECK-NEXT: # executed command: false
111 # CHECK-NOT: RUN