[PATCH] D60389: FileCheck [9/12]: Add support for matching formats

Thomas Preud'homme via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Jan 3 12:42:13 PST 2020


thopre added inline comments.


================
Comment at: llvm/test/FileCheck/numeric-defines.txt:54
+
+RUN: %ProtectFileCheckOutput \
+RUN: not FileCheck -D#%X,NUMVAL3=7 -D#%X,NUMVAL4=12 --check-prefix CHECKNUM3 --input-file %s %s 2>&1 \
----------------
jhenderson wrote:
> I'm not familiar with this "%ProtectFileCheckOutput". What is it for, and why do only some cases seem to use it?
This is used when parsing the output of FileCheck to avoid things such as localization, see https://reviews.llvm.org/D65121 for more details


================
Comment at: llvm/unittests/Support/FileCheckTest.cpp:43
+  EXPECT_EQ(HexLowerFormat.getMatchingString(11), "b");
+  Val = HexLowerFormat.valueFromStringRepr(ALower, SM);
+  ASSERT_TRUE(bool(Val));
----------------
jhenderson wrote:
> It might be interesting to show what happens when you pass an upper-case hex digit to a lower-case format and vice versa.
valueFromStringRepr does not give an error in that case as it expects the value to match the format. This is because getAsInteger does not allow to check for the casing and I don't want to make the function more complex by checking it.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D60389





More information about the llvm-commits mailing list