diff options
author | Thomas Preud'homme <thomasp@graphcore.ai> | 2019-03-05 23:20:29 +0000 |
---|---|---|
committer | Thomas Preud'homme <thomasp@graphcore.ai> | 2020-05-28 10:44:21 +0100 |
commit | 23ac16cf9bd4cc0bb434efcf6385baf083a2ff7b (patch) | |
tree | 46818cd084b23be7667f6cd43350d0932ef4e563 /llvm/docs/CommandGuide/FileCheck.rst | |
parent | e533a176b3d4d936a4870cd1a3273941ba699882 (diff) | |
download | llvm-23ac16cf9bd4cc0bb434efcf6385baf083a2ff7b.zip llvm-23ac16cf9bd4cc0bb434efcf6385baf083a2ff7b.tar.gz llvm-23ac16cf9bd4cc0bb434efcf6385baf083a2ff7b.tar.bz2 |
FileCheck [10/12]: Add support for signed numeric values
Summary:
This patch is part of a patch series to add support for FileCheck
numeric expressions. This specific patch adds support signed numeric
values, thus allowing negative numeric values.
As such, the patch adds a new class to represent a signed or unsigned
value and add the logic for type promotion and type conversion in
numeric expression mixing signed and unsigned values. It also adds
the %d format specifier to represent signed value.
Finally, it also adds underflow and overflow detection when performing a
binary operation.
Copyright:
- Linaro (changes up to diff 183612 of revision D55940)
- GraphCore (changes in later versions of revision D55940 and
in new revision created off D55940)
Reviewers: jhenderson, chandlerc, jdenny, probinson, grimar, arichardson
Reviewed By: jhenderson, arichardson
Subscribers: MaskRay, hiraditya, llvm-commits, probinson, dblaikie, grimar, arichardson, kristina, hfinkel, rogfer01, JonChesterfield
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D60390
Diffstat (limited to 'llvm/docs/CommandGuide/FileCheck.rst')
-rw-r--r-- | llvm/docs/CommandGuide/FileCheck.rst | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/llvm/docs/CommandGuide/FileCheck.rst b/llvm/docs/CommandGuide/FileCheck.rst index d8a2e34..0512133 100644 --- a/llvm/docs/CommandGuide/FileCheck.rst +++ b/llvm/docs/CommandGuide/FileCheck.rst @@ -660,8 +660,8 @@ The syntax to define a numeric variable is ``[[#%<fmtspec>,<NUMVAR>:]]`` where: * ``%<fmtspec>`` is an optional scanf-style matching format specifier to indicate what number format to match (e.g. hex number). Currently accepted - format specifiers are ``%u``, ``%x`` and ``%X``. If absent, the format - specifier defaults to ``%u``. + format specifiers are ``%u``, ``%d``, ``%x`` and ``%X``. If absent, the + format specifier defaults to ``%u``. * ``<NUMVAR>`` is the name of the numeric variable to define to the matching value. @@ -692,10 +692,11 @@ The syntax of a numeric substitution is ``[[#%<fmtspec>,<expr>]]`` where: * an expression followed by an operator and a numeric operand. A numeric operand is a previously defined numeric variable, or an integer - literal. The supported operators are ``+`` and ``-``. Spaces are accepted - before, after and between any of these elements. - There is currently no support for operator precendence, but parentheses can - be used to change the evaluation order. + literal and have a 64-bit precision. The supported operators are ``+`` and + ``-``. Spaces are accepted before, after and between any of these elements. + Overflow and underflow are rejected. There is currently no support for + operator precendence, but parentheses can be used to change the evaluation + order. For example: |