llvm.org GIT mirror llvm / 563c182
Fix handling of CHECK-DAG inside of CHECK-LABEL. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@192463 91177308-0d34-0410-b5e6-96231b3b80d8 Rafael Espindola 6 years ago
2 changed file(s) with 15 addition(s) and 6 deletion(s). Raw diff Collapse all Expand all
0 ; RUN: not FileCheck -input-file %s %s 2>&1 | FileCheck --check-prefix=ERROR %s
1
2 bar
3 zed
4
5 CHECK-LABEL: {{^}}bar
6 CHECK-DAG: {{^}}foo
7 CHECK-LABEL: {{^}}zed
8
9 ERROR: error: expected string not found in input
10 ERROR-NEXT: CHECK-DAG: {{.....}}foo
878878 size_t LastPos = 0;
879879 std::vector NotStrings;
880880
881 if (CheckTy != Check::CheckLabel) {
882 // Match "dag strings" (with mixed "not strings" if any).
883 LastPos = CheckDag(SM, Buffer, NotStrings, VariableTable);
884 if (LastPos == StringRef::npos)
885 return StringRef::npos;
886 }
881 // Match "dag strings" (with mixed "not strings" if any).
882 LastPos = CheckDag(SM, Buffer, NotStrings, VariableTable);
883 if (LastPos == StringRef::npos)
884 return StringRef::npos;
887885
888886 // Match itself from the last position after matching CHECK-DAG.
889887 StringRef MatchBuffer = Buffer.substr(LastPos);