diff --git a/llvm/lib/Support/FileCheck.cpp b/llvm/lib/Support/FileCheck.cpp --- a/llvm/lib/Support/FileCheck.cpp +++ b/llvm/lib/Support/FileCheck.cpp @@ -2197,6 +2197,7 @@ const std::vector &NotStrings, const FileCheckRequest &Req, std::vector *Diags) const { + bool DirectiveFail = false; for (const Pattern *Pat : NotStrings) { assert((Pat->getCheckTy() == Check::CheckNot) && "Expect CHECK-NOT!"); @@ -2212,11 +2213,11 @@ PrintMatch(false, SM, Prefix, Pat->getLoc(), *Pat, 1, Buffer, Pos, MatchLen, Req, Diags); - - return true; + DirectiveFail = true; + continue; } - return false; + return DirectiveFail; } size_t FileCheckString::CheckDag(const SourceMgr &SM, StringRef Buffer,