[PATCH] D65707: [FileCheck] Document FILECHECK_OPTS in -help

Thomas Preud'homme via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Aug 5 13:47:38 PDT 2019


thopre accepted this revision.
thopre marked an inline comment as done.
thopre added a comment.
This revision is now accepted and ready to land.

LGTM.



================
Comment at: llvm/utils/FileCheck/FileCheck.cpp:27-29
+static cl::extrahelp FileCheckOptsEnv(
+    "\nOptions are parsed from the environment variable FILECHECK_OPTS and\n"
+    "from the command line.\n");
----------------
jdenny wrote:
> thopre wrote:
> > Do I read this right and the options in effect are the union of those specified in FILECHECK_OPTS and those on the command-line?
> Yes.
> 
> Interestingly, `FILECHECK_OPTS` is parsed before command-line options.  However, at the time I implemented `FILECHECK_OPTS`, the only option I found where the order of multiple occurrences mattered was `-D`, and it gives precedence to earlier occurrences.  That's surely wrong, and I think multiple definitions for the same variable should be an error instead, but I haven't found time to propose something.
Alright, LGTM then. I'm not sure about forbidding multiple definitions of the same variable, I think it makes sense to redefine a variable in a CHECK directive (eg. lots of tests with REG being defined, although --enable-var-scope should probably be used in that case). It makes less sense on the command-line for sure and I would agree making it an error.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D65707





More information about the llvm-commits mailing list