diff options
Diffstat (limited to 'llvm')
| -rw-r--r-- | llvm/test/FileCheck/check-label-dag.txt | 11 | ||||
| -rw-r--r-- | llvm/utils/FileCheck/FileCheck.cpp | 10 |
2 files changed, 15 insertions, 6 deletions
diff --git a/llvm/test/FileCheck/check-label-dag.txt b/llvm/test/FileCheck/check-label-dag.txt new file mode 100644 index 00000000000..2f54c3ea94e --- /dev/null +++ b/llvm/test/FileCheck/check-label-dag.txt @@ -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 diff --git a/llvm/utils/FileCheck/FileCheck.cpp b/llvm/utils/FileCheck/FileCheck.cpp index 120fdd7283b..37a1a2f5dab 100644 --- a/llvm/utils/FileCheck/FileCheck.cpp +++ b/llvm/utils/FileCheck/FileCheck.cpp @@ -879,12 +879,10 @@ size_t CheckString::Check(const SourceMgr &SM, StringRef Buffer, 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); |

