[llvm] r192463 - Fix handling of CHECK-DAG inside of CHECK-LABEL.
Rafael Espindola
rafael.espindola at gmail.com
Fri Oct 11 09:48:03 PDT 2013
Author: rafael
Date: Fri Oct 11 11:48:02 2013
New Revision: 192463
URL: http://llvm.org/viewvc/llvm-project?rev=192463&view=rev
Log:
Fix handling of CHECK-DAG inside of CHECK-LABEL.
Added:
llvm/trunk/test/FileCheck/check-label-dag.txt
Modified:
llvm/trunk/utils/FileCheck/FileCheck.cpp
Added: llvm/trunk/test/FileCheck/check-label-dag.txt
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/FileCheck/check-label-dag.txt?rev=192463&view=auto
==============================================================================
--- llvm/trunk/test/FileCheck/check-label-dag.txt (added)
+++ llvm/trunk/test/FileCheck/check-label-dag.txt Fri Oct 11 11:48:02 2013
@@ -0,0 +1,11 @@
+; RUN: not FileCheck -input-file %s %s 2>&1 | FileCheck --check-prefix=ERROR %s
+
+bar
+zed
+
+CHECK-LABEL: {{^}}bar
+CHECK-DAG: {{^}}foo
+CHECK-LABEL: {{^}}zed
+
+ERROR: error: expected string not found in input
+ERROR-NEXT: CHECK-DAG: {{.....}}foo
Modified: llvm/trunk/utils/FileCheck/FileCheck.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/utils/FileCheck/FileCheck.cpp?rev=192463&r1=192462&r2=192463&view=diff
==============================================================================
--- llvm/trunk/utils/FileCheck/FileCheck.cpp (original)
+++ llvm/trunk/utils/FileCheck/FileCheck.cpp Fri Oct 11 11:48:02 2013
@@ -879,12 +879,10 @@ size_t CheckString::Check(const SourceMg
size_t LastPos = 0;
std::vector<const Pattern *> NotStrings;
- if (CheckTy != Check::CheckLabel) {
- // Match "dag strings" (with mixed "not strings" if any).
- LastPos = CheckDag(SM, Buffer, NotStrings, VariableTable);
- if (LastPos == StringRef::npos)
- return StringRef::npos;
- }
+ // Match "dag strings" (with mixed "not strings" if any).
+ LastPos = CheckDag(SM, Buffer, NotStrings, VariableTable);
+ if (LastPos == StringRef::npos)
+ return StringRef::npos;
// Match itself from the last position after matching CHECK-DAG.
StringRef MatchBuffer = Buffer.substr(LastPos);
More information about the llvm-commits
mailing list