summaryrefslogtreecommitdiffstats
path: root/gnu/llvm/docs/CommandGuide/FileCheck.rst
diff options
context:
space:
mode:
authorpatrick <patrick@openbsd.org>2019-06-23 21:36:31 +0000
committerpatrick <patrick@openbsd.org>2019-06-23 21:36:31 +0000
commit23f101f37937a1bd4a29726cab2f76e0fb038b35 (patch)
treef7da7d6b32c2e07114da399150bfa88d72187012 /gnu/llvm/docs/CommandGuide/FileCheck.rst
parentsort previous; ok deraadt (diff)
downloadwireguard-openbsd-23f101f37937a1bd4a29726cab2f76e0fb038b35.tar.xz
wireguard-openbsd-23f101f37937a1bd4a29726cab2f76e0fb038b35.zip
Import LLVM 8.0.0 release including clang, lld and lldb.
Diffstat (limited to 'gnu/llvm/docs/CommandGuide/FileCheck.rst')
-rw-r--r--gnu/llvm/docs/CommandGuide/FileCheck.rst43
1 files changed, 40 insertions, 3 deletions
diff --git a/gnu/llvm/docs/CommandGuide/FileCheck.rst b/gnu/llvm/docs/CommandGuide/FileCheck.rst
index b0324f40463..721d2c2e782 100644
--- a/gnu/llvm/docs/CommandGuide/FileCheck.rst
+++ b/gnu/llvm/docs/CommandGuide/FileCheck.rst
@@ -24,6 +24,9 @@ match. The file to verify is read from standard input unless the
OPTIONS
-------
+Options are parsed from the environment variable ``FILECHECK_OPTS``
+and from the command line.
+
.. option:: -help
Print a summary of command line options.
@@ -77,9 +80,16 @@ OPTIONS
-verify``. With this option FileCheck will verify that input does not contain
warnings not covered by any ``CHECK:`` patterns.
+.. option:: --dump-input <mode>
+
+ Dump input to stderr, adding annotations representing currently enabled
+ diagnostics. Do this either 'always', on 'fail', or 'never'. Specify 'help'
+ to explain the dump format and quit.
+
.. option:: --dump-input-on-failure
- When the check fails, dump all of the original input.
+ When the check fails, dump all of the original input. This option is
+ deprecated in favor of `--dump-input=fail`.
.. option:: --enable-var-scope
@@ -116,6 +126,10 @@ OPTIONS
as old tests are migrated to the new non-overlapping ``CHECK-DAG:``
implementation.
+.. option:: --color
+
+ Use colors in output (autodetected by default).
+
EXIT STATUS
-----------
@@ -270,9 +284,9 @@ you can use the "``CHECK-EMPTY:``" directive.
.. code-block:: llvm
- foo
+ declare void @foo()
- bar
+ declare void @bar()
; CHECK: foo
; CHECK-EMPTY:
; CHECK-NEXT: bar
@@ -304,6 +318,29 @@ can be used:
; CHECK: ret i8
}
+The "CHECK-COUNT:" directive
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+If you need to match multiple lines with the same pattern over and over again
+you can repeat a plain ``CHECK:`` as many times as needed. If that looks too
+boring you can instead use a counted check "``CHECK-COUNT-<num>:``", where
+``<num>`` is a positive decimal number. It will match the pattern exactly
+``<num>`` times, no more and no less. If you specified a custom check prefix,
+just use "``<PREFIX>-COUNT-<num>:``" for the same effect.
+Here is a simple example:
+
+.. code-block:: text
+
+ Loop at depth 1
+ Loop at depth 1
+ Loop at depth 1
+ Loop at depth 1
+ Loop at depth 2
+ Loop at depth 3
+
+ ; CHECK-COUNT-6: Loop at depth {{[0-9]+}}
+ ; CHECK-NOT: Loop at depth {{[0-9]+}}
+
The "CHECK-DAG:" directive
~~~~~~~~~~~~~~~~~~~~~~~~~~