summaryrefslogtreecommitdiff
path: root/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
commit1470f5b2ad8e873be6cfef72f00162b3b437aa65 (patch)
treef506b5b5867fb2f64b12aab20740eb25c7f7f686 /utils/update_test_checks.py
parentcc13d2043fbaa3b4dc8353a87e86af6515151a08 (diff)
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 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@290716 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'utils/update_test_checks.py')
-rwxr-xr-xutils/update_test_checks.py9
1 files changed, 8 insertions, 1 deletions
diff --git a/utils/update_test_checks.py b/utils/update_test_checks.py
index 7adf3e2661b..c71f3b62d51 100755
--- a/utils/update_test_checks.py
+++ b/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: