llvm.org GIT mirror llvm / 8d31c8a
[FileCheck] Fix --strict-whitespace --match-full-lines Make sure FileCheck --strict-whitespace --match-full-lines translates 'CHECK: bla ' into pattern '^ bla $' instead of pattern '^bla$'. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@290069 91177308-0d34-0410-b5e6-96231b3b80d8 Tom de Vries 3 years ago
1 changed file(s) with 7 addition(s) and 5 deletion(s). Raw diff Collapse all Expand all
167167 this->LineNumber = LineNumber;
168168 PatternLoc = SMLoc::getFromPointer(PatternStr.data());
169169
170 // Ignore trailing whitespace.
171 while (!PatternStr.empty() &&
172 (PatternStr.back() == ' ' || PatternStr.back() == '\t'))
173 PatternStr = PatternStr.substr(0, PatternStr.size() - 1);
170 if (!(NoCanonicalizeWhiteSpace && MatchFullLines))
171 // Ignore trailing whitespace.
172 while (!PatternStr.empty() &&
173 (PatternStr.back() == ' ' || PatternStr.back() == '\t'))
174 PatternStr = PatternStr.substr(0, PatternStr.size() - 1);
174175
175176 // Check that there is something on the line.
176177 if (PatternStr.empty()) {
865866
866867 // Okay, we found the prefix, yay. Remember the rest of the line, but ignore
867868 // leading whitespace.
868 Buffer = Buffer.substr(Buffer.find_first_not_of(" \t"));
869 if (!(NoCanonicalizeWhiteSpace && MatchFullLines))
870 Buffer = Buffer.substr(Buffer.find_first_not_of(" \t"));
869871
870872 // Scan ahead to the end of line.
871873 size_t EOL = Buffer.find_first_of("\n\r");