[llvm-commits] [llvm] r164165 - in /llvm/trunk: test/Other/FileCheck-space.txt test/Other/lit.local.cfg utils/FileCheck/FileCheck.cpp

Benjamin Kramer benny.kra at googlemail.com
Tue Sep 18 13:51:39 PDT 2012


Author: d0k
Date: Tue Sep 18 15:51:39 2012
New Revision: 164165

URL: http://llvm.org/viewvc/llvm-project?rev=164165&view=rev
Log:
FileCheck: Fix off-by-one bug that made CHECK-NOT: ignore the next character after the colon.

Added:
    llvm/trunk/test/Other/FileCheck-space.txt
Modified:
    llvm/trunk/test/Other/lit.local.cfg
    llvm/trunk/utils/FileCheck/FileCheck.cpp

Added: llvm/trunk/test/Other/FileCheck-space.txt
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Other/FileCheck-space.txt?rev=164165&view=auto
==============================================================================
--- llvm/trunk/test/Other/FileCheck-space.txt (added)
+++ llvm/trunk/test/Other/FileCheck-space.txt Tue Sep 18 15:51:39 2012
@@ -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

Modified: llvm/trunk/test/Other/lit.local.cfg
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Other/lit.local.cfg?rev=164165&r1=164164&r2=164165&view=diff
==============================================================================
--- llvm/trunk/test/Other/lit.local.cfg (original)
+++ llvm/trunk/test/Other/lit.local.cfg Tue Sep 18 15:51:39 2012
@@ -1 +1 @@
-config.suffixes = ['.ll', '.c', '.cpp']
+config.suffixes = ['.ll', '.c', '.cpp', '.txt']

Modified: llvm/trunk/utils/FileCheck/FileCheck.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/utils/FileCheck/FileCheck.cpp?rev=164165&r1=164164&r2=164165&view=diff
==============================================================================
--- llvm/trunk/utils/FileCheck/FileCheck.cpp (original)
+++ llvm/trunk/utils/FileCheck/FileCheck.cpp Tue Sep 18 15:51:39 2012
@@ -537,11 +537,11 @@
       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);





More information about the llvm-commits mailing list