summaryrefslogtreecommitdiff
path: root/utils/FileCheck
diff options
context:
space:
mode:
authorDan Gohman <gohman@apple.com>2010-01-29 21:55:16 +0000
committerDan Gohman <gohman@apple.com>2010-01-29 21:55:16 +0000
commitd8a5541a513695039d1eb83eeced05d51ce9f567 (patch)
tree08163032ab6dfdaeb5b040f12ac2397a711c5f8b /utils/FileCheck
parente546343799d1b7914024b62f6c188f5c0d66f7b3 (diff)
downloadllvm-d8a5541a513695039d1eb83eeced05d51ce9f567.tar.gz
llvm-d8a5541a513695039d1eb83eeced05d51ce9f567.tar.bz2
llvm-d8a5541a513695039d1eb83eeced05d51ce9f567.tar.xz
Skip whitespace when looking for a potential intended match.
Before: <stdin>:94:1: note: possible intended match here movsd 4096(%rsi), %xmm0 ^ After: <stdin>:94:2: note: possible intended match here movsd 4096(%rsi), %xmm0 ^ git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94847 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'utils/FileCheck')
-rw-r--r--utils/FileCheck/FileCheck.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/utils/FileCheck/FileCheck.cpp b/utils/FileCheck/FileCheck.cpp
index 5b158fed8d..ddc8dc2661 100644
--- a/utils/FileCheck/FileCheck.cpp
+++ b/utils/FileCheck/FileCheck.cpp
@@ -382,6 +382,11 @@ void Pattern::PrintFailureInfo(const SourceMgr &SM, StringRef Buffer,
if (Buffer[i] == '\n')
++NumLinesForward;
+ // Patterns have leading whitespace stripped, so skip whitespace when
+ // looking for something which looks like a pattern.
+ if (Buffer[i] == ' ' || Buffer[i] == '\t')
+ continue;
+
// Compute the "quality" of this match as an arbitrary combination of the
// match distance and the number of lines skipped to get to this match.
unsigned Distance = ComputeMatchDistance(Buffer.substr(i), VariableTable);