[PATCH] D26523: `update_{llc_test, test}_checks`: Correctly handle multi-lined RUN lines.
bryant via llvm-commits
llvm-commits at lists.llvm.org
Thu Nov 10 14:03:18 PST 2016
bryant created this revision.
bryant added reviewers: spatel, chandlerc.
bryant added a subscriber: llvm-commits.
bryant set the repository for this revision to rL LLVM.
For instance,
; RUN: llvm-as < %s | llc -mtriple=i686-apple-darwin9 -mattr=sse41 \
; RUN: | FileCheck %s -check-prefix=X32
; RUN: llvm-as < %s | llc -mtriple=x86_64-apple-darwin9 -mattr=sse41 \
; RUN: | FileCheck %s -check-prefix=X64
(from http://llvm.org/docs/CommandGuide/FileCheck.html#the-filecheck-check-prefix-option ).
Adding Sanjay and Chandler since they appear in the blame list for both files.
Repository:
rL LLVM
https://reviews.llvm.org/D26523
Files:
utils/update_llc_test_checks.py
utils/update_test_checks.py
Index: utils/update_test_checks.py
===================================================================
--- utils/update_test_checks.py
+++ utils/update_test_checks.py
@@ -292,8 +292,15 @@
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:
Index: utils/update_llc_test_checks.py
===================================================================
--- utils/update_llc_test_checks.py
+++ utils/update_llc_test_checks.py
@@ -155,8 +155,15 @@
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:
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D26523.77553.patch
Type: text/x-patch
Size: 1540 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20161110/25459a4a/attachment.bin>
More information about the llvm-commits
mailing list