[PATCH] D132513: [lit] Implement DEFINE and REDEFINE directives

James Henderson via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Aug 24 00:41:10 PDT 2022


jhenderson added a comment.

I haven't got the time to review this right now, but I wanted to say a big thank you for working on this. I've wanted the ability to specify my own substitutions within a test for a long time now. I experimented with a CHECK-DEFINE pattern for FileCheck, since I only needed it in the context of FileCheck check patterns, but this will do the job perfectly: we can use it in conjunction with FileCheck's -D option for crazy shenanigans like reusing the same string in both positive and negative checks, or swapping around the meaning of certain variables (by naming them differently). As a bonus of this design, it also could be used to rerun the same FileCheck invocation, but with different sets of prefixes, without having to repeat everything else.

One question I do have: why do we need both DEFINE and REDEFINE? I personally would think that just DEFINE would be enough, with it implicitly replacing any existing substitution. Or is it something to do with substitution order?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D132513



More information about the llvm-commits mailing list