aboutsummaryrefslogtreecommitdiff
path: root/llvm/docs/CommandGuide/FileCheck.rst
diff options
context:
space:
mode:
authorThomas Preud'homme <thomasp@graphcore.ai>2019-07-17 16:15:52 +0100
committerThomas Preud'homme <thomasp@graphcore.ai>2020-06-10 15:56:10 +0100
commit47934c7cf9f6c18e21a34f9324680652214f771e (patch)
treeaecb16d3a40e759e1fcca79347f82d28f03731f2 /llvm/docs/CommandGuide/FileCheck.rst
parent9daccb7a477b8cf2448dab35ae2779a4b36c2b63 (diff)
downloadllvm-47934c7cf9f6c18e21a34f9324680652214f771e.zip
llvm-47934c7cf9f6c18e21a34f9324680652214f771e.tar.gz
llvm-47934c7cf9f6c18e21a34f9324680652214f771e.tar.bz2
FileCheck [11/12]: Add matching constraint specification
This patch is part of a patch series to add support for FileCheck numeric expressions. This specific patch adds support for specifying the matching constraint for a numeric expression, ie. how the value being matched should relate to the numeric expression. This commit only adds the equality constraint where the numeric value matched must be equal to the numeric expression. It is the default matching constraint used when not specified. It is added to provision other matching constraint (e.g. inequality relations). 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) Reviewed By: jhenderson Differential Revision: https://reviews.llvm.org/D60391
Diffstat (limited to 'llvm/docs/CommandGuide/FileCheck.rst')
-rw-r--r--llvm/docs/CommandGuide/FileCheck.rst20
1 files changed, 14 insertions, 6 deletions
diff --git a/llvm/docs/CommandGuide/FileCheck.rst b/llvm/docs/CommandGuide/FileCheck.rst
index 8199258..0f72b41 100644
--- a/llvm/docs/CommandGuide/FileCheck.rst
+++ b/llvm/docs/CommandGuide/FileCheck.rst
@@ -670,7 +670,8 @@ For example:
would match ``mov r5, 0xF0F0`` and set ``REG`` to the value ``5`` and ``IMM``
to the value ``0xF0F0``.
-The syntax of a numeric substitution is ``[[#%<fmtspec>,<expr>]]`` where:
+The syntax of a numeric substitution is
+``[[#%<fmtspec>: <constraint> <expr>]]`` where:
* ``%<fmtspec>`` is the same matching format specifier as for defining numeric
variables but acting as a printf-style format to indicate how a numeric
@@ -680,6 +681,12 @@ The syntax of a numeric substitution is ``[[#%<fmtspec>,<expr>]]`` where:
is used. In case of conflict between matching formats of several numeric
variables the format specifier is mandatory.
+* ``<constraint>`` is the constraint describing how the value to match must
+ relate to the value of the numeric expression. The only currently accepted
+ constraint is ``==`` for an exact match and is the default if
+ ``<constraint>`` is not provided. No matching constraint must be specified
+ when the ``<expr>`` is empty.
+
* ``<expr>`` is an expression. An expression is in turn recursively defined
as:
@@ -747,11 +754,12 @@ does not matter:
to check that a value is synthesized rather than moved around.
A numeric variable can also be defined to the result of a numeric expression,
-in which case the numeric expression is checked and if verified the variable is
-assigned to the value. The unified syntax for both defining numeric variables
-and checking a numeric expression is thus ``[[#%<fmtspec>,<NUMVAR>: <expr>]]``
-with each element as described previously. One can use this syntax to make a
-testcase more self-describing by using variables instead of values:
+in which case the numeric expression constraint is checked and if verified the
+variable is assigned to the value. The unified syntax for both defining numeric
+variables and checking a numeric expression is thus
+``[[#%<fmtspec>,<NUMVAR>: <constraint> <expr>]]`` with each element as
+described previously. One can use this syntax to make a testcase more
+self-describing by using variables instead of values:
.. code-block:: gas