Imagine we have the following invocation:
FileCheck -check-prefix=UNKNOWN-PREFIX -implicit-check-not=something
When the check prefix does not exist I'd expect it to fail, but it does not.
This patch fixes the issue.
Differential D78024
[FileCheck] - Fix the false positive when -implicit-check-not is used with an unknown -check-prefix. grimar on Apr 13 2020, 8:40 AM. Authored by
Details Imagine we have the following invocation: FileCheck -check-prefix=UNKNOWN-PREFIX -implicit-check-not=something When the check prefix does not exist I'd expect it to fail, but it does not. This patch fixes the issue.
Diff Detail
Event TimelineComment Actions
Comment Actions What test suites did you try this on? It's good to be cautious when increasing FileCheck's strictness.
Comment Actions
I used run check-llvm and check-lld previously for this patch.
Comment Actions In case you didn't configure all LLVM projects or some tests were skipped for your config, please watch the bots carefully. LGTM except for some nits on the comments. Thanks for this!
Comment Actions
Confirmed. Both FileCheck --check-prefix=KNOWN --check-prefix=UNKNOWN and FileCheck --check-prefixes=KNOWN,UNKNOWN are allowed. This looks to me another bug-prone area which we should clean up.
Comment Actions I'm just reading this review for the first time, and my thought was, why is this interacting with implicit-check-not? I think specifying a --check-prefix=FOO with no uses of FOO should be diagnosed. I can't say I recall the previous discussion in detail, but that's what I think now. Comment Actions It was interacting (this patch was committed and fixed the issue), because the code used the logic to add an EOF pattern if (CheckStrings->empty()) { errs() << "error: no check strings found with prefix" ... Comment Actions
I noticed this strange behavior of FileCheck as well. When I try to fix it, there are lots of test failures. /subscribe Comment Actions Yeah. To fix it we should prepare patches for those ~1000 tests in
(and few other places) first. When I investigated them, I came to conclusion they just have unused prefixes |
I think a clearer name is FoundUsedPrefix.