[PATCH] D96653: [FileCheck] Add neighboring annotations for -dump-input-filter=error

Joel E. Denny via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Mar 1 14:24:48 PST 2021


jdenny added a comment.

In D96653#2594600 <https://reviews.llvm.org/D96653#2594600>, @probinson wrote:

>> The strange part to me is that a preceding directive's search range ends at the end of the CHECK-LABEL match. It seems like it ought to end at the start of the CHECK-LABEL match.
>
> I'd expect the behavior of CHECK-NOT ranges to work the same for CHECK-LABEL as for a regular CHECK.

As far as I know, it does.  However, before CHECK-LABEL, a CHECK-NOT range is not the same as a CHECK range:

  $ cat input 
  ...
  ...
  bar
  
  $ cat check1
  CHECK-NOT: foo
  CHECK-LABEL: bar
  
  $ cat check2
  CHECK: bar
  CHECK-LABEL: bar
  
  $ FileCheck -dump-input=always -vv check1  < input |& tail -9
  <<<<<<
             1: ...
  not:1         X~~
             2: ...
  not:1         ~~~
             3: bar
  label:2'0     ^~~
  label:2'1     ^~~
  >>>>>>
  
  $ FileCheck -vv check2  < input |& tail -8
  <<<<<<
           1: ...
           2: ...
           3: bar
  label:2     ^~~
  check:1     ^~~
  label:2        X error: no match found
  >>>>>>



> (I deeply regret not following through on the FileCheck model stuff...  will put it on my to-do list, again.)

That discussion really helped me.  It would be great to see it in the docs.


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D96653/new/

https://reviews.llvm.org/D96653



More information about the llvm-commits mailing list