diff options
author | Sjoerd Meijer <sjoerd.meijer@arm.com> | 2017-10-13 14:02:36 +0000 |
---|---|---|
committer | Sjoerd Meijer <sjoerd.meijer@arm.com> | 2017-10-13 14:02:36 +0000 |
commit | 9a26a7ec331e01fdf2a9438eff10d901420c1c27 (patch) | |
tree | 438bfab494ffb230fd4223b6a4f711ca7a475305 /llvm/docs/CommandGuide/FileCheck.rst | |
parent | d029234fc6d10b6143e7501abf3c72222721fe8b (diff) | |
download | bcm5719-llvm-9a26a7ec331e01fdf2a9438eff10d901420c1c27.tar.gz bcm5719-llvm-9a26a7ec331e01fdf2a9438eff10d901420c1c27.zip |
[FileCheck] regexp doc update/fix
Minor doc update that the FileCheck matcher supports POSIX ERE.
It also fixes a minor issue in the regexp describing a variable
name: underscores are allowed too.
Differential Revision: https://reviews.llvm.org/D38787
llvm-svn: 315679
Diffstat (limited to 'llvm/docs/CommandGuide/FileCheck.rst')
-rw-r--r-- | llvm/docs/CommandGuide/FileCheck.rst | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/llvm/docs/CommandGuide/FileCheck.rst b/llvm/docs/CommandGuide/FileCheck.rst index 8830c394b21..44cc57cebaf 100644 --- a/llvm/docs/CommandGuide/FileCheck.rst +++ b/llvm/docs/CommandGuide/FileCheck.rst @@ -397,10 +397,11 @@ All FileCheck directives take a pattern to match. For most uses of FileCheck, fixed string matching is perfectly sufficient. For some things, a more flexible form of matching is desired. To support this, FileCheck allows you to specify regular expressions in matching strings, -surrounded by double braces: ``{{yourregex}}``. Because we want to use fixed -string matching for a majority of what we do, FileCheck has been designed to -support mixing and matching fixed string matching with regular expressions. -This allows you to write things like this: +surrounded by double braces: ``{{yourregex}}``. FileCheck implements a POSIX +regular expression matcher; it supports Extended POSIX regular expressions +(ERE). Because we want to use fixed string matching for a majority of what we +do, FileCheck has been designed to support mixing and matching fixed string +matching with regular expressions. This allows you to write things like this: .. code-block:: llvm @@ -434,7 +435,7 @@ The first check line matches a regex ``%[a-z]+`` and captures it into the variable ``REGISTER``. The second line verifies that whatever is in ``REGISTER`` occurs later in the file after an "``andw``". :program:`FileCheck` variable references are always contained in ``[[ ]]`` pairs, and their names can -be formed with the regex ``[a-zA-Z][a-zA-Z0-9]*``. If a colon follows the name, +be formed with the regex ``[a-zA-Z_][a-zA-Z0-9_]*``. If a colon follows the name, then it is a definition of the variable; otherwise, it is a use. :program:`FileCheck` variables can be defined multiple times, and uses always |