aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/FileCheck/FileCheckImpl.h
diff options
context:
space:
mode:
authorThomas Preud'homme <thomasp@graphcore.ai>2020-08-28 11:30:01 +0100
committerThomas Preud'homme <thomasp@graphcore.ai>2021-04-20 14:42:46 +0100
commitfd941036bf2494cfbd2749f2f179733cbe9e2eb4 (patch)
tree231056553ec04a2facec068d16dc43ef4a204904 /llvm/lib/FileCheck/FileCheckImpl.h
parent4897effb14158051bc07a88cb7e84f3b25d5980c (diff)
downloadllvm-fd941036bf2494cfbd2749f2f179733cbe9e2eb4.zip
llvm-fd941036bf2494cfbd2749f2f179733cbe9e2eb4.tar.gz
llvm-fd941036bf2494cfbd2749f2f179733cbe9e2eb4.tar.bz2
Fix PR46880: Fail CHECK-NOT with undefined variable
Currently a CHECK-NOT directive succeeds whenever the corresponding match fails. However match can fail due to an error rather than a lack of match, for instance if a variable is undefined. This commit makes match error a failure for CHECK-NOT. Reviewed By: jdenny Differential Revision: https://reviews.llvm.org/D86222
Diffstat (limited to 'llvm/lib/FileCheck/FileCheckImpl.h')
-rw-r--r--llvm/lib/FileCheck/FileCheckImpl.h6
1 files changed, 2 insertions, 4 deletions
diff --git a/llvm/lib/FileCheck/FileCheckImpl.h b/llvm/lib/FileCheck/FileCheckImpl.h
index d4d891f..29e721e 100644
--- a/llvm/lib/FileCheck/FileCheckImpl.h
+++ b/llvm/lib/FileCheck/FileCheckImpl.h
@@ -229,8 +229,7 @@ public:
/// Print name of variable associated with this error.
void log(raw_ostream &OS) const override {
- OS << "\"";
- OS.write_escaped(VarName) << "\"";
+ OS << "undefined variable: " << VarName;
}
};
@@ -756,8 +755,7 @@ public:
/// current values of FileCheck numeric variables and is updated if this
/// match defines new numeric values.
MatchResult match(StringRef Buffer, const SourceMgr &SM) const;
- /// Prints the value of successful substitutions or the name of the undefined
- /// string or numeric variables preventing a successful substitution.
+ /// Prints the value of successful substitutions.
void printSubstitutions(const SourceMgr &SM, StringRef Buffer,
SMRange MatchRange, FileCheckDiag::MatchType MatchTy,
std::vector<FileCheckDiag> *Diags) const;