1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-25 20:23:11 +01:00
llvm-mirror/lib
Joel E. Denny 3196763739 [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 [InstSimplify] Simplify saturating add/sub + icmp 2018-12-17 17:45:18 +00:00
AsmParser [ThinLTO] Compute synthetic function entry count 2018-12-13 19:54:27 +00:00
BinaryFormat [AMDGPU] Emit MessagePack HSA Metadata for v3 code object 2018-12-12 19:39:27 +00:00
Bitcode [ThinLTO] Compute synthetic function entry count 2018-12-13 19:54:27 +00:00
CodeGen [SDAG] Clarify the origin of chain in REG_SEQUENCE in comment, NFC 2018-12-17 20:30:20 +00:00
DebugInfo [PDB] Add some helper functions for working with scopes. 2018-12-17 16:15:36 +00:00
Demangle Add missing include file. 2018-12-17 16:42:26 +00:00
ExecutionEngine Implement IMAGE_REL_AMD64_SECREL for RuntimeDyldCOFFX86_64 2018-12-12 00:04:06 +00:00
Fuzzer
FuzzMutate
IR Implement -frecord-command-line (-frecord-gcc-switches) 2018-12-14 15:38:15 +00:00
IRReader
LineEditor
Linker ThinLTO: Do not import debug info for imported global constants 2018-12-05 21:42:17 +00:00
LTO [ThinLTO] Compute synthetic function entry count 2018-12-13 19:54:27 +00:00
MC [codeview] Flush labels before S_DEFRANGE* fragments 2018-12-17 21:49:35 +00:00
MCA [MCA] Add support for BeginGroup/EndGroup. 2018-12-17 14:27:33 +00:00
Object [WebAssembly] Check if the section order is correct 2018-12-15 00:58:12 +00:00
ObjectYAML [WebAssembly] Update dylink section parsing 2018-12-12 23:40:58 +00:00
Option
OptRemarks
Passes [Unroll/UnrollAndJam/Vectorizer/Distribute] Add followup loop attributes. 2018-12-12 17:32:52 +00:00
ProfileData
Support [FileCheck] Annotate input dump (6/7) 2018-12-18 00:03:19 +00:00
TableGen [TableGen] Preprocessing support 2018-11-27 18:57:43 +00:00
Target [X86][SSE] Improve immediate vector shift known bits handling. 2018-12-17 22:09:47 +00:00
Testing
TextAPI [TextAPI][elfabi] Make SoName optional 2018-12-11 01:00:16 +00:00
ToolDrivers
Transforms hwasan: Move ctor into a comdat. 2018-12-17 22:56:34 +00:00
WindowsManifest
XRay [Object] Rename getRelrRelocationType to getRelativeRelocationType 2018-12-14 07:46:58 +00:00
CMakeLists.txt [llvm-mca] Move llvm-mca library to llvm/lib/MCA. 2018-12-17 08:08:31 +00:00
LLVMBuild.txt [llvm-mca] Move llvm-mca library to llvm/lib/MCA. 2018-12-17 08:08:31 +00:00