Fix handling of CHECK-DAG combined with CHECK-NOT
authorTim Northover <tnorthover@apple.com>
Fri, 2 Aug 2013 11:32:50 +0000 (11:32 +0000)
committerTim Northover <tnorthover@apple.com>
Fri, 2 Aug 2013 11:32:50 +0000 (11:32 +0000)
Patch by Daniel Sanders.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@187651 91177308-0d34-0410-b5e6-96231b3b80d8

test/FileCheck/check-dag.txt
utils/FileCheck/FileCheck.cpp

index 6325e06e5a00b853972b569fa7cdd263aec93be7..2b5a47551e835e2bca9e62c261ab9c80b4af7e94 100644 (file)
@@ -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]]
index e252db91418f0b9f4acc6434c96abe041e969175..8d5af589092af2f7abb1624a74af1ff62cd6373a 100644 (file)
@@ -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();