xref: /llvm-project/llvm/test/FileCheck/check-empty-tag.txt (revision f471eb8e99b564265a4bea326922263ff06cda40)
1; basic functionality
2; RUN: FileCheck %s --input-file %s --check-prefix=CHECK1
3foo
4
5bar
6CHECK1: foo
7CHECK1-EMPTY:
8CHECK1-NEXT: bar
9
10; next line must be blank
11; RUN: %ProtectFileCheckOutput \
12; RUN: not FileCheck %s --input-file %s --check-prefix=CHECK2A 2>&1 \
13; RUN: | FileCheck %s --check-prefix=CHECK2B
14badger
15CHECK2A: badger
16CHECK2A-EMPTY:
17CHECK2B: CHECK2A-EMPTY: is not on the line after the previous match
18
19; CHECK-EMPTY must have empty pattern
20; RUN: %ProtectFileCheckOutput \
21; RUN: not FileCheck %s --input-file %s --check-prefix=CHECK3A 2>&1 \
22; RUN: | FileCheck %s --check-prefix=CHECK3B
23CHECK3A: foo
24CHECK3A-EMPTY: this is not empty
25CHECK3B: found non-empty check string for empty check with prefix 'CHECK3A:'
26
27; CHECK-EMPTY cannot be the first check
28; RUN: %ProtectFileCheckOutput \
29; RUN: not FileCheck %s --input-file %s --check-prefix=CHECK4A 2>&1 \
30; RUN: | FileCheck %s --check-prefix=CHECK4B
31CHECK4A-EMPTY:
32CHECK4B: found 'CHECK4A-EMPTY' without previous 'CHECK4A: line
33
34; CHECK-EMPTY-NOT and CHECK-NOT-EMPTY rejected
35; RUN: %ProtectFileCheckOutput \
36; RUN: not FileCheck %s --input-file %s --check-prefixes=CHECK5A 2>&1 \
37; RUN: | FileCheck %s --check-prefix=CHECK5C
38; RUN: %ProtectFileCheckOutput \
39; RUN: not FileCheck %s --input-file %s --check-prefixes=CHECK5B 2>&1 \
40; RUN: | FileCheck %s --check-prefix=CHECK5C
41CHECK5A-EMPTY-NOT:
42CHECK5B-NOT-EMPTY:
43CHECK5C: unsupported -NOT combo on prefix 'CHECK5{{A|B}}'
44
45; whitespace does not count as empty
46; RUN: %ProtectFileCheckOutput \
47; RUN: not FileCheck %s --input-file %s --check-prefix=CHECK6A --match-full-lines \
48; RUN: 2>&1 | FileCheck %s --check-prefix=CHECK6B
49CHECK6A: the next line has spaces
50CHECK6A-EMPTY:
51CHECK6B: expected string not found in input
52
53; ***don't add any further blank lines after this point***
54; CHECK-EMPTY, like CHECK-NEXT, will report an error if the first matching
55; line is not the line immediately following the previous check.
56the next line has spaces
57