aboutsummaryrefslogtreecommitdiff
path: root/llvm/docs/CommandGuide/FileCheck.rst
diff options
context:
space:
mode:
authorThomas Preud'homme <thomasp@graphcore.ai>2020-06-11 16:14:24 +0100
committerThomas Preud'homme <thomasp@graphcore.ai>2021-03-12 18:14:17 +0000
commitf9e2a62cc594c96194908a3ac4804caa07f86ba6 (patch)
tree4b8cc4ded5871af4f417cd94e3f74d620dbb9cdc /llvm/docs/CommandGuide/FileCheck.rst
parent4affd0c40eccbce921f185e1e09f84f8194cd4cf (diff)
downloadllvm-f9e2a62cc594c96194908a3ac4804caa07f86ba6.zip
llvm-f9e2a62cc594c96194908a3ac4804caa07f86ba6.tar.gz
llvm-f9e2a62cc594c96194908a3ac4804caa07f86ba6.tar.bz2
[FileCheck] Add support for hex alternate form in FileCheck
Add printf-style alternate form flag to prefix hex number with 0x when present. 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 specifier><format specifier>, ...] where <precision specifier> and <format specifier> are optional and ... can be a variable definition or not with an empty expression or not. This feature was requested in https://reviews.llvm.org/D81144#2075532 for llvm/test/MC/ELF/gen-dwarf64.s Reviewed By: jdenny Differential Revision: https://reviews.llvm.org/D97845
Diffstat (limited to 'llvm/docs/CommandGuide/FileCheck.rst')
-rw-r--r--llvm/docs/CommandGuide/FileCheck.rst5
1 files changed, 4 insertions, 1 deletions
diff --git a/llvm/docs/CommandGuide/FileCheck.rst b/llvm/docs/CommandGuide/FileCheck.rst
index 398cce1..a4e3e06 100644
--- a/llvm/docs/CommandGuide/FileCheck.rst
+++ b/llvm/docs/CommandGuide/FileCheck.rst
@@ -773,8 +773,11 @@ The syntax to capture a numeric value is
* ``<NUMVAR>:`` is an optional definition of variable ``<NUMVAR>`` from the
captured value.
-The syntax of ``<fmtspec>`` is: ``.<precision><conversion specifier>`` where:
+The syntax of ``<fmtspec>`` is: ``#.<precision><conversion specifier>`` where:
+* ``#`` is an optional flag available for hex values (see
+ ``<conversion specifier>`` below) which requires the value matched to be
+ prefixed by ``0x``.
* ``.<precision>`` is an optional printf-style precision specifier in which
``<precision>`` indicates the minimum number of digits that the value matched
must have, expecting leading zeros if needed.