Index: llvm/trunk/utils/lit/lit/Test.py
===================================================================
--- llvm/trunk/utils/lit/lit/Test.py
+++ llvm/trunk/utils/lit/lit/Test.py
@@ -373,7 +373,8 @@
xml = "\n\t\n" + escape(self.result.output)
xml += "\n\t\n"
Index: llvm/trunk/utils/lit/tests/shtest-xunit-output.py
===================================================================
--- llvm/trunk/utils/lit/tests/shtest-xunit-output.py
+++ llvm/trunk/utils/lit/tests/shtest-xunit-output.py
@@ -0,0 +1,78 @@
+# RUN: not %{lit} -j 1 -v %{inputs}/shtest-format - --xunit-xml-output %t.xml
+# RUN: FileCheck < %t.xml %s
+
+# CHECK:
+# CHECK-NEXT:
+# CHECK-NEXT:
+
+# CHECK:
+
+# CHECK:
+# CHECK-NEXT:
+# CHECK:
+# CHECK-NEXT:
+
+
+# CHECK:
+# CHECK-NEXT:
+# CHECK:
+# CHECK-NEXT:
+
+# CHECK:
+
+# CHECK:
+# CHECK-NEXT:
+# CHECK:
+# CHECK-NEXT:
+
+# CHECK:
+# CHECK-NEXT:
+# CHECK:
+# CHECK-NEXT:
+
+# CHECK:
+
+# CHECK:
+
+# CHECK:
+
+# CHECK:
+
+# CHECK:
+
+# CHECK:
+# CHECK-NEXT:
+# CHECK:
+# CHECK-NEXT:
+
+
+# CHECK:
+
+# CHECK:
+
+# CHECK:
+
+# CHECK:
+# CHECK-NEXT:
+# CHECK:
+# CHECK-NEXT:
+
+# CHECK:
+
+# CHECK:
+
+# CHECK:
+
+# CHECK:
+
+# CHECK:
+
+# CHECK:
+
+# CHECK:
+# CHECK-NEXT:
+# CHECK:
+# CHECK-NEXT:
+
+# CHECK:
+# CHECK-NEXT: