summaryrefslogtreecommitdiffstats
path: root/llvm/docs/CommandGuide/FileCheck.rst
diff options
context:
space:
mode:
authorWolfgang Pieb <Wolfgang.Pieb@sony.com>2016-06-27 23:59:00 +0000
committerWolfgang Pieb <Wolfgang.Pieb@sony.com>2016-06-27 23:59:00 +0000
commit0b4509e9e67834ddf6dba062343a8a0e5ea1c11c (patch)
treefdd6165787622c53491993d2a576982363a06fc4 /llvm/docs/CommandGuide/FileCheck.rst
parentdca834089a88ab6c8aef2cdb496e1260906e7462 (diff)
downloadbcm5719-llvm-0b4509e9e67834ddf6dba062343a8a0e5ea1c11c.tar.gz
bcm5719-llvm-0b4509e9e67834ddf6dba062343a8a0e5ea1c11c.zip
Document the ability to perform multi-line pattern matching in FileCheck.
Differential review: http://reviews.llvm.org/D21522 llvm-svn: 273962
Diffstat (limited to 'llvm/docs/CommandGuide/FileCheck.rst')
-rw-r--r--llvm/docs/CommandGuide/FileCheck.rst19
1 files changed, 19 insertions, 0 deletions
diff --git a/llvm/docs/CommandGuide/FileCheck.rst b/llvm/docs/CommandGuide/FileCheck.rst
index 3e4c29f1572..a0ca1bfe52f 100644
--- a/llvm/docs/CommandGuide/FileCheck.rst
+++ b/llvm/docs/CommandGuide/FileCheck.rst
@@ -461,3 +461,22 @@ relative line number references, for example:
// CHECK-NEXT: {{^ ;}}
int a
+Matching Newline Characters
+~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+To match newline characters in regular expressions the character class
+``[[:space:]]`` can be used. For example, the following pattern:
+
+.. code-block:: c++
+
+ // CHECK: DW_AT_location [DW_FORM_sec_offset] ([[DLOC:0x[0-9a-f]+]]){{[[:space:]].*}}"intd"
+
+matches output of the form (from llvm-dwarfdump):
+
+.. code-block:: llvm
+
+ DW_AT_location [DW_FORM_sec_offset] (0x00000233)
+ DW_AT_name [DW_FORM_strp] ( .debug_str[0x000000c9] = "intd")
+
+letting us set the :program:`FileCheck` variable ``DLOC`` to the desired value
+``0x00000233``, extracted from the line immediately preceding "``intd``".
OpenPOWER on IntegriCloud