File tree Expand file tree Collapse file tree 15 files changed +93
-93
lines changed
check_commands/CHECK/failure
09-not-enough-input-for-all-checks
01-edge-case-no-newline-in-llvm
02-edge-case-no-newline-in-py Expand file tree Collapse file tree 15 files changed +93
-93
lines changed Original file line number Diff line number Diff line change @@ -31,7 +31,7 @@ Create new file ``hello-world.check`` with the following contents:
3131
3232.. code-block :: text
3333
34- ; CHECK: Hello world
34+ CHECK: Hello world
3535
3636 Now we can provide a valid input to ``filecheck `` which will match it against
3737the check file:
@@ -52,9 +52,9 @@ If we provide an invalid output we will see an error message:
5252
5353 $ echo " What is FileCheck" | filecheck hello-world.check
5454 /usr/local/bin/filecheck
55- examples/hello-world.check:1:10 : error: CHECK: expected string not found in input
56- ; CHECK: Hello world
57- ^
55+ examples/hello-world.check:1:8 : error: CHECK: expected string not found in input
56+ CHECK: Hello world
57+ ^
5858 < stdin> :1:1: note: scanning from here
5959 What is FileCheck
6060 ^
@@ -72,7 +72,7 @@ Create a new file ``hello-world-regex.check`` with the following contents:
7272
7373.. code-block :: text
7474
75- ; CHECK: {{^Hello world$}}
75+ CHECK: {{^Hello world$}}
7676
7777 Let's run it with a valid input:
7878
@@ -89,9 +89,9 @@ With invalid input:
8989
9090 $ echo " Hello world Hello world" | filecheck examples/hello-world-regex.check
9191 /usr/local/bin/filecheck
92- examples/hello-world-regex.check:1:10 : error: CHECK: expected string not found in input
93- ; CHECK: {{^Hello world$}}
94- ^
92+ examples/hello-world-regex.check:1:8 : error: CHECK: expected string not found in input
93+ CHECK: {{^Hello world$}}
94+ ^
9595 < stdin> :1:1: note: scanning from here
9696 Hello world Hello world
9797 ^
Original file line number Diff line number Diff line change @@ -61,8 +61,8 @@ Test file ``01-pass.c``:
6161.. code-block :: c
6262
6363 /**
64- ; RUN: clang %s -o %S/hello-world && %S/hello-world | filecheck %s
65- ; CHECK: Hello world
64+ RUN: clang %s -o %S/hello-world && %S/hello-world | filecheck %s
65+ CHECK: Hello world
6666 */
6767
6868 #include <stdio.h>
@@ -94,8 +94,8 @@ Test file ``02-fail.c``:
9494.. code-block :: c
9595
9696 /**
97- ; RUN: clang %s -o %S/hello-world && %S/hello-world | filecheck %s
98- ; CHECK: Wrong line
97+ RUN: clang %s -o %S/hello-world && %S/hello-world | filecheck %s
98+ CHECK: Wrong line
9999 */
100100
101101 #include <stdio.h>
@@ -137,9 +137,9 @@ Produces more output:
137137 -- Testing: 1 tests, single process --
138138 FAIL: <unnamed> :: 02-fail.c (1 of 1)
139139 ******************** TEST '<unnamed> :: 02-fail.c' FAILED ********************
140- 02-fail.c:3:10 : error: CHECK: expected string not found in input
141- ; CHECK: Wrong line
142- ^
140+ 02-fail.c:3:8 : error: CHECK: expected string not found in input
141+ CHECK: Wrong line
142+ ^
143143 <stdin>:1:1: note: scanning from here
144144 Hello world
145145 ...
Original file line number Diff line number Diff line change @@ -85,10 +85,10 @@ in the same file:
8585
8686.. code-block :: text
8787
88- ; RUN: printf "String1" | %FILECHECK_EXEC %s --check-prefix STRING1
89- ; RUN: printf "String2" | %FILECHECK_EXEC %s --check-prefix STRING2
90- ; STRING1: String1
91- ; STRING2: String2
88+ RUN: printf "String1" | %FILECHECK_EXEC %s --check-prefix STRING1
89+ RUN: printf "String2" | %FILECHECK_EXEC %s --check-prefix STRING2
90+ STRING1: String1
91+ STRING2: String2
9292
9393 One usual case is testing of how a program behaves when it is run with or
9494without a specific option.
Original file line number Diff line number Diff line change @@ -22,17 +22,17 @@ Check file:
2222
2323.. code-block :: text
2424
25- ; CHECK-NOT:String1
26- ; CHECK:String2
25+ CHECK-NOT:String1
26+ CHECK:String2
2727
2828 Result:
2929
3030.. code-block :: text
3131
3232 /Users/Stanislaw/.pyenv/shims/filecheck
33- filecheck.check:2:9 : error: CHECK: expected string not found in input
34- ; CHECK:String2
35- ^
33+ filecheck.check:2:7 : error: CHECK: expected string not found in input
34+ CHECK:String2
35+ ^
3636 <stdin>:1:1: note: scanning from here
3737 String1
3838 ^
Original file line number Diff line number Diff line change 1- ; RUN: %printf "String1" | %expect_exit 1 %FILECHECK_EXEC "%S/CHECK.check" | %FILECHECK_EXEC "%s" --strict-whitespace --match-full-lines
1+ RUN: %printf "String1" | %expect_exit 1 %FILECHECK_EXEC "%S/CHECK.check" | %FILECHECK_EXEC "%s" --strict-whitespace --match-full-lines
22
33// TODO: Something wrong with the greediness here:
4- ; CHECK:{{^.*}}CHECK.check:2:8: error: {{CHECK}}: expected string not found in input
4+ CHECK:{{^.*}}CHECK.check:2:8: error: {{CHECK}}: expected string not found in input
55// TODO: And here:
6- ; CHECK:{{^CHECK}}: String2
7- ; CHECK: ^
8- ; CHECK:<stdin>:1:8: note: scanning from here
9- ; CHECK:String1
10- ; CHECK: ^
11- ; CHECK-EMPTY:
6+ CHECK:{{^CHECK}}: String2
7+ CHECK: ^
8+ CHECK:<stdin>:1:8: note: scanning from here
9+ CHECK:String1
10+ CHECK: ^
11+ CHECK-EMPTY:
Original file line number Diff line number Diff line change 1- ; RUN: %printf "String1\n" | %expect_exit 1 %FILECHECK_EXEC "%S/CHECK.check" | %FILECHECK_EXEC "%s"
1+ RUN: %printf "String1\n" | %expect_exit 1 %FILECHECK_EXEC "%S/CHECK.check" | %FILECHECK_EXEC "%s"
22
3- ; CHECK: {{.*}}CHECK.check:2:8: error: CHECK: expected string not found in input
4- ; CHECK: CHECK: String2
5- ; CHECK: ^
6- ; CHECK: <stdin>:2:1: note: scanning from here
7- ; CHECK-EMPTY:
8- ; CHECK: ^
9- ; CHECK-EMPTY:
3+ CHECK: {{.*}}CHECK.check:2:8: error: CHECK: expected string not found in input
4+ CHECK: CHECK: String2
5+ CHECK: ^
6+ CHECK: <stdin>:2:1: note: scanning from here
7+ CHECK-EMPTY:
8+ CHECK: ^
9+ CHECK-EMPTY:
Original file line number Diff line number Diff line change 1- ; RUN: %printf "String1\n" | %expect_exit 1 %FILECHECK_EXEC "%S/CHECK.check" | %FILECHECK_EXEC "%s" --strict-whitespace --match-full-lines
1+ RUN: %printf "String1\n" | %expect_exit 1 %FILECHECK_EXEC "%S/CHECK.check" | %FILECHECK_EXEC "%s" --strict-whitespace --match-full-lines
22
33// TODO: Something wrong with the greediness here:
4- ; CHECK***:{{^.*}}CHECK.check:2:8: error: CHECK***: expected string not found in input
5- ; CHECK:{{^.*}}
4+ CHECK***:{{^.*}}CHECK.check:2:8: error: CHECK***: expected string not found in input
5+ CHECK:{{^.*}}
66// TODO: And here:
7- ; CHECK:{{.*}}String2
8- ; CHECK: ^
9- ; CHECK:<stdin>:1:8: note: scanning from here
10- ; CHECK:String1
11- ; CHECK: ^
12- ; CHECK-EMPTY:
7+ CHECK:{{.*}}String2
8+ CHECK: ^
9+ CHECK:<stdin>:1:8: note: scanning from here
10+ CHECK:String1
11+ CHECK: ^
12+ CHECK-EMPTY:
Original file line number Diff line number Diff line change 1- ; RUN: %printf "String1\nString2" | %expect_exit 1 %FILECHECK_EXEC "%S/CHECK-EMPTY.check" | %FILECHECK_EXEC "%s"
1+ RUN: %printf "String1\nString2" | %expect_exit 1 %FILECHECK_EXEC "%S/CHECK-EMPTY.check" | %FILECHECK_EXEC "%s"
22
3- ; CHECK: {{^.*}}CHECK-EMPTY.check:2:13: error: CHECK-EMPTY: expected string not found in input
4- ; CHECK: CHECK-EMPTY:
5- ; CHECK: ^
6- ; CHECK: <stdin>:2:1: note: scanning from here
7- ; CHECK: String2
8- ; CHECK: ^
9- ; CHECK-EMPTY:
3+ CHECK: {{^.*}}CHECK-EMPTY.check:2:13: error: CHECK-EMPTY: expected string not found in input
4+ CHECK: CHECK-EMPTY:
5+ CHECK: ^
6+ CHECK: <stdin>:2:1: note: scanning from here
7+ CHECK: String2
8+ CHECK: ^
9+ CHECK-EMPTY:
Original file line number Diff line number Diff line change 1- ; RUN: %printf "String1\n\nString2" | %expect_exit 0 --expect-no-content %FILECHECK_EXEC "%S/CHECK-EMPTY.check"
1+ RUN: %printf "String1\n\nString2" | %expect_exit 0 --expect-no-content %FILECHECK_EXEC "%S/CHECK-EMPTY.check"
Original file line number Diff line number Diff line change 1- ; RUN: %printf "String1\nfoo\nString2" | %expect_exit 1 %FILECHECK_EXEC "%S/CHECK-NEXT.check" | %FILECHECK_EXEC "%s"
1+ RUN: %printf "String1\nfoo\nString2" | %expect_exit 1 %FILECHECK_EXEC "%S/CHECK-NEXT.check" | %FILECHECK_EXEC "%s"
22
3- ; CHECK: {{.*}}CHECK-NEXT.check:2:13: error: CHECK-NEXT: is not on the line after the previous match
4- ; CHECK: CHECK-NEXT: String2
5- ; CHECK: ^
6- ; CHECK: <stdin>:3:1: note: 'next' match was here
7- ; CHECK: String2
8- ; CHECK: ^
9- ; CHECK: <stdin>:1:8: note: previous match ended here
10- ; CHECK: String1
11- ; CHECK: ^
12- ; CHECK: <stdin>:2:1: note: non-matching line after previous match is here
13- ; CHECK: foo
14- ; CHECK: ^
15- ; CHECK-EMPTY:
3+ CHECK: {{.*}}CHECK-NEXT.check:2:13: error: CHECK-NEXT: is not on the line after the previous match
4+ CHECK: CHECK-NEXT: String2
5+ CHECK: ^
6+ CHECK: <stdin>:3:1: note: 'next' match was here
7+ CHECK: String2
8+ CHECK: ^
9+ CHECK: <stdin>:1:8: note: previous match ended here
10+ CHECK: String1
11+ CHECK: ^
12+ CHECK: <stdin>:2:1: note: non-matching line after previous match is here
13+ CHECK: foo
14+ CHECK: ^
15+ CHECK-EMPTY:
You can’t perform that action at this time.
0 commit comments