[PATCH] D81667: [RFC, FileCheck] Add precision to format specifier

James Henderson via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Jun 18 00:30:50 PDT 2020


jhenderson added a comment.

In D81667#2098944 <https://reviews.llvm.org/D81667#2098944>, @jdenny wrote:

> > I'd expect 0x[[#%.8x, ADDR:]] to match 00001234 or FFFFFFFF12345678 but not 1234 due to there not being enough digits.
>
> OK, it would expect a value that could have been printed by printf with `%.8x`.


FWIW, this is what I'm imagining the overall behaviour to be. If printf could have produced the output for a given format specifier, we should accept it, and conversely if it can't produce the output for a given format specifier, we shouldn't accept it.

I'm not sure whether we should consume all digits before applying the precision check or not though. I can see benefits for either side.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D81667





More information about the llvm-commits mailing list