[PATCH] D77227: [RFC][FileCheck] Require colon immediately after CHECK directives

Joel E. Denny via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Apr 2 14:39:12 PDT 2020


jdenny added inline comments.


================
Comment at: llvm/lib/Support/FileCheck.cpp:1131-1145
+    {Check::CheckNext, "NEXT"},
+    {Check::CheckSame, "SAME"},
+    {Check::CheckNot, "NOT"},
+    {Check::CheckDAG, "DAG"},
+    {Check::CheckLabel, "LABEL"},
+    {Check::CheckEmpty, "EMPTY"},
+    {Check::CheckBadNot, "DAG-NOT"},
----------------
jdenny wrote:
> I believe you need to change the order here.  For example, CHECK-NEXT-NOT will match CHECK-NEXT and then be ignored.  Likewise for CHECK-NOT-NEXT and CHECK-NOT.
> 
> If FileCheck's test suite doesn't already cover cases like that, now would be a good time to extend it.  It might not be a bad idea to move all that into a parent patch as the refactoring and tests seems worthwhile independently of the new diagnostic.
Oh, and please add a comment explaining why order here matters.


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