[llvm] [FileCheck]: Fix diagnostic for trailing CHECK-NOT (PR #78412)

Vinayak Dev via llvm-commits llvm-commits at lists.llvm.org
Wed Jan 17 08:00:58 PST 2024


vinayakdsci wrote:

Unfortunately, that is a part of a bigger problem.
This will work, as the original issue reported, only when the last prefix is a trailing not.

In llvm/lib/FileCheck/FileCheck.cpp checkInput() is called from the file of the same name in the llvm/utils/FileCheck/ folder, after the readCheckFile() function is used to populate the CheckStrings vector in the FileCheck struct.

The problem is that readCheckFile seems to be designed around using only CHECK as a prefix, and it does not populate CheckStrings for any of the custom NOT prefixes, and doing so makes all the errors disappear, which is wrong behaviour.

Thus when CheckStr.Check() is called to check for NOT strings, the prefix passed into the Check function is that of CheckStr, which will never be the one followed by a NOT by design. That is the actual issue, and I am unable to find a workaround.

It would take considerable time and code fixing to make the test you mention pass, and I did discover it while fixing this issue. Should I go ahead and dig deeper(I might need help on this, as I am very new to LLVM) ?

Thanks!

https://github.com/llvm/llvm-project/pull/78412


More information about the llvm-commits mailing list