mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-09-25 17:20:48 +00:00
FileCheck: Fix off-by-one bug that made CHECK-NOT: ignore the next character after the colon.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@164165 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
9
test/Other/FileCheck-space.txt
Normal file
9
test/Other/FileCheck-space.txt
Normal file
@@ -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
|
@@ -1 +1 @@
|
|||||||
config.suffixes = ['.ll', '.c', '.cpp']
|
config.suffixes = ['.ll', '.c', '.cpp', '.txt']
|
||||||
|
@@ -537,11 +537,11 @@ static bool ReadCheckFile(SourceMgr &SM,
|
|||||||
Buffer = Buffer.substr(CheckPrefix.size()+1);
|
Buffer = Buffer.substr(CheckPrefix.size()+1);
|
||||||
} else if (Buffer.size() > CheckPrefix.size()+6 &&
|
} else if (Buffer.size() > CheckPrefix.size()+6 &&
|
||||||
memcmp(Buffer.data()+CheckPrefix.size(), "-NEXT:", 6) == 0) {
|
memcmp(Buffer.data()+CheckPrefix.size(), "-NEXT:", 6) == 0) {
|
||||||
Buffer = Buffer.substr(CheckPrefix.size()+7);
|
Buffer = Buffer.substr(CheckPrefix.size()+6);
|
||||||
IsCheckNext = true;
|
IsCheckNext = true;
|
||||||
} else if (Buffer.size() > CheckPrefix.size()+5 &&
|
} else if (Buffer.size() > CheckPrefix.size()+5 &&
|
||||||
memcmp(Buffer.data()+CheckPrefix.size(), "-NOT:", 5) == 0) {
|
memcmp(Buffer.data()+CheckPrefix.size(), "-NOT:", 5) == 0) {
|
||||||
Buffer = Buffer.substr(CheckPrefix.size()+6);
|
Buffer = Buffer.substr(CheckPrefix.size()+5);
|
||||||
IsCheckNot = true;
|
IsCheckNot = true;
|
||||||
} else {
|
} else {
|
||||||
Buffer = Buffer.substr(1);
|
Buffer = Buffer.substr(1);
|
||||||
|
Reference in New Issue
Block a user