mirror of
https://github.com/RPCSX/llvm.git
synced 2024-11-30 23:20:54 +00:00
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
This commit is contained in:
parent
de2aa60843
commit
563c182839
11
test/FileCheck/check-label-dag.txt
Normal file
11
test/FileCheck/check-label-dag.txt
Normal file
@ -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
|
@ -879,12 +879,10 @@ size_t CheckString::Check(const SourceMgr &SM, StringRef Buffer,
|
|||||||
size_t LastPos = 0;
|
size_t LastPos = 0;
|
||||||
std::vector<const Pattern *> NotStrings;
|
std::vector<const Pattern *> NotStrings;
|
||||||
|
|
||||||
if (CheckTy != Check::CheckLabel) {
|
// Match "dag strings" (with mixed "not strings" if any).
|
||||||
// Match "dag strings" (with mixed "not strings" if any).
|
LastPos = CheckDag(SM, Buffer, NotStrings, VariableTable);
|
||||||
LastPos = CheckDag(SM, Buffer, NotStrings, VariableTable);
|
if (LastPos == StringRef::npos)
|
||||||
if (LastPos == StringRef::npos)
|
return StringRef::npos;
|
||||||
return StringRef::npos;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Match itself from the last position after matching CHECK-DAG.
|
// Match itself from the last position after matching CHECK-DAG.
|
||||||
StringRef MatchBuffer = Buffer.substr(LastPos);
|
StringRef MatchBuffer = Buffer.substr(LastPos);
|
||||||
|
Loading…
Reference in New Issue
Block a user