1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-23 11:13:28 +01:00
llvm-mirror/include/llvm
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
..
ADT [ADT] Fix bugs in SmallBitVector. 2018-12-14 18:21:20 +00:00
Analysis [NewPM] fixing asserts on deleted loop in -print-after-all 2018-12-11 19:05:35 +00:00
AsmParser
BinaryFormat [WebAssembly] Check if the section order is correct 2018-12-15 00:58:12 +00:00
Bitcode [IR] Add a dedicated FNeg IR Instruction 2018-11-13 18:15:47 +00:00
CodeGen [TargetLowering] Add DemandedElts mask to SimplifyDemandedBits (PR40000) 2018-12-17 18:43:43 +00:00
Config [Support/FileSystem] Add sub-second precision for atime/mtime of sys::fs::file_status on unix platforms 2018-11-26 00:03:39 +00:00
DebugInfo [PDB] Add some helper functions for working with scopes. 2018-12-17 16:15:36 +00:00
Demangle [MS Demangler] Add a helper function to print a Node as a string. 2018-12-17 16:14:50 +00:00
ExecutionEngine [ExecutionEngine] Change NotifyObjectEmitted/NotifyObjectFreed API. 2018-12-04 00:55:15 +00:00
FuzzMutate
IR [macho] save the SDK version stored in module metadata into the version min and 2018-12-14 01:14:10 +00:00
IRReader
LineEditor
Linker
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 [opt] Change the parameter of OptTable::PrintHelp from Name to Usage and don't append "[options] <inputs>" 2018-10-10 00:15:31 +00:00
Passes Add an OptimizerLast EP 2018-11-12 11:17:07 +00:00
ProfileData [SampleFDO][NFC] Remove debugging log left over in the code. 2018-10-11 22:14:27 +00:00
Support [FileCheck] Annotate input dump (6/7) 2018-12-18 00:03:19 +00:00
TableGen Fix and modernize StringMatcher comment; NFC 2018-09-28 13:31:55 +00:00
Target Implement -frecord-command-line (-frecord-gcc-switches) 2018-12-14 15:38:15 +00:00
Testing/Support
TextAPI/ELF [TextAPI][elfabi] Make SoName optional 2018-12-11 01:00:16 +00:00
ToolDrivers
Transforms [ThinLTO] Compute synthetic function entry count 2018-12-13 19:54:27 +00:00
WindowsManifest
WindowsResource
XRay [XRay] Improve FDR trace handling and error messaging 2018-11-09 06:26:48 +00:00
CMakeLists.txt
InitializePasses.h [Unroll/UnrollAndJam/Vectorizer/Distribute] Add followup loop attributes. 2018-12-12 17:32:52 +00:00
LinkAllIR.h
LinkAllPasses.h [Unroll/UnrollAndJam/Vectorizer/Distribute] Add followup loop attributes. 2018-12-12 17:32:52 +00:00
module.extern.modulemap [LLVM] Allow modulemap installation 2018-11-21 20:46:50 +00:00
module.install.modulemap [LLVM] Allow modulemap installation 2018-11-21 20:46:50 +00:00
module.modulemap [LLVM] Allow modulemap installation 2018-11-21 20:46:50 +00:00
module.modulemap.build
Pass.h
PassAnalysisSupport.h
PassInfo.h
PassRegistry.h
PassSupport.h