1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-19 11:02:59 +02:00

[RuntimeDyld] Allow multi-line rtdyld-check and jitlink-check expressions.

This patch allows rtdyld-check / jitlink-check expressions to be extended over
multiple lines by terminating each line with a '\'. E.g.

  # llvm-rtdyld: *{8}X = \
  # llvm-rtdyld:   Y
  X:
    .quad Y

This will be used to break up some long lines in upcoming test cases.
This commit is contained in:
Lang Hames 2020-03-10 13:07:46 -07:00
parent 28c8c4e5a8
commit 9a8419c639

View File

@ -704,6 +704,7 @@ bool RuntimeDyldCheckerImpl::checkAllRulesInBuffer(StringRef RulePrefix,
bool DidAllTestsPass = true;
unsigned NumRules = 0;
std::string CheckExpr;
const char *LineStart = MemBuf->getBufferStart();
// Eat whitespace.
@ -717,9 +718,18 @@ bool RuntimeDyldCheckerImpl::checkAllRulesInBuffer(StringRef RulePrefix,
++LineEnd;
StringRef Line(LineStart, LineEnd - LineStart);
if (Line.startswith(RulePrefix)) {
DidAllTestsPass &= check(Line.substr(RulePrefix.size()));
++NumRules;
if (Line.startswith(RulePrefix))
CheckExpr += Line.substr(RulePrefix.size()).str();
// If there's a check expr string...
if (!CheckExpr.empty()) {
// ... and it's complete then run it, otherwise remove the trailer '\'.
if (CheckExpr.back() != '\\') {
DidAllTestsPass &= check(CheckExpr);
CheckExpr.clear();
++NumRules;
} else
CheckExpr.pop_back();
}
// Eat whitespace.