From cf708c328422805ed56469f4d4db2edf255669a6 Mon Sep 17 00:00:00 2001 From: Tim Northover Date: Fri, 2 Aug 2013 11:32:50 +0000 Subject: [PATCH] Fix handling of CHECK-DAG combined with CHECK-NOT Patch by Daniel Sanders. llvm-svn: 187651 --- llvm/test/FileCheck/check-dag.txt | 1 + llvm/utils/FileCheck/FileCheck.cpp | 3 +-- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/llvm/test/FileCheck/check-dag.txt b/llvm/test/FileCheck/check-dag.txt index 6325e06..2b5a475 100644 --- a/llvm/test/FileCheck/check-dag.txt +++ b/llvm/test/FileCheck/check-dag.txt @@ -22,4 +22,5 @@ mul r5, r10, r11 ; CHECK-DAG: add [[REG1:r[0-9]+]], r1, r2 ; CHECK-DAG: add [[REG2:r[0-9]+]], r3, r4 +; CHECK-NOT: xor ; CHECK-DAG: mul r5, [[REG1]], [[REG2]] diff --git a/llvm/utils/FileCheck/FileCheck.cpp b/llvm/utils/FileCheck/FileCheck.cpp index e252db9..8d5af58 100644 --- a/llvm/utils/FileCheck/FileCheck.cpp +++ b/llvm/utils/FileCheck/FileCheck.cpp @@ -1013,8 +1013,7 @@ size_t CheckString::CheckDag(const SourceMgr &SM, StringRef Buffer, // CHECK-DAG, verify that there's no 'not' strings occurred in that // region. StringRef SkippedRegion = Buffer.substr(LastPos, MatchPos); - size_t Pos = CheckNot(SM, SkippedRegion, NotStrings, VariableTable); - if (Pos != StringRef::npos) + if (CheckNot(SM, SkippedRegion, NotStrings, VariableTable)) return StringRef::npos; // Clear "not strings". NotStrings.clear(); -- 2.7.4