summaryrefslogtreecommitdiffstats
path: root/llvm/utils/update_test_checks.py
diff options
context:
space:
mode:
authorBryant Wong <llvm-commits@xorshift.org>2016-12-29 19:32:34 +0000
committerBryant Wong <llvm-commits@xorshift.org>2016-12-29 19:32:34 +0000
commit291264b612415dc3462ace9aab8c713cc81de7c8 (patch)
tree4aef9f172cc3902e3c220198cc486fab4b9461b8 /llvm/utils/update_test_checks.py
parent25eeb38acccb8150cbd4a4d2ed17c841d7c095a3 (diff)
downloadbcm5719-llvm-291264b612415dc3462ace9aab8c713cc81de7c8.tar.gz
bcm5719-llvm-291264b612415dc3462ace9aab8c713cc81de7c8.zip
Correctly handle multi-lined RUN lines.
`utils/update_{llc_test,test}_checks` ought to be able to handle RUN commands that span multiple lines, as shown in the example at http://llvm.org/docs/CommandGuide/FileCheck.html#the-filecheck-check-prefix-option Differential Revision: https://reviews.llvm.org/D26523 llvm-svn: 290716
Diffstat (limited to 'llvm/utils/update_test_checks.py')
-rwxr-xr-xllvm/utils/update_test_checks.py9
1 files changed, 8 insertions, 1 deletions
diff --git a/llvm/utils/update_test_checks.py b/llvm/utils/update_test_checks.py
index 7adf3e2661b..c71f3b62d51 100755
--- a/llvm/utils/update_test_checks.py
+++ b/llvm/utils/update_test_checks.py
@@ -292,8 +292,15 @@ def main():
with open(test) as f:
input_lines = [l.rstrip() for l in f]
- run_lines = [m.group(1)
+ raw_lines = [m.group(1)
for m in [RUN_LINE_RE.match(l) for l in input_lines] if m]
+ run_lines = [raw_lines[0]] if len(raw_lines) > 0 else []
+ for l in raw_lines[1:]:
+ if run_lines[-1].endswith("\\"):
+ run_lines[-1] = run_lines[-1].rstrip("\\") + " " + l
+ else:
+ run_lines.append(l)
+
if args.verbose:
print >>sys.stderr, 'Found %d RUN lines:' % (len(run_lines),)
for l in run_lines:
OpenPOWER on IntegriCloud