[PATCH] D64923: [FileCheck]] Canonicalize caret location testing

Thomas Preud'homme via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Jul 18 08:35:18 PDT 2019


thopre added a comment.

I've reintroduced the {{$}} in end of lines because it is clear the intent was to test the whole lines in existing tests.



================
Comment at: llvm/test/FileCheck/numeric-defines-diagnostics.txt:9
+NUMERRCLIFMT-NEXT:Global define #1: #10VALUE=10 (parsed as: {{\[\[#10VALUE:10\]\]}})
+NUMERRCLIFMT-NEXT:                                             ^
 
----------------
jhenderson wrote:
> Up to you whether you do this, as you may not like it, but I recently realised that you could add leading spaces before the `NUMERRCLIFMT:` tag to make it line up nicely, whilst still honouring --match-full-lines. Something like:
> ```
> NUMERRCLIFMT-NEXT:Global define #1: #10VALUE=10 (parsed as: {{\[\[#10
>     NUMERRCLIFMT-NEXT:                                             ^
> ```
It help show the intent but makes it more difficult to check that the test is correct since the reader has to trust the test writer that the number of space at the beginning of the line equates the number of escape and syntax characters. All in all it's a gain for a loss IMHO so I'm happy to follow your suggestion.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D64923





More information about the llvm-commits mailing list