[PATCH] D77227: [RFC][FileCheck] Require colon immediately after CHECK directives
Paul Robinson via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Wed Apr 1 15:45:50 PDT 2020
probinson added a comment.
In D77227#1955767 <https://reviews.llvm.org/D77227#1955767>, @jroelofs wrote:
> In D77227#1955727 <https://reviews.llvm.org/D77227#1955727>, @jdenny wrote:
>
> > In D77227#1955596 <https://reviews.llvm.org/D77227#1955596>, @probinson wrote:
> >
> > > Okay, 1500+ tests to fix seems excessive. Requiring CHECK directives to be on lines by themselves (with optional comment) is more restrictive than the LLVM test suite can tolerate.
> >
> >
> > Maybe the right rule should be that it *either* appears on a line by itself *or* at the beginning of some single-line comment style (which might not be at the beginning of a line).
>
>
> So only diagnose if it meets those conditions (with some inferred comment delimiter based on file extension/flag?), but is also missing the colon?
Right, once you find a check-prefix, you look at the text before it on the line, which must either be all whitespace, or arbitrary text terminated by a comment delimiter. I wouldn't get fancy about aligning delimiters with file types; the set is pretty small, basically `# // ;` should cover essentially everything.
The above rule would exclude nearly everything that my "grep" sequence found, that wasn't really a mistake.
Now, there are tests in the list that my "grep" sequence found, that have comment blocks along the lines of
; CHECK1 - look for one thing
; CHECK2 - look for another thing
; CHECK3 - look for something else
which of course look exactly like the mistakes we're trying to find. We could "fix" those tests (there weren't many, IIRC) by inserting some non-comment text before the check-prefix name, and maybe we can live with that restriction.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D77227/new/
https://reviews.llvm.org/D77227
More information about the llvm-commits
mailing list