1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-18 18:42:46 +02:00
llvm-mirror/test/FileCheck
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
..
comment
dump-input [FileCheck][NFC] Move -dump-input tests to a subdirectory 2021-03-04 12:43:48 -05:00
Inputs Add missing EOL. NFCI. 2020-10-31 17:32:04 +00:00
match-time-error-propagation [FileCheck] Fix numeric error propagation 2021-03-17 19:25:41 -04:00
allow-unused-prefixes.txt [FileCheck] Default --allow-unused-prefixes to false 2021-02-08 13:37:04 -08:00
bad-char.txt
check-a-b-has-b.txt
check-b-a-has-b.txt
check-count.txt
check-dag-multi-prefix-2.txt
check-dag-multi-prefix.txt
check-dag-not-dag.txt
check-dag-overlap-torture.txt
check-dag-overlap.txt
check-dag-substring-prefix.txt
check-dag-xfails.txt
check-dag.txt
check-empty2.txt
check-empty-tag.txt
check-empty.txt
check-ignore-case.txt
check-label-dag-capture.txt
check-label-dag.txt
check-label.txt
check-literal.txt [FileCheck] Add a literal check directive modifier 2020-12-18 17:26:15 -08:00
check-multi-prefix-label.txt
check-multiple-prefixes-mixed.txt
check-multiple-prefixes-nomatch-2.txt
check-multiple-prefixes-nomatch.txt
check-multiple-prefixes-substr.txt
check-not-diaginfo.txt
check-prefixes.txt
check-substring-multi-prefix-2.txt
check-substring-multi-prefix.txt
dos-style-eol.txt
empty-regex-match-at-start.txt
envvar-opts.txt
first-character-match.txt
implicit-check-not.txt
line-count-2.txt
line-count.txt
lit.local.cfg [FileCheck] Default --allow-unused-prefixes to false 2021-02-08 13:37:04 -08:00
match-full-lines.txt
multiple-check-not-failures.txt
multiple-missing-prefixes.txt
next-no-match.txt
no-check-file.txt
no-multi-suffixes.txt
numeric-defines-diagnostics.txt
numeric-defines.txt
numeric-expression.txt [FileCheck] Add support for hex alternate form in FileCheck 2021-03-12 18:14:17 +00:00
opt-color.txt
regex-brackets.txt
regex-no-match.txt
same.txt
separate-multi-prefix.txt
simple-var-capture.txt
string-defines-diagnostics.txt
string-defines.txt
two-checks-for-same-match.txt
validate-check-prefix.txt
var-ref-same-line.txt
var-scope.txt
verbose.txt [FileCheck] Do not skip end of line in diagnostics 2021-03-03 08:20:39 +00:00