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

Jonathan Roelofs via llvm-dev llvm-dev at lists.llvm.org
Wed Dec 14 08:09:12 PST 2016


+jyknight, who added --match-full-lines


On 12/14/16 5:25 AM, Tom de Vries wrote:
> 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?

It needs a testcase, and some docs in docs/CommandGuide/FileCheck.rst.


Jon

>
> Thanks,
> - Tom

-- 
Jon Roelofs
jonathan at codesourcery.com
CodeSourcery / Mentor Embedded



More information about the llvm-dev mailing list