lit: Add --repeat=N option, for running each test N times.
 - Currently just useful for timing, although it could be extended as one (bad) way to deal with flaky tests.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@88827 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/utils/lit/TestRunner.py b/utils/lit/TestRunner.py
index 5b4538f..20fbc6c 100644
--- a/utils/lit/TestRunner.py
+++ b/utils/lit/TestRunner.py
@@ -367,6 +367,8 @@
     execpath = test.getExecPath()
     execdir,execbase = os.path.split(execpath)
     tmpBase = os.path.join(execdir, 'Output', execbase)
+    if test.index is not None:
+        tmpBase += '_%d' % test.index
 
     # We use #_MARKER_# to hide %% while we do the other substitutions.
     substitutions = [('%%', '#_MARKER_#')]