[PATCH] D60392: FileCheck [12/12]: Support use of var defined on same line

Joel E. Denny via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Dec 13 13:04:56 PST 2021


jdenny added a comment.

In D60392#3188307 <https://reviews.llvm.org/D60392#3188307>, @jhenderson wrote:

> In D60392#3184854 <https://reviews.llvm.org/D60392#3184854>, @thopre wrote:
>
>> In D60392#3184688 <https://reviews.llvm.org/D60392#3184688>, @jhenderson wrote:
>>
>>> Regarding the CHECK-ASSERT suggestion, do we need it? I was under the impression one of the earlier patches added a syntax like `[[#VAR2, VAR1 + 3:]]` or something to that effect, which achieves the same thing, right? Maybe I'm missing something though.
>>
>> You mean `[[#VAR2:VAR1+3]]`? Why does that prevent the need for something like CHECK-ASSERT? You still can only refer to a variable defined in an earlier line.
>
> Looking back at the example, I guess it doesn't, although you could use CHECK-SAME to achieve the same effect, I think. More generally, I'm not sure how much I like the idea of checks that don't actually match anything, but I could be persuaded, especially if we can leverage the same functionality to support the CHECK-DEFINE concept I proposed previously (but never got as far as finishing off).

I too would like a `CHECK-DEFINE`.  Conceptually at least, I imagine `CHECK-DEFINE` or `CHECK-ASSERT` would match an empty string at the start of its search range (that is, end of the previous match or beginning of input if none).  Giving it a match location in this way should help with diagnostics, such as `-dump-input`.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D60392



More information about the llvm-commits mailing list