diff options
| author | Benjamin Kramer <benny.kra@googlemail.com> | 2012-09-18 20:51:39 +0000 |
|---|---|---|
| committer | Benjamin Kramer <benny.kra@googlemail.com> | 2012-09-18 20:51:39 +0000 |
| commit | ef878a832b96c19c9042bce379023e7905c5c903 (patch) | |
| tree | 04836436d6bb0b7b5c5f4936f98100cdad9f2af3 /llvm | |
| parent | 27c658bd18c24e887896c10ccf95df52399a1d41 (diff) | |
| download | bcm5719-llvm-ef878a832b96c19c9042bce379023e7905c5c903.tar.gz bcm5719-llvm-ef878a832b96c19c9042bce379023e7905c5c903.zip | |
FileCheck: Fix off-by-one bug that made CHECK-NOT: ignore the next character after the colon.
llvm-svn: 164165
Diffstat (limited to 'llvm')
| -rw-r--r-- | llvm/test/Other/FileCheck-space.txt | 9 | ||||
| -rw-r--r-- | llvm/test/Other/lit.local.cfg | 2 | ||||
| -rw-r--r-- | llvm/utils/FileCheck/FileCheck.cpp | 4 |
3 files changed, 12 insertions, 3 deletions
diff --git a/llvm/test/Other/FileCheck-space.txt b/llvm/test/Other/FileCheck-space.txt new file mode 100644 index 00000000000..6bbe5bc05ba --- /dev/null +++ b/llvm/test/Other/FileCheck-space.txt @@ -0,0 +1,9 @@ +RUN: printf "a\nb" | FileCheck %s -check-prefix=TEST1 +RUN: echo oo | FileCheck %s -check-prefix=TEST2 + +Check that CHECK-NEXT without a space after the colon works. +TEST1:a +TEST1-NEXT:b + +Check that CHECK-NOT without a space after the colon works. +TEST2-NOT:foo diff --git a/llvm/test/Other/lit.local.cfg b/llvm/test/Other/lit.local.cfg index 19eebc0ac7a..26930772423 100644 --- a/llvm/test/Other/lit.local.cfg +++ b/llvm/test/Other/lit.local.cfg @@ -1 +1 @@ -config.suffixes = ['.ll', '.c', '.cpp'] +config.suffixes = ['.ll', '.c', '.cpp', '.txt'] diff --git a/llvm/utils/FileCheck/FileCheck.cpp b/llvm/utils/FileCheck/FileCheck.cpp index 33f04ce6477..afbce35af5b 100644 --- a/llvm/utils/FileCheck/FileCheck.cpp +++ b/llvm/utils/FileCheck/FileCheck.cpp @@ -537,11 +537,11 @@ static bool ReadCheckFile(SourceMgr &SM, Buffer = Buffer.substr(CheckPrefix.size()+1); } else if (Buffer.size() > CheckPrefix.size()+6 && memcmp(Buffer.data()+CheckPrefix.size(), "-NEXT:", 6) == 0) { - Buffer = Buffer.substr(CheckPrefix.size()+7); + Buffer = Buffer.substr(CheckPrefix.size()+6); IsCheckNext = true; } else if (Buffer.size() > CheckPrefix.size()+5 && memcmp(Buffer.data()+CheckPrefix.size(), "-NOT:", 5) == 0) { - Buffer = Buffer.substr(CheckPrefix.size()+6); + Buffer = Buffer.substr(CheckPrefix.size()+5); IsCheckNot = true; } else { Buffer = Buffer.substr(1); |

