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

James Henderson via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Jun 26 07:03:44 PDT 2018


jhenderson added inline comments.


================
Comment at: test/FileCheck/check-empty-tag.txt:13
+CHECK2A: the next line has spaces
+CHECK2A-EMPTY:
+CHECK2B: expected string not found in input
----------------
probinson wrote:
> 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.
> 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 thought of that at the time I originally wrote this, but it doesn't because of the "--match-full-lines" switch, since the "CHECK2A:" prefix prevents matching there.

I'm not sure I follow the need for a regex?


================
Comment at: utils/FileCheck/FileCheck.cpp:867
+    StringRef UsedPrefix =
+        FindFirstMatchingPrefix(PrefixRE, Buffer, LineNumber, CheckTy);
     if (UsedPrefix.empty())
----------------
probinson wrote:
> Spurious reformatting?
This came about because that's what my clang-format did, but you're right, it's not related to this change.


Repository:
  rL LLVM

https://reviews.llvm.org/D28896





More information about the llvm-commits mailing list