diff options
author | Thomas Preud'homme <thomasp@graphcore.ai> | 2019-07-13 13:24:30 +0000 |
---|---|---|
committer | Thomas Preud'homme <thomasp@graphcore.ai> | 2019-07-13 13:24:30 +0000 |
commit | 2a7f5204602938ae89b0860e9412603d1951d945 (patch) | |
tree | 71376564c9ec72b8d0e10d77eddef856596e78ff /llvm/docs/CommandGuide/FileCheck.rst | |
parent | 22cc1030f6a9afd14cc48ec0b935ebe8678c0c2e (diff) | |
download | llvm-2a7f5204602938ae89b0860e9412603d1951d945.zip llvm-2a7f5204602938ae89b0860e9412603d1951d945.tar.gz llvm-2a7f5204602938ae89b0860e9412603d1951d945.tar.bz2 |
FileCheck [7/12]: Arbitrary long numeric expressions
Summary:
This patch is part of a patch series to add support for FileCheck
numeric expressions. This specific patch extend numeric expression to
support an arbitrary number of operands, either variable or literals.
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, rnk
Subscribers: hiraditya, llvm-commits, probinson, dblaikie, grimar, arichardson, tra, rnk, kristina, hfinkel, rogfer01, JonChesterfield
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D60387
llvm-svn: 366001
Diffstat (limited to 'llvm/docs/CommandGuide/FileCheck.rst')
-rw-r--r-- | llvm/docs/CommandGuide/FileCheck.rst | 25 |
1 files changed, 12 insertions, 13 deletions
diff --git a/llvm/docs/CommandGuide/FileCheck.rst b/llvm/docs/CommandGuide/FileCheck.rst index a424606..0aa2d89 100644 --- a/llvm/docs/CommandGuide/FileCheck.rst +++ b/llvm/docs/CommandGuide/FileCheck.rst @@ -107,10 +107,12 @@ and from the command line. Sets a filecheck pattern variable ``VAR`` with value ``VALUE`` that can be used in ``CHECK:`` lines. -.. option:: -D#<NUMVAR>=<VALUE> +.. option:: -D#<NUMVAR>=<VALUE EXPRESSION> - Sets a filecheck numeric variable ``NUMVAR`` to ``<VALUE>`` that can be used - in ``CHECK:`` lines. + Sets a filecheck numeric variable ``NUMVAR`` to the result of evaluating + ``<VALUE EXPRESSION>`` that can be used in ``CHECK:`` lines. See section + ``FileCheck Numeric Variables and Expressions`` for details on the format + and meaning of ``<VALUE EXPRESSION>``. .. option:: -version @@ -590,18 +592,15 @@ For example: would match ``mov r5, 42`` and set ``REG`` to the value ``5``. -The syntax of a numeric substitution is ``[[#<NUMVAR><op><offset>]]`` where: +The syntax of a numeric substitution is ``[[#<expr>]]`` where ``<expr>`` is an +expression. An expression is recursively defined as: -* ``<NUMVAR>`` is the name of a defined numeric variable. +* a numeric operand, or +* an expression followed by an operator and a numeric operand. -* ``<op>`` is an optional operation to perform on the value of ``<NUMVAR>``. - Currently supported operations are ``+`` and ``-``. - -* ``<offset>`` is the immediate value that constitutes the second operand of - the operation ``<op>``. It must be present if ``<op>`` is present, absent - otherwise. - -Spaces are accepted before, after and between any of these elements. +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. For example: |