[PATCH] D130981: [yaml2obj] Add a `-E` flag to preprocess only.

Simon Tatham via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Aug 8 05:48:48 PDT 2022


simon_tatham added inline comments.


================
Comment at: llvm/test/tools/yaml2obj/preprocess-only.test:3-7
+This is a test of yaml2obj's pure preprocessing mode, so it doesn't
+have to contain valid YAML, or any YAML at all. But we do have to be
+careful with the FileCheck CHECK directives, because they'll be
+emitted into the preprocessed output, and risk matching themselves!
+For that reason, each one matches only at the start of a line.
----------------
jhenderson wrote:
> Probably not worth changing the test now that it's written (although I won't object if you choose to change things), but I think you could have avoided this by having the "YAML" in a separate file to the test in this case right?
I suppose so, although if anyone wants to update this test later (say if they were to add extra features to the preprocessor), that trades off one inconvenience for another – this way they get to put each test preprocessor input and its expected expansion together and see them both at once, even if they have to write the expansion in the form of a slightly awkward regex.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D130981



More information about the llvm-commits mailing list