diff options
author | Artem Belevich <tra@google.com> | 2017-03-09 17:59:04 +0000 |
---|---|---|
committer | Artem Belevich <tra@google.com> | 2017-03-09 17:59:04 +0000 |
commit | f55e72a5a0a2473c2851c2b2c172d2ed53d15b1c (patch) | |
tree | 6f85dc5d420bcc6e186fd9ca4c583a43c081eb19 /llvm/docs/CommandGuide | |
parent | a9520b94d56ba857284a3de9ba717116f884bb26 (diff) | |
download | bcm5719-llvm-f55e72a5a0a2473c2851c2b2c172d2ed53d15b1c.tar.gz bcm5719-llvm-f55e72a5a0a2473c2851c2b2c172d2ed53d15b1c.zip |
[FileCheck] Added --enable-var-scope option to enable scope for regex variables.
If `--enable-var-scope` is in effect, variables with names that
start with `$` are considered to be global. All other variables are
local. All local variables get undefined at the beginning of each
CHECK-LABEL block. Global variables are not affected by CHECK-LABEL.
This makes it easier to ensure that individual tests are not affected
by variables set in preceding tests.
Differential Revision: https://reviews.llvm.org/D30749
llvm-svn: 297396
Diffstat (limited to 'llvm/docs/CommandGuide')
-rw-r--r-- | llvm/docs/CommandGuide/FileCheck.rst | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/llvm/docs/CommandGuide/FileCheck.rst b/llvm/docs/CommandGuide/FileCheck.rst index 413b6f41b0c..8830c394b21 100644 --- a/llvm/docs/CommandGuide/FileCheck.rst +++ b/llvm/docs/CommandGuide/FileCheck.rst @@ -77,6 +77,15 @@ OPTIONS -verify``. With this option FileCheck will verify that input does not contain warnings not covered by any ``CHECK:`` patterns. +.. option:: --enable-var-scope + + Enables scope for regex variables. + + Variables with names that start with ``$`` are considered global and + remain set throughout the file. + + All other variables get undefined after each encountered ``CHECK-LABEL``. + .. option:: -version Show the version number of this program. @@ -344,6 +353,9 @@ matched by the directive cannot also be matched by any other check present in other unique identifiers. Conceptually, the presence of ``CHECK-LABEL`` divides the input stream into separate blocks, each of which is processed independently, preventing a ``CHECK:`` directive in one block matching a line in another block. +If ``--enable-var-scope`` is in effect, all local variables are cleared at the +beginning of the block. + For example, .. code-block:: llvm @@ -436,6 +448,13 @@ were defined on. For example: Can be useful if you want the operands of ``op`` to be the same register, and don't care exactly which register it is. +If ``--enable-var-scope`` is in effect, variables with names that +start with ``$`` are considered to be global. All others variables are +local. All local variables get undefined at the beginning of each +CHECK-LABEL block. Global variables are not affected by CHECK-LABEL. +This makes it easier to ensure that individual tests are not affected +by variables set in preceding tests. + FileCheck Expressions ~~~~~~~~~~~~~~~~~~~~~ |