[llvm] [llvm-lit] Print environment variables when using env without subcommand (PR #98414)
Thomas Preud'homme via llvm-commits
llvm-commits at lists.llvm.org
Mon Aug 12 05:11:29 PDT 2024
RoboTux wrote:
>
> Just spelling out what the regex means, because I've tripped myself up at least twice trying to interpret it. `^` means "start of line". `[^#]` means "any character except `#`. Combined they mean "match a non-empty line that does not start with `#`". `CHECK-NOT` instructs FileCheck to fail if it sees the specified between the previous thing it matched and the next thing it matches, so the combined effect is to fail the test if, between the previous and next patterns, a non-empty line _without_ a leading `#` appears. In other words, it will NOT fail if it sees e.g. `# error:` in the output, because of the leading `#` (and based on the checks elsewhere in the file, I assume that is indeed the format that errors will be printed in). Could somebody confirm that I'm not making a mistake?
That would be my reading as well.,Therefore I think "CHECK-NOT: # error: " is a better test but I think we should also split Inputs/shtest-env/* into a positive and negative tests and split shtest-env.py in two accordingly. This would allow to use RUN: %{lit} instead of RUN: not %{lit} thus guaranteeing that lit does not return an error.
https://github.com/llvm/llvm-project/pull/98414
More information about the llvm-commits
mailing list