[PATCH] D58784: [FileCheck]Remove assertions that prevent matching an empty string at file start before CHECK-NEXT/SAME

James Henderson via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Mar 1 01:36:12 PST 2019


jhenderson added a comment.

In D58784#1414106 <https://reviews.llvm.org/D58784#1414106>, @probinson wrote:

> So we didn't have any tests that verified the assertion?  That was an oversight. 
>  FTR, the `CHECK: {{^$}}` is ensuring the first line is empty? I see that CHECK-EMPTY isn't allowed as the first directive, unfortunately.


Yes, in this particular case, that's what it is doing, (although the issue also comes up for any empty character match e.g. "{{^}}"). As noted, CHECK-EMPTY can't work there, although we could possibly make a special case for CHECK-EMPTY as the first check meaning check that that first line is empty. When I implemented CHECK-EMPTY, I didn't add this special-case behaviour, as my aim was to do a CHECK-NEXT: {{^$}} that didn't accidentally match the end of the previous line.

I don't think it's wise to allow CHECK-SAME or CHECK-NEXT as the first match, due to the ambiguity that might cause as you two have been discussing. I don't have an intuitive idea of which it should be, if I'm honest.

@probinson/@jdenny, can I just confirm that you're happy with this patch going in? I just want to make sure given the chatter re. CHECK-NEXT/CHECK-SAME...


Repository:
  rL LLVM

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

https://reviews.llvm.org/D58784





More information about the llvm-commits mailing list