blob: b7bb8db5223cb021fff0f19c20d565893c4ff1c6 [file] [log] [blame]
Joel E. Denny3c5d2672018-12-18 00:01:39 +00001;--------------------------------------------------
Joel E. Denny2c007c82018-12-18 00:02:04 +00002; Use -strict-whitespace to check marker and note alignment here.
Joel E. Denny3c5d2672018-12-18 00:01:39 +00003; (Also check multiline marker where start/end columns vary across lines.)
4;
5; In the remaining checks, don't use -strict-whitespace and thus check just the
6; presence, order, and lengths of markers. That way, if we ever change padding
7; within line labels, we don't have to adjust so many tests.
8;--------------------------------------------------
9
10; RUN: echo 'hello world' > %t.in
11; RUN: echo 'goodbye' >> %t.in
12; RUN: echo 'world' >> %t.in
Joel E. Denny2c007c82018-12-18 00:02:04 +000013; RUN: echo 'unicorn' >> %t.in
Joel E. Denny3c5d2672018-12-18 00:01:39 +000014
15; RUN: echo 'CHECK: hello' > %t.chk
16; RUN: echo 'CHECK: universe' >> %t.chk
17
18; RUN: not FileCheck -dump-input=always -input-file %t.in %t.chk -v 2>&1 \
Joel E. Denny352695c2019-01-22 21:41:42 +000019; RUN: | FileCheck -strict-whitespace -match-full-lines -check-prefix=ALIGN \
20; RUN: -implicit-check-not='remark:' %s
21
22; Verbose diagnostics are suppressed but not errors.
23; ALIGN:{{.*}}error:{{.*}}
24; ALIGN:{{.*}}possible intended match here{{.*}}
Joel E. Denny3c5d2672018-12-18 00:01:39 +000025
26; ALIGN:Full input was:
27; ALIGN-NEXT:<<<<<<
Joel E. Denny2c007c82018-12-18 00:02:04 +000028; ALIGN-NEXT: 1: hello world
Joel E. Denny7df86962018-12-18 00:03:03 +000029; ALIGN-NEXT:check:1 ^~~~~
Joel E. Denny2c007c82018-12-18 00:02:04 +000030; ALIGN-NEXT:check:2'0 X~~~~
31; ALIGN-NEXT: 2: goodbye
32; ALIGN-NEXT:check:2'0 ~~~~~~~
33; ALIGN-NEXT: 3: world
34; ALIGN-NEXT:check:2'0 ~~~~~
35; ALIGN-NEXT: 4: unicorn
36; ALIGN-NEXT:check:2'0 ~~~~~~~ error: no match found
37; ALIGN-NEXT:check:2'1 ? possible intended match
Joel E. Denny3c5d2672018-12-18 00:01:39 +000038; ALIGN-NEXT:>>>>>>
39; ALIGN-NOT:{{.}}
40
41;--------------------------------------------------
Joel E. Denny2c007c82018-12-18 00:02:04 +000042; CHECK (also: multi-line search range, fuzzy match)
Joel E. Denny3c5d2672018-12-18 00:01:39 +000043;--------------------------------------------------
44
45; Good match and no match.
46
47; RUN: echo 'hello' > %t.in
48; RUN: echo 'again' >> %t.in
49; RUN: echo 'whirled' >> %t.in
50
51; RUN: echo 'CHECK: hello' > %t.chk
52; RUN: echo 'CHECK: world' >> %t.chk
53
54; RUN: not FileCheck -dump-input=always -input-file %t.in %t.chk 2>&1 \
Joel E. Denny352695c2019-01-22 21:41:42 +000055; RUN: | FileCheck -match-full-lines %s -check-prefix=CHK \
56; RUN: -implicit-check-not='remark:'
Joel E. Denny3c5d2672018-12-18 00:01:39 +000057; RUN: not FileCheck -dump-input=always -input-file %t.in %t.chk -v 2>&1 \
Joel E. Denny352695c2019-01-22 21:41:42 +000058; RUN: | FileCheck -match-full-lines %s -check-prefixes=CHK,CHK-V \
59; RUN: -implicit-check-not='remark:'
Joel E. Denny3c5d2672018-12-18 00:01:39 +000060; RUN: not FileCheck -dump-input=always -input-file %t.in %t.chk -vv 2>&1 \
Joel E. Denny352695c2019-01-22 21:41:42 +000061; RUN: | FileCheck -match-full-lines %s -check-prefixes=CHK,CHK-V \
62; RUN: -implicit-check-not='remark:'
63
64; Verbose diagnostics are suppressed but not errors.
65; CHK: {{.*}}error:{{.*}}
66; CHK: {{.*}}possible intended match here{{.*}}
Joel E. Denny3c5d2672018-12-18 00:01:39 +000067
68; CHK: <<<<<<
Joel E. Denny2c007c82018-12-18 00:02:04 +000069; CHK-NEXT: 1: hello
Joel E. Denny7df86962018-12-18 00:03:03 +000070; CHK-V-NEXT: check:1 ^~~~~
Joel E. Denny2c007c82018-12-18 00:02:04 +000071; CHK-NEXT: 2: again
72; CHK-NEXT: check:2'0 X~~~~
73; CHK-NEXT: 3: whirled
74; CHK-NEXT: check:2'0 ~~~~~~~ error: no match found
75; CHK-NEXT: check:2'1 ? possible intended match
Joel E. Denny3c5d2672018-12-18 00:01:39 +000076; CHK-NEXT: >>>>>>
77; CHK-NOT: {{.}}
78
79;--------------------------------------------------
80; CHECK-COUNT-<num>
81;--------------------------------------------------
82
83; Good match and no match.
84
85; RUN: echo 'pete' > %t.in
86; RUN: echo 'repete' >> %t.in
87; RUN: echo 'repeat' >> %t.in
88
89; RUN: echo 'CHECK-COUNT-3: pete' > %t.chk
90
91; RUN: not FileCheck -dump-input=always -input-file %t.in %t.chk 2>&1 \
Joel E. Denny352695c2019-01-22 21:41:42 +000092; RUN: | FileCheck -match-full-lines %s -check-prefixes=CNT,CNT-Q \
93; RUN: -implicit-check-not='remark:'
Joel E. Denny3c5d2672018-12-18 00:01:39 +000094; RUN: not FileCheck -dump-input=always -input-file %t.in %t.chk -v 2>&1 \
Joel E. Denny352695c2019-01-22 21:41:42 +000095; RUN: | FileCheck -match-full-lines %s -check-prefixes=CNT,CNT-V \
96; RUN: -implicit-check-not='remark:'
Joel E. Denny3c5d2672018-12-18 00:01:39 +000097; RUN: not FileCheck -dump-input=always -input-file %t.in %t.chk -vv 2>&1 \
Joel E. Denny352695c2019-01-22 21:41:42 +000098; RUN: | FileCheck -match-full-lines %s -check-prefixes=CNT,CNT-V \
99; RUN: -implicit-check-not='remark:'
100
101; Verbose diagnostics are suppressed but not errors.
102; CNT: {{.*}}error:{{.*}}
Joel E. Denny3c5d2672018-12-18 00:01:39 +0000103
Joel E. Denny7df86962018-12-18 00:03:03 +0000104; CNT: <<<<<<
105; CNT-NEXT: 1: pete
106; CNT-V-NEXT: count:1'0 ^~~~
107; CNT-NEXT: 2: repete
108; CNT-V-NEXT: count:1'1 ^~~~
109; CNT-NEXT: 3: repeat
110; CNT-Q-NEXT: count:1 X~~~~~ error: no match found
111; CNT-V-NEXT: count:1'2 X~~~~~ error: no match found
112; CNT-NEXT: >>>>>>
113; CNT-NOT: {{.}}
Joel E. Denny3c5d2672018-12-18 00:01:39 +0000114
115;--------------------------------------------------
Joel E. Dennycadfcef2018-12-18 00:02:22 +0000116; CHECK-NEXT (also: EOF search-range, wrong-line match)
Joel E. Denny3c5d2672018-12-18 00:01:39 +0000117;--------------------------------------------------
118
119; Good match and no match.
120
121; RUN: echo 'hello' > %t.in
122; RUN: echo 'again' >> %t.in
123
124; RUN: echo 'CHECK: hello' > %t.chk
125; RUN: echo 'CHECK-NEXT: again' >> %t.chk
126; RUN: echo 'CHECK-NEXT: world' >> %t.chk
127
128; RUN: not FileCheck -dump-input=always -input-file %t.in %t.chk 2>&1 \
Joel E. Denny352695c2019-01-22 21:41:42 +0000129; RUN: | FileCheck -match-full-lines %s -check-prefix=NXT \
130; RUN: -implicit-check-not='remark:'
Joel E. Denny3c5d2672018-12-18 00:01:39 +0000131; RUN: not FileCheck -dump-input=always -input-file %t.in %t.chk -v 2>&1 \
Joel E. Denny352695c2019-01-22 21:41:42 +0000132; RUN: | FileCheck -match-full-lines %s -check-prefixes=NXT,NXT-V \
133; RUN: -implicit-check-not='remark:'
Joel E. Denny3c5d2672018-12-18 00:01:39 +0000134; RUN: not FileCheck -dump-input=always -input-file %t.in %t.chk -vv 2>&1 \
Joel E. Denny352695c2019-01-22 21:41:42 +0000135; RUN: | FileCheck -match-full-lines %s -check-prefixes=NXT,NXT-V,NXT-VV \
136; RUN: -implicit-check-not='remark:'
137
138; Verbose diagnostics are suppressed but not errors.
139; NXT: {{.*}}error:{{.*}}
Joel E. Denny3c5d2672018-12-18 00:01:39 +0000140
141; NXT: <<<<<<
Joel E. Denny7df86962018-12-18 00:03:03 +0000142; NXT-NEXT: 1: hello
143; NXT-V-NEXT: check:1 ^~~~~
144; NXT-NEXT: 2: again
145; NXT-V-NEXT: next:2 ^~~~~
146; NXT-NEXT: 3:
147; NXT-NEXT: next:3 X error: no match found
Joel E. Denny3c5d2672018-12-18 00:01:39 +0000148; NXT-NEXT: >>>>>>
149; NXT-NOT: {{.}}
150
Joel E. Dennycadfcef2018-12-18 00:02:22 +0000151; Wrong-line match.
152
153; RUN: echo 'yonder' >> %t.in
154; RUN: echo 'world' >> %t.in
155
156; RUN: not FileCheck -dump-input=always -input-file %t.in %t.chk 2>&1 \
157; RUN: | FileCheck -match-full-lines %s -check-prefix=NXT2
158
159; NXT2: <<<<<<
160; NXT2-NEXT: 1: hello
161; NXT2-NEXT: 2: again
162; NXT2-NEXT: 3: yonder
163; NXT2-NEXT: 4: world
164; NXT2-NEXT: next:3 !~~~~ error: match on wrong line
165; NXT2-NEXT: >>>>>>
166; NXT2-NOT: {{.}}
167
Joel E. Denny3c5d2672018-12-18 00:01:39 +0000168;--------------------------------------------------
Joel E. Denny7df86962018-12-18 00:03:03 +0000169; CHECK-SAME (also: multiple annotations per line, single-char search range,
170; wrong-line match)
Joel E. Denny3c5d2672018-12-18 00:01:39 +0000171;--------------------------------------------------
172
173; Good match and no match.
174
175; RUN: echo 'hello world!' > %t.in
176
177; RUN: echo 'CHECK: hello' > %t.chk
178; RUN: echo 'CHECK-SAME: world' >> %t.chk
179; RUN: echo 'CHECK-SAME: again' >> %t.chk
180
181; RUN: not FileCheck -dump-input=always -input-file %t.in %t.chk 2>&1 \
Joel E. Denny352695c2019-01-22 21:41:42 +0000182; RUN: | FileCheck -match-full-lines %s -check-prefix=SAM \
183; RUN: -implicit-check-not='remark:'
Joel E. Denny3c5d2672018-12-18 00:01:39 +0000184; RUN: not FileCheck -dump-input=always -input-file %t.in %t.chk -v 2>&1 \
Joel E. Denny352695c2019-01-22 21:41:42 +0000185; RUN: | FileCheck -match-full-lines %s -check-prefixes=SAM,SAM-V \
186; RUN: -implicit-check-not='remark:'
Joel E. Denny3c5d2672018-12-18 00:01:39 +0000187; RUN: not FileCheck -dump-input=always -input-file %t.in %t.chk -vv 2>&1 \
Joel E. Denny352695c2019-01-22 21:41:42 +0000188; RUN: | FileCheck -match-full-lines %s -check-prefixes=SAM,SAM-V,SAM-VV \
189; RUN: -implicit-check-not='remark:'
190
191; Verbose diagnostics are suppressed but not errors.
192; SAM: {{.*}}error:{{.*}}
Joel E. Denny3c5d2672018-12-18 00:01:39 +0000193
194; SAM: <<<<<<
Joel E. Denny7df86962018-12-18 00:03:03 +0000195; SAM-NEXT: 1: hello world!
196; SAM-V-NEXT: check:1 ^~~~~
197; SAM-V-NEXT: same:2 ^~~~~
198; SAM-NEXT: same:3 X error: no match found
Joel E. Denny3c5d2672018-12-18 00:01:39 +0000199; SAM-NEXT: >>>>>>
200; SAM-NOT: {{.}}
201
Joel E. Dennycadfcef2018-12-18 00:02:22 +0000202; Wrong-line match.
203
204; RUN: echo 'again' >> %t.in
205
206; RUN: not FileCheck -dump-input=always -input-file %t.in %t.chk -v 2>&1 \
Joel E. Denny352695c2019-01-22 21:41:42 +0000207; RUN: | FileCheck -match-full-lines %s -check-prefixes=SAM2 \
208; RUN: -implicit-check-not='remark:'
209
210; Verbose diagnostics are suppressed but not errors.
211; SAM2: {{.*}}error:{{.*}}
Joel E. Dennycadfcef2018-12-18 00:02:22 +0000212
213; SAM2: <<<<<<
214; SAM2-NEXT: 1: hello world!
Joel E. Denny7df86962018-12-18 00:03:03 +0000215; SAM2-NEXT: check:1 ^~~~~
216; SAM2-NEXT: same:2 ^~~~~
Joel E. Dennycadfcef2018-12-18 00:02:22 +0000217; SAM2-NEXT: 2: again
218; SAM2-NEXT: same:3 !~~~~ error: match on wrong line
219; SAM2-NEXT: >>>>>>
220; SAM2-NOT: {{.}}
221
Joel E. Denny3c5d2672018-12-18 00:01:39 +0000222;--------------------------------------------------
Joel E. Denny7df86962018-12-18 00:03:03 +0000223; CHECK-EMPTY (also: search range ends at label, single-char match, wrong-line
224; match)
Joel E. Denny3c5d2672018-12-18 00:01:39 +0000225;--------------------------------------------------
226
227; Good match and no match.
228;
229; CHECK-EMPTY always seems to match an empty line at EOF (illegally when it's
230; not the next line) unless either (1) the last line is non-empty and has no
231; newline or (2) there's a CHECK-LABEL to end the search range before EOF. We
232; choose scenario 2 to check the case of no match.
233
234; RUN: echo 'hello' > %t.in
235; RUN: echo '' >> %t.in
236; RUN: echo 'world' >> %t.in
237; RUN: echo 'label' >> %t.in
238
239; RUN: echo 'CHECK: hello' > %t.chk
240; RUN: echo 'CHECK-EMPTY:' >> %t.chk
241; RUN: echo 'CHECK-EMPTY:' >> %t.chk
242; RUN: echo 'CHECK-LABEL: label' >> %t.chk
243
244; RUN: not FileCheck -dump-input=always -input-file %t.in %t.chk 2>&1 \
Joel E. Denny352695c2019-01-22 21:41:42 +0000245; RUN: | FileCheck -match-full-lines %s -check-prefix=EMP \
246; RUN: -implicit-check-not='remark:'
Joel E. Denny3c5d2672018-12-18 00:01:39 +0000247; RUN: not FileCheck -dump-input=always -input-file %t.in %t.chk -v 2>&1 \
Joel E. Denny352695c2019-01-22 21:41:42 +0000248; RUN: | FileCheck -match-full-lines %s -check-prefixes=EMP,EMP-V \
249; RUN: -implicit-check-not='remark:'
Joel E. Denny3c5d2672018-12-18 00:01:39 +0000250; RUN: not FileCheck -dump-input=always -input-file %t.in %t.chk -vv 2>&1 \
Joel E. Denny352695c2019-01-22 21:41:42 +0000251; RUN: | FileCheck -match-full-lines %s -check-prefixes=EMP,EMP-V,EMP-VV \
252; RUN: -implicit-check-not='remark:'
253
254; Verbose diagnostics are suppressed but not errors.
255; EMP: {{.*}}error:{{.*}}
Joel E. Denny3c5d2672018-12-18 00:01:39 +0000256
257; EMP: <<<<<<
258; EMP-NEXT: 1: hello
Joel E. Denny7df86962018-12-18 00:03:03 +0000259; EMP-V-NEXT: check:1 ^~~~~
Joel E. Denny3c5d2672018-12-18 00:01:39 +0000260; EMP-NEXT: 2:
Joel E. Denny7df86962018-12-18 00:03:03 +0000261; EMP-V-NEXT: empty:2 ^
Joel E. Denny3c5d2672018-12-18 00:01:39 +0000262; EMP-NEXT: 3: world
263; EMP-NEXT: empty:3 X~~~~
264; EMP-NEXT: 4: label
265; EMP-NEXT: empty:3 ~~~~~ error: no match found
Joel E. Denny7df86962018-12-18 00:03:03 +0000266; EMP-V-NEXT: label:4 ^~~~~
Joel E. Denny3c5d2672018-12-18 00:01:39 +0000267; EMP-NEXT: >>>>>>
268; EMP-NOT: {{.}}
269
Joel E. Dennycadfcef2018-12-18 00:02:22 +0000270; Wrong-line match.
271
272; RUN: echo 'hello' > %t.in
273; RUN: echo 'world' >> %t.in
274
275; RUN: echo 'CHECK: hello' > %t.chk
276; RUN: echo 'CHECK-EMPTY:' >> %t.chk
277
278; RUN: not FileCheck -dump-input=always -input-file %t.in %t.chk 2>&1 \
Joel E. Denny352695c2019-01-22 21:41:42 +0000279; RUN: | FileCheck -match-full-lines %s -check-prefix=EMP2 \
280; RUN: -implicit-check-not='remark:'
Joel E. Dennycadfcef2018-12-18 00:02:22 +0000281; RUN: not FileCheck -dump-input=always -input-file %t.in %t.chk -v 2>&1 \
Joel E. Denny352695c2019-01-22 21:41:42 +0000282; RUN: | FileCheck -match-full-lines %s -check-prefixes=EMP2,EMP2-V \
283; RUN: -implicit-check-not='remark:'
Joel E. Dennycadfcef2018-12-18 00:02:22 +0000284; RUN: not FileCheck -dump-input=always -input-file %t.in %t.chk -vv 2>&1 \
Joel E. Denny352695c2019-01-22 21:41:42 +0000285; RUN: | FileCheck -match-full-lines %s -check-prefixes=EMP2,EMP2-V,EMP2-VV \
286; RUN: -implicit-check-not='remark:'
287
288; Verbose diagnostics are suppressed but not errors.
289; EMP2: {{.*}}error:{{.*}}
Joel E. Dennycadfcef2018-12-18 00:02:22 +0000290
291; EMP2: <<<<<<
292; EMP2-NEXT: 1: hello
Joel E. Denny7df86962018-12-18 00:03:03 +0000293; EMP2-V-NEXT: check:1 ^~~~~
Joel E. Dennycadfcef2018-12-18 00:02:22 +0000294; EMP2-NEXT: 2: world
295; EMP2-NEXT: 3:
296; EMP2-NEXT: empty:2 ! error: match on wrong line
297; EMP2-NEXT: >>>>>>
298; EMP2-NOT: {{.}}
299
Joel E. Denny3c5d2672018-12-18 00:01:39 +0000300;--------------------------------------------------
Joel E. Denny96f0e842018-12-18 00:03:36 +0000301; CHECK-NOT (also: EOF pattern, and multiline range that ends before EOL)
Joel E. Denny0e7e3fa2018-12-18 00:02:47 +0000302;--------------------------------------------------
303
304; No match (success) and unexpected match (error).
305
306; RUN: echo 'hello' > %t.in
307; RUN: echo 'world' >> %t.in
308; RUN: echo 'again' >> %t.in
309
310; RUN: echo 'CHECK-NOT: goodbye' > %t.chk
311; RUN: echo 'CHECK-NOT: world' >> %t.chk
312
313; RUN: not FileCheck -dump-input=always -input-file %t.in %t.chk 2>&1 \
Joel E. Denny352695c2019-01-22 21:41:42 +0000314; RUN: | FileCheck -match-full-lines %s -check-prefix=NOT \
315; RUN: -implicit-check-not='remark:'
Joel E. Denny0e7e3fa2018-12-18 00:02:47 +0000316; RUN: not FileCheck -dump-input=always -input-file %t.in %t.chk -v 2>&1 \
Joel E. Denny352695c2019-01-22 21:41:42 +0000317; RUN: | FileCheck -match-full-lines %s -check-prefixes=NOT,NOT-V \
318; RUN: -implicit-check-not='remark:'
Joel E. Denny0e7e3fa2018-12-18 00:02:47 +0000319; RUN: not FileCheck -dump-input=always -input-file %t.in %t.chk -vv 2>&1 \
Joel E. Denny352695c2019-01-22 21:41:42 +0000320; RUN: | FileCheck -match-full-lines %s -check-prefixes=NOT,NOT-V,NOT-VV \
321; RUN: -implicit-check-not='remark:'
322
323; Verbose diagnostics are suppressed but not errors.
324; NOT: {{.*}}error:{{.*}}
Joel E. Denny0e7e3fa2018-12-18 00:02:47 +0000325
326; NOT: <<<<<<
327; NOT-NEXT: 1: hello
Joel E. Denny96f0e842018-12-18 00:03:36 +0000328; NOT-VV-NEXT: not:1 X~~~~
Joel E. Denny0e7e3fa2018-12-18 00:02:47 +0000329; NOT-NEXT: 2: world
Joel E. Denny96f0e842018-12-18 00:03:36 +0000330; NOT-VV-NEXT: not:1 ~~~~~
Joel E. Denny0e7e3fa2018-12-18 00:02:47 +0000331; NOT-NEXT: not:2 !~~~~ error: no match expected
332; NOT-NEXT: 3: again
Joel E. Denny96f0e842018-12-18 00:03:36 +0000333; NOT-VV-NEXT: not:1 ~~~~~
Joel E. Denny7df86962018-12-18 00:03:03 +0000334; NOT-VV-NEXT: 4:
335; NOT-VV-NEXT: eof:2 ^
Joel E. Denny0e7e3fa2018-12-18 00:02:47 +0000336; NOT-NEXT: >>>>>>
337; NOT-NOT: {{.}}
338
339; Again, but with a CHECK instead of EOF as search range end.
340
341; RUN: echo 'CHECK: ain' >> %t.chk
342
343; RUN: not FileCheck -dump-input=always -input-file %t.in %t.chk 2>&1 \
Joel E. Denny352695c2019-01-22 21:41:42 +0000344; RUN: | FileCheck -match-full-lines %s -check-prefix=NOT2 \
345; RUN: -implicit-check-not='remark:'
Joel E. Denny0e7e3fa2018-12-18 00:02:47 +0000346; RUN: not FileCheck -dump-input=always -input-file %t.in %t.chk -v 2>&1 \
Joel E. Denny352695c2019-01-22 21:41:42 +0000347; RUN: | FileCheck -match-full-lines %s -check-prefixes=NOT2,NOT2-V \
348; RUN: -implicit-check-not='remark:'
Joel E. Denny0e7e3fa2018-12-18 00:02:47 +0000349; RUN: not FileCheck -dump-input=always -input-file %t.in %t.chk -vv 2>&1 \
Joel E. Denny352695c2019-01-22 21:41:42 +0000350; RUN: | FileCheck -match-full-lines %s -check-prefixes=NOT2,NOT2-V,NOT2-VV \
351; RUN: -implicit-check-not='remark:'
352
353; Verbose diagnostics are suppressed but not errors.
354; NOT2: {{.*}}error:{{.*}}
Joel E. Denny0e7e3fa2018-12-18 00:02:47 +0000355
356; NOT2: <<<<<<
357; NOT2-NEXT: 1: hello
Joel E. Denny96f0e842018-12-18 00:03:36 +0000358; NOT2-VV-NEXT: not:1 X~~~~
Joel E. Denny0e7e3fa2018-12-18 00:02:47 +0000359; NOT2-NEXT: 2: world
Joel E. Denny96f0e842018-12-18 00:03:36 +0000360; NOT2-VV-NEXT: not:1 ~~~~~
Joel E. Denny0e7e3fa2018-12-18 00:02:47 +0000361; NOT2-NEXT: not:2 !~~~~ error: no match expected
362; NOT2-NEXT: 3: again
Joel E. Denny96f0e842018-12-18 00:03:36 +0000363; NOT2-VV-NEXT: not:1 ~~
Joel E. Denny7df86962018-12-18 00:03:03 +0000364; NOT2-V-NEXT: check:3 ^~~
Joel E. Denny0e7e3fa2018-12-18 00:02:47 +0000365; NOT2-NEXT: >>>>>>
366; NOT2-NOT: {{.}}
367
368;--------------------------------------------------
Joel E. Dennyf7c1c4d2018-12-18 00:03:19 +0000369; CHECK-DAG (also: matches in different order than directives, discarded match)
Joel E. Denny3c5d2672018-12-18 00:01:39 +0000370;--------------------------------------------------
371
372; Good match, discarded match plus good match, and no match.
373
374; RUN: echo 'abc' > %t.in
375; RUN: echo 'def' >> %t.in
376; RUN: echo 'abc' >> %t.in
377
378; RUN: echo 'CHECK-DAG: def' > %t.chk
379; RUN: echo 'CHECK-DAG: abc' >> %t.chk
380; RUN: echo 'CHECK-DAG: abc' >> %t.chk
381; RUN: echo 'CHECK-DAG: def' >> %t.chk
382
Joel E. Dennye2afb612018-12-18 00:03:51 +0000383; Prefixes used here:
384; DAG = quiet, -v, or -vv
385; DAG-Q = quiet
386; DAG-V = -v or -vv (-vv implies -v)
387; DAG-VQ = -v and not -vv
388; DAG-VV = -vv
389
Joel E. Denny3c5d2672018-12-18 00:01:39 +0000390; RUN: not FileCheck -dump-input=always -input-file %t.in %t.chk 2>&1 \
Joel E. Denny352695c2019-01-22 21:41:42 +0000391; RUN: | FileCheck -match-full-lines %s -check-prefixes=DAG,DAG-Q \
392; RUN: -implicit-check-not='remark:'
Joel E. Denny3c5d2672018-12-18 00:01:39 +0000393; RUN: not FileCheck -dump-input=always -input-file %t.in %t.chk -v 2>&1 \
Joel E. Denny352695c2019-01-22 21:41:42 +0000394; RUN: | FileCheck -match-full-lines %s -check-prefixes=DAG,DAG-V,DAG-VQ \
395; RUN: -implicit-check-not='remark:'
Joel E. Denny3c5d2672018-12-18 00:01:39 +0000396; RUN: not FileCheck -dump-input=always -input-file %t.in %t.chk -vv 2>&1 \
Joel E. Denny352695c2019-01-22 21:41:42 +0000397; RUN: | FileCheck -match-full-lines %s -check-prefixes=DAG,DAG-V,DAG-VV \
398; RUN: -implicit-check-not='remark:'
399
400; Verbose diagnostics are suppressed but not errors.
401; DAG: {{.*}}error:{{.*}}
Joel E. Denny3c5d2672018-12-18 00:01:39 +0000402
403; DAG: <<<<<<
Joel E. Denny7df86962018-12-18 00:03:03 +0000404; DAG-NEXT: 1: abc
405; DAG-V-NEXT: dag:2 ^~~
Joel E. Dennyf7c1c4d2018-12-18 00:03:19 +0000406; DAG-VV-NEXT: dag:3'0 !~~ discard: overlaps earlier match
Joel E. Denny7df86962018-12-18 00:03:03 +0000407; DAG-NEXT: 2: def
408; DAG-V-NEXT: dag:1 ^~~
Joel E. Dennyf7c1c4d2018-12-18 00:03:19 +0000409; DAG-VV-NEXT: dag:4'0 !~~ discard: overlaps earlier match
Joel E. Denny7df86962018-12-18 00:03:03 +0000410; DAG-NEXT: 3: abc
Joel E. Dennyf7c1c4d2018-12-18 00:03:19 +0000411; DAG-VQ-NEXT: dag:3 ^~~
412; DAG-VV-NEXT: dag:3'1 ^~~
413; DAG-Q-NEXT: dag:4 X~~ error: no match found
414; DAG-VQ-NEXT: dag:4 X~~ error: no match found
415; DAG-VV-NEXT: dag:4'1 X~~ error: no match found
Joel E. Denny3c5d2672018-12-18 00:01:39 +0000416; DAG-NEXT: >>>>>>
417; DAG-NOT: {{.}}
418
419;--------------------------------------------------
420; CHECK-LABEL
Joel E. Denny7df86962018-12-18 00:03:03 +0000421;
422; FIXME: Labels sometimes produce redundant diagnostics for good matches.
423; That bug is independent of but affects -dump-input.
Joel E. Denny3c5d2672018-12-18 00:01:39 +0000424;--------------------------------------------------
425
426; Good match and no match.
427
428; RUN: echo 'lab0' > %t.in
429; RUN: echo 'foo' >> %t.in
430; RUN: echo 'lab1' >> %t.in
431; RUN: echo 'bar' >> %t.in
432
433; RUN: echo 'CHECK-LABEL: lab0' > %t.chk
434; RUN: echo 'CHECK: foo' >> %t.chk
435; RUN: echo 'CHECK-LABEL: lab2' >> %t.chk
436
437; RUN: not FileCheck -dump-input=always -input-file %t.in %t.chk 2>&1 \
Joel E. Denny352695c2019-01-22 21:41:42 +0000438; RUN: | FileCheck -match-full-lines %s -check-prefixes=LAB \
439; RUN: -implicit-check-not='remark:'
Joel E. Denny3c5d2672018-12-18 00:01:39 +0000440; RUN: not FileCheck -dump-input=always -input-file %t.in %t.chk -v 2>&1 \
Joel E. Denny352695c2019-01-22 21:41:42 +0000441; RUN: | FileCheck -match-full-lines %s -check-prefixes=LAB,LAB-V \
442; RUN: -implicit-check-not='remark:'
Joel E. Denny3c5d2672018-12-18 00:01:39 +0000443; RUN: not FileCheck -dump-input=always -input-file %t.in %t.chk -vv 2>&1 \
Joel E. Denny352695c2019-01-22 21:41:42 +0000444; RUN: | FileCheck -match-full-lines %s -check-prefixes=LAB,LAB-V,LAB-VV \
445; RUN: -implicit-check-not='remark:'
446
447; Verbose diagnostics are suppressed but not errors.
448; LAB: {{.*}}error:{{.*}}
449; LAB: {{.*}}possible intended match{{.*}}
Joel E. Denny3c5d2672018-12-18 00:01:39 +0000450
451; LAB: <<<<<<
Joel E. Denny2c007c82018-12-18 00:02:04 +0000452; LAB-NEXT: 1: lab0
Joel E. Denny7df86962018-12-18 00:03:03 +0000453; LAB-V-NEXT: label:1'0 ^~~~
454; LAB-V-NEXT: label:1'1 ^~~~
Joel E. Denny2c007c82018-12-18 00:02:04 +0000455; LAB-NEXT: 2: foo
456; LAB-NEXT: label:3'0 X~~
457; LAB-NEXT: 3: lab1
458; LAB-NEXT: label:3'0 ~~~~
459; LAB-NEXT: label:3'1 ? possible intended match
460; LAB-NEXT: 4: bar
461; LAB-NEXT: label:3'0 ~~~ error: no match found
Joel E. Denny3c5d2672018-12-18 00:01:39 +0000462; LAB-NEXT: >>>>>>
463; LAB-NOT: {{.}}