[PATCH] D28896: [FileCheck] Add directive for checking for blank lines

Paul Robinson via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Jun 22 10:59:49 PDT 2018


probinson added a comment.

Bowing to popular demand.



================
Comment at: test/FileCheck/check-empty-tag.txt:13
+CHECK2A: the next line has spaces
+CHECK2A-EMPTY:
+CHECK2B: expected string not found in input
----------------
I believe this CHECK2A: line will match itself, and the "next line" therefore has a CHECK2A-EMPTY directive on it.  If you run FileCheck manually I think you'll see that from the line number reported by the error.
I see that you are intending to match a line at the end of this file.  To achieve that you want to add some kind of regex to the CHECK2A line.  Something like `the {{next}} line has spaces` would work.


================
Comment at: utils/FileCheck/FileCheck.cpp:470
 
-
 /// Computes an arbitrary estimate for the quality of matching this pattern at
 /// the start of \p Buffer; a distance of zero should correspond to a perfect
----------------
Spurious whitespace difference.


================
Comment at: utils/FileCheck/FileCheck.cpp:755
       Rest.startswith("SAME-NOT:") || Rest.startswith("NOT-SAME:"))
     return Check::CheckBadNot;
 
----------------
Disallow EMPTY-NOT and NOT-EMPTY.


================
Comment at: utils/FileCheck/FileCheck.cpp:867
+    StringRef UsedPrefix =
+        FindFirstMatchingPrefix(PrefixRE, Buffer, LineNumber, CheckTy);
     if (UsedPrefix.empty())
----------------
Spurious reformatting?


https://reviews.llvm.org/D28896





More information about the llvm-commits mailing list