[all-commits] [llvm/llvm-project] 998709: [FileCheck] Add precision to format specifier

RoboTux via All-commits all-commits at lists.llvm.org
Sun Aug 30 11:40:55 PDT 2020


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: 998709b7d553e89c4ff89725d3fa646468b7b437
      https://github.com/llvm/llvm-project/commit/998709b7d553e89c4ff89725d3fa646468b7b437
  Author: Thomas Preud'homme <thomasp at graphcore.ai>
  Date:   2020-08-30 (Sun, 30 Aug 2020)

  Changed paths:
    M llvm/docs/CommandGuide/FileCheck.rst
    M llvm/lib/Support/FileCheck.cpp
    M llvm/lib/Support/FileCheckImpl.h
    M llvm/test/FileCheck/numeric-expression.txt
    M llvm/unittests/Support/FileCheckTest.cpp

  Log Message:
  -----------
  [FileCheck] Add precision to format specifier

Add printf-style precision specifier to pad numbers to a given number of
digits when matching them if the value is smaller than the given
precision. This works on both empty numeric expression (e.g. variable
definition from input) and when matching a numeric expression. The
syntax is as follows:

[[#%.<precision><format specifier>, ...]

where <format specifier> is optional and ... can be a variable
definition or not with an empty expression or not. In the absence of a
precision specifier, a variable definition will accept leading zeros.

Reviewed By: jhenderson, grimar

Differential Revision: https://reviews.llvm.org/D81667




More information about the All-commits mailing list