llvm-project icon indicating copy to clipboard operation
llvm-project copied to clipboard

FileCheck CHECK-NOT always succeeds if uses an undefined var

Open jdenny-ornl opened this issue 6 years ago • 4 comments

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:

https://reviews.llvm.org/D83650#inline-781031

jdenny-ornl avatar Jul 28 '20 23:07 jdenny-ornl

Fix just landed.

RoboTux avatar Apr 20 '21 13:04 RoboTux

Patch is approved but needs 4 dependent patches fixing testcases to be approved first. Hopefully this will be fixed in a couple of days.

RoboTux avatar Apr 09 '21 09:04 RoboTux

Patch available for review at https://reviews.llvm.org/D86222

RoboTux avatar Aug 19 '20 22:08 RoboTux

assigned to @RoboTux

jdenny-ornl avatar Jul 28 '20 23:07 jdenny-ornl