[cfe-dev] windows testing - lit.py failure

David Neto dneto.llvm at gmail.com
Mon Apr 11 11:15:41 PDT 2011


On Fri, Apr 8, 2011 at 9:13 PM, Óscar Fuentes <ofv at wanadoo.es> wrote:
> David Neto <dneto.llvm at gmail.com> writes:
>> I have a patch for lit.cfg that works against LLVM 2.8.  I'll file a
>> bug with the fix once I get download a trunk image.
>
> Thanks for the detailed diagnostic. I'm looking forward to your bug
> report and patch.
>

I've created http://llvm.org/bugs/show_bug.cgi?id=9680  and attached a
trunk patch there and to this email.


thanks,
david
-------------- next part --------------
Index: lit.cfg
===================================================================
--- lit.cfg	(revision 129275)
+++ lit.cfg	(working copy)
@@ -145,10 +145,34 @@
 import re
 site_exp = {}
 # FIXME: Implement lit.site.cfg.
+
+# Match two types of lines:
+# Type 1 is simple:
+#   set foo "bar"
+# Type 2 allows nmake-style continuation lines, e.g:
+#   set foo "fe fi
+#   << fo
+#   << fum"
+# This second example should result in "fe fi fo fum" being assined to "foo"
+# See PR9680
+
+continued_def = ""   # The name to be defined, using a continuation line
+continued_text = ""  # The text value of the continuing definition
 for line in open(os.path.join(config.llvm_obj_root, 'test', 'site.exp')):
     m = re.match('set ([^ ]+) "(.*)"', line)
     if m:
         site_exp[m.group(1)] = m.group(2)
+    else:
+        mstart        = re.match('set ([^ ]+) "(.*)', line)
+        mmiddle       = re.match('<< (.*)$', line)
+        mend          = re.match('<< (.*)"$', line)
+        if mstart:
+            continued_def = mstart.group(1)
+            continued_text = mstart.group(2)
+        elif mend:
+            site_exp[continued_def] = continued_text + mend.group(1)
+        elif mmiddle:
+            continued_text = continued_text + mmiddle.group(1)
 
 # Add substitutions.
 config.substitutions.append(('%llvmgcc_only', site_exp['llvmgcc']))


More information about the cfe-dev mailing list