llvm-project/llvm/test
Joel E. Denny f7c1c4d8a4 [FileCheck] Annotate input dump (6/7)
This patch implements input annotations for diagnostics reporting
CHECK-DAG discarded matches.  These diagnostics are enabled by -vv.
These annotations mark discarded match ranges using `!~~` because they
are bad matches even though they are not errors.

CHECK-DAG discarded matches create another case where there can be
multiple match results for the same directive.

For example:

```
$ FileCheck -dump-input=help
The following description was requested by -dump-input=help to
explain the input annotations printed by -dump-input=always and
-dump-input=fail:

  - L:     labels line number L of the input file
  - T:L    labels the only match result for a pattern of type T from line L of
           the check file
  - T:L'N  labels the Nth match result for a pattern of type T from line L of
           the check file
  - ^~~    marks good match (reported if -v)
  - !~~    marks bad match, such as:
           - CHECK-NEXT on same line as previous match (error)
           - CHECK-NOT found (error)
           - CHECK-DAG overlapping match (discarded, reported if -vv)
  - X~~    marks search range when no match is found, such as:
           - CHECK-NEXT not found (error)
           - CHECK-DAG not found after discarded matches (error)
  - ?      marks fuzzy match when no match is found
  - colors success, error, fuzzy match, discarded match, unmatched input

If you are not seeing color above or in input dumps, try: -color

$ FileCheck -vv -dump-input=always check4 < input4 |& sed -n '/^<<<</,$p'
<<<<<<
         1: abcdef
dag:1       ^~~~
dag:2'0       !~~~ discard: overlaps earlier match
         2: cdefgh
dag:2'1     ^~~~
check:3         X~ error: no match found
>>>>>>

$ cat check4
CHECK-DAG: abcd
CHECK-DAG: cdef
CHECK: efgh

$ cat input4
abcdef
cdefgh
```

This shows that the line 3 CHECK fails to match even though its
pattern appears in the input because its search range starts after the
line 2 CHECK-DAG's match range.  The trouble might be that the line 2
CHECK-DAG's match range is later than expected because its first match
range overlaps with the line 1 CHECK-DAG match range and thus is
discarded.

Because `!~~` for CHECK-DAG does not indicate an error, it is not
colored red.  Instead, when colors are enabled, it is colored cyan,
which suggests a match that went cold.

Reviewed By: george.karpenkov, probinson

Differential Revision: https://reviews.llvm.org/D53898

llvm-svn: 349423
2018-12-18 00:03:19 +00:00
..
Analysis [CostModel][X86] Don't count 2 shuffles on the last level of a pairwise arithmetic or min/max reduction 2018-12-13 19:08:10 +00:00
Assembler [IR] Don't assume all functions are 4 byte aligned 2018-12-07 08:34:59 +00:00
Bindings [DebugInfo] IR/Bitcode changes for DISubprogram flags. 2018-11-28 21:14:32 +00:00
Bitcode [ThinLTO] Compute synthetic function entry count 2018-12-13 19:54:27 +00:00
BugPoint [bugpoint] Find 'opt', etc., in bugpoint directory 2018-12-10 00:56:13 +00:00
CodeGen [X86] Add baseline tests for D55780 2018-12-17 23:20:14 +00:00
DebugInfo Revert "DebugInfo: Assume an absence of ranges or high_pc on a CU means the CU is empty (devoid of code addresses)" 2018-12-17 14:14:40 +00:00
Demangle [MS Demangler] Fail gracefully on invalid pointer types. 2018-12-14 18:10:13 +00:00
Examples
ExecutionEngine Implement IMAGE_REL_AMD64_SECREL for RuntimeDyldCOFFX86_64 2018-12-12 00:04:06 +00:00
Feature Mark @llvm.trap cold 2018-11-14 19:53:41 +00:00
FileCheck [FileCheck] Annotate input dump (6/7) 2018-12-18 00:03:19 +00:00
Instrumentation hwasan: Move ctor into a comdat. 2018-12-17 22:56:34 +00:00
Integer
JitListener
LTO LTO: Don't internalize available_externally globals. 2018-12-05 00:09:36 +00:00
Linker Implement -frecord-command-line (-frecord-gcc-switches) 2018-12-14 15:38:15 +00:00
MC [WebAssembly] Fix assembler parsing of br_table. 2018-12-17 22:04:44 +00:00
Object [WebAssembly] Check if the section order is correct 2018-12-15 00:58:12 +00:00
ObjectYAML [WebAssembly] Check if the section order is correct 2018-12-15 00:58:12 +00:00
Other [Unroll/UnrollAndJam/Vectorizer/Distribute] Add followup loop attributes. 2018-12-12 17:32:52 +00:00
SafepointIRVerifier
SymbolRewriter
TableGen [TableGen] Preserve order of output operands in DAGISelMatcherGen 2018-12-05 00:47:59 +00:00
ThinLTO/X86 [ThinLTO] Fix test added in rL349076 2018-12-14 08:21:08 +00:00
Transforms [AggressiveInstCombine] convert rotate with guard branch into funnel shift (PR34924) 2018-12-17 21:14:51 +00:00
Unit
Verifier Implement -frecord-command-line (-frecord-gcc-switches) 2018-12-14 15:38:15 +00:00
YAMLParser
tools DebugInfo: Update gold plugin tests due to CU attribute reordering in r349207 2018-12-17 21:10:28 +00:00
.clang-format
CMakeLists.txt
TestRunner.sh
lit.cfg.py [lit]Add llvm-readelf to tool substitutions 2018-12-12 10:34:01 +00:00
lit.site.cfg.py.in