llvm.org GIT mirror llvm / f64136c
Document the ability to perform multi-line pattern matching in FileCheck. Differential review: http://reviews.llvm.org/D21522 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@273962 91177308-0d34-0410-b5e6-96231b3b80d8 Wolfgang Pieb 3 years ago
1 changed file(s) with 19 addition(s) and 0 deletion(s). Raw diff Collapse all Expand all
460460 // CHECK-NEXT: {{^ ;}}
461461 int a
462462
463 Matching Newline Characters
464 ~~~~~~~~~~~~~~~~~~~~~~~~~~~
465
466 To match newline characters in regular expressions the character class
467 ``[[:space:]]`` can be used. For example, the following pattern:
468
469 .. code-block:: c++
470
471 // CHECK: DW_AT_location [DW_FORM_sec_offset] ([[DLOC:0x[0-9a-f]+]]){{[[:space:]].*}}"intd"
472
473 matches output of the form (from llvm-dwarfdump):
474
475 .. code-block:: llvm
476
477 DW_AT_location [DW_FORM_sec_offset] (0x00000233)
478 DW_AT_name [DW_FORM_strp] ( .debug_str[0x000000c9] = "intd")
479
480 letting us set the :program:`FileCheck` variable ``DLOC`` to the desired value
481 ``0x00000233``, extracted from the line immediately preceding "``intd``".