<div dir="ltr">Please use 2-space indentation consistent with the rest of the file.<div><br></div><div>-- Sean Silva</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Dec 29, 2016 at 11:32 AM, Bryant Wong via llvm-commits <span dir="ltr"><<a href="mailto:llvm-commits@lists.llvm.org" target="_blank">llvm-commits@lists.llvm.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Author: bryant<br>
Date: Thu Dec 29 13:32:34 2016<br>
New Revision: 290716<br>
<br>
URL: <a href="http://llvm.org/viewvc/llvm-project?rev=290716&view=rev" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-<wbr>project?rev=290716&view=rev</a><br>
Log:<br>
Correctly handle multi-lined RUN lines.<br>
<br>
`utils/update_{llc_test,test}_<wbr>checks` ought to be able to handle RUN commands<br>
that span multiple lines, as shown in the example at<br>
<a href="http://llvm.org/docs/CommandGuide/FileCheck.html#the-filecheck-check-prefix-option" rel="noreferrer" target="_blank">http://llvm.org/docs/<wbr>CommandGuide/FileCheck.html#<wbr>the-filecheck-check-prefix-<wbr>option</a><br>
<br>
Differential Revision: <a href="https://reviews.llvm.org/D26523" rel="noreferrer" target="_blank">https://reviews.llvm.org/<wbr>D26523</a><br>
<br>
Modified:<br>
    llvm/trunk/utils/update_llc_<wbr>test_checks.py<br>
    llvm/trunk/utils/update_test_<wbr>checks.py<br>
<br>
Modified: llvm/trunk/utils/update_llc_<wbr>test_checks.py<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/utils/update_llc_test_checks.py?rev=290716&r1=290715&r2=290716&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-<wbr>project/llvm/trunk/utils/<wbr>update_llc_test_checks.py?rev=<wbr>290716&r1=290715&r2=290716&<wbr>view=diff</a><br>
==============================<wbr>==============================<wbr>==================<br>
--- llvm/trunk/utils/update_llc_<wbr>test_checks.py (original)<br>
+++ llvm/trunk/utils/update_llc_<wbr>test_checks.py Thu Dec 29 13:32:34 2016<br>
@@ -222,8 +222,15 @@ def main():<br>
         triple_in_ir = m.groups()[0]<br>
         break<br>
<br>
-    run_lines = [m.group(1)<br>
+    raw_lines = [m.group(1)<br>
                  for m in [RUN_LINE_RE.match(l) for l in input_lines] if m]<br>
+    run_lines = [raw_lines[0]] if len(raw_lines) > 0 else []<br>
+    for l in raw_lines[1:]:<br>
+        if run_lines[-1].endswith("\\"):<br>
+            run_lines[-1] = run_lines[-1].rstrip("\\") + " " + l<br>
+        else:<br>
+            run_lines.append(l)<br>
+<br>
     if args.verbose:<br>
       print >>sys.stderr, 'Found %d RUN lines:' % (len(run_lines),)<br>
       for l in run_lines:<br>
<br>
Modified: llvm/trunk/utils/update_test_<wbr>checks.py<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/utils/update_test_checks.py?rev=290716&r1=290715&r2=290716&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-<wbr>project/llvm/trunk/utils/<wbr>update_test_checks.py?rev=<wbr>290716&r1=290715&r2=290716&<wbr>view=diff</a><br>
==============================<wbr>==============================<wbr>==================<br>
--- llvm/trunk/utils/update_test_<wbr>checks.py (original)<br>
+++ llvm/trunk/utils/update_test_<wbr>checks.py Thu Dec 29 13:32:34 2016<br>
@@ -292,8 +292,15 @@ def main():<br>
     with open(test) as f:<br>
       input_lines = [l.rstrip() for l in f]<br>
<br>
-    run_lines = [m.group(1)<br>
+    raw_lines = [m.group(1)<br>
                  for m in [RUN_LINE_RE.match(l) for l in input_lines] if m]<br>
+    run_lines = [raw_lines[0]] if len(raw_lines) > 0 else []<br>
+    for l in raw_lines[1:]:<br>
+        if run_lines[-1].endswith("\\"):<br>
+            run_lines[-1] = run_lines[-1].rstrip("\\") + " " + l<br>
+        else:<br>
+            run_lines.append(l)<br>
+<br>
     if args.verbose:<br>
       print >>sys.stderr, 'Found %d RUN lines:' % (len(run_lines),)<br>
       for l in run_lines:<br>
<br>
<br>
______________________________<wbr>_________________<br>
llvm-commits mailing list<br>
<a href="mailto:llvm-commits@lists.llvm.org">llvm-commits@lists.llvm.org</a><br>
<a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits" rel="noreferrer" target="_blank">http://lists.llvm.org/cgi-bin/<wbr>mailman/listinfo/llvm-commits</a><br>
</blockquote></div><br></div>