llvm-project
llvm-project copied to clipboard
FileCheck CHECK-NOT always succeeds if uses an undefined var
| Bugzilla Link | 46880 |
| Resolution | FIXED |
| Resolved on | Apr 20, 2021 06:48 |
| Version | trunk |
| OS | Linux |
| CC | @RoboTux |
Extended Description
I tried the following example at 9f86b8ec41f0:
$ cat check
CHECK-NOT: [[VAR]]
$ cat input
the input doesn't matter
$ FileCheck -dump-input=always -vv check < input |& tail -7
<<<<<<
1: the input doesn't matter
not:1'0 X~~~~~~~~~~~~~~~~~~~~~~~
not:1'1 uses undefined variable(s): "VAR"
2:
eof:1 ^
>>>>>>
$ echo $?
0
It succeeds regardless of the input. I think any use of an undefined variable should be a failure, regardless of whether the directive is positive or negative.
Discussed at:
Fix just landed.
Patch is approved but needs 4 dependent patches fixing testcases to be approved first. Hopefully this will be fixed in a couple of days.
Patch available for review at https://reviews.llvm.org/D86222
assigned to @RoboTux