[llvm-dev] [FileCheck] Add --verbose

Tom de Vries via llvm-dev llvm-dev at lists.llvm.org
Wed Dec 14 04:25:52 PST 2016


Hi,

this patch adds a --verbose option to FileCheck. [ An alternative name 
could be --debug or --debug-pattern. ]

Consider a file CHECK:
...
// CHECK-LABEL:bla1
// CHECK-NEXT:bla2
// CHECK-NEXT: bla3
// CHECK-NEXT:bla4
// CHECK-NEXT: bla5
...

and a FileCheck command using --verbose:
...
$ echo | FileCheck CHECK --strict-whitespace --match-full-lines --verbose
...

For each check the actual match pattern used is shown:
...
CHECK:1:16: note: RegEx string match: '^bla1$'
// CHECK-LABEL:bla1
                ^
CHECK:2:15: note: RegEx string match: '^bla2$'
// CHECK-NEXT:bla2
               ^
CHECK:3:16: note: RegEx string match: '^bla3$'
// CHECK-NEXT: bla3
                ^
CHECK:4:15: note: RegEx string match: '^bla4$'
// CHECK-NEXT:bla4
               ^
CHECK:5:16: note: RegEx string match: '^bla5$'
// CHECK-NEXT: bla5
                ^
...

Seeing the actual match pattern allows to see the effect of command line 
switches that modify the original pattern (such as --match-full-lines), 
and help to understand why something is or is not matching.

Any comments? OK for trunk?

Thanks,
- Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-FileCheck-Add-verbose.patch
Type: text/x-patch
Size: 1439 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20161214/79eb4e53/attachment.bin>


More information about the llvm-dev mailing list