1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-22 18:54:02 +01:00
llvm-mirror/unittests
Joel E. Denny 20f8c79d86 [FileCheck] Fix numeric error propagation
A more general name might be match-time error propagation.  That is,
it's conceivable we'll one day have non-numeric errors that require
the handling fixed by this patch.

Without this patch, FileCheck behaves as follows:

```
$ cat check
CHECK-NOT: [[#0x8000000000000000+0x8000000000000000]]

$ FileCheck -vv -dump-input=never check < input
check:1:54: remark: implicit EOF: expected string found in input
CHECK-NOT: [[#0x8000000000000000+0x8000000000000000]]
                                                     ^
<stdin>:2:1: note: found here

^
check:1:15: error: unable to substitute variable or numeric expression: overflow error
CHECK-NOT: [[#0x8000000000000000+0x8000000000000000]]
              ^
$ echo $?
0
```

Notice that the exit status is 0 even though there's an error.
Moreover, FileCheck doesn't print the error diagnostic unless both
`-dump-input=never` and `-vv` are specified.

The same problem occurs when `CHECK-NOT` does have a match but a
capture fails due to overflow: exit status is 0, and no diagnostic is
printed unless both `-dump-input=never` and `-vv` are specified.  The
usefulness of capturing from `CHECK-NOT` is questionable, but this
case should certainly produce an error.

With this patch, FileCheck always includes the error diagnostic and
has non-zero exit status for the above examples.  It's conceivable
that this change will cause some existing tests to fail, but my
assumption is that they should fail.  Moreover, with nearly every
project enabled, this patch didn't produce additional `check-all`
failures for me.

This patch also extends input dumps to include such numeric error
diagnostics for both expected and excluded patterns.

As noted in fixmes in some of the tests added by this patch, this
patch worsens an existing issue with redundant diagnostics.  I'll fix
that bug in a subsequent patch.

Reviewed By: thopre, jhenderson

Differential Revision: https://reviews.llvm.org/D98086
2021-03-17 19:25:41 -04:00
..
ADT [ADT] Add SFINAE guards to unique_function constructor. 2021-02-17 10:36:07 +01:00
Analysis [AssumeBundles] Add nonnull/align to op bundle if noundef exists 2021-03-16 10:23:42 +09:00
AsmParser
BinaryFormat
Bitcode
Bitstream
CodeGen [mir] Change 'undef' for MMO base addresses to 'unknown-address' 2021-03-10 16:46:44 -08:00
DebugInfo [llvm] [dwarf] Fix DWARFListTableHeader::getOffsetEntry off-by-one 2021-03-14 21:42:44 +01:00
Demangle
ExecutionEngine [RGT] RPCUtilsTest, replace un-executed EXPECT with unreachable 2021-03-17 07:37:21 -07:00
FileCheck [FileCheck] Fix numeric error propagation 2021-03-17 19:25:41 -04:00
Frontend [UnitTests] Remove uses of deprecated CreateLoad() API 2021-03-11 19:05:53 +01:00
FuzzMutate [FuzzMutate] Add mutator to modify instruction flags. 2021-01-23 19:05:20 +00:00
InterfaceStub
IR Reapply "[DebugInfo] Handle multiple variable location operands in IR" 2021-03-17 16:45:25 +00:00
LineEditor
Linker
MC Revert "[AsmParser][SystemZ][z/OS] Reland "Introduce HLASM Comment Syntax"" 2021-03-16 18:39:04 -04:00
MI [AMDGPU] Rename amdgcn_wwm to amdgcn_strict_wwm 2021-03-03 09:33:57 +01:00
Object [llvm-readelf] Support dumping the BB address map section with --bb-addr-map. 2021-03-08 16:20:11 -08:00
ObjectYAML
Option [clang][cli] Accept strings instead of options in ImpliedByAnyOf 2021-01-26 09:30:36 +01:00
Passes
ProfileData [SampleFDO] Support enabling -funique-internal-linkage-name. 2021-03-09 21:41:40 -08:00
Remarks
Support [Support][test] Unconditionally use setenv macro when compiling on Windows 2021-03-09 19:53:22 +01:00
TableGen
Target [ARM] Remove new ARMSelectionDAGTest unittest. 2021-03-04 10:14:35 +00:00
TextAPI [llvm][TextAPI] add equality operator for InterfaceFile 2021-02-18 11:53:08 -08:00
tools Renovate CMake files in the llvm-exegesis tool. 2021-02-10 14:22:55 -05:00
Transforms [BasicAA] Drop dependency on Loop Info. PR43276 2021-03-17 11:43:44 +07:00
XRay
CMakeLists.txt
unittest.cfg.in