Recommit r246175 - Add Kaleidoscope regression tests, with a fix to make sure
[oota-llvm.git] / test / lit.cfg
index 173d51bdf805358c8c40fd0d4161137368380d26..38a2ec20ec8d6b4f4b61edd70a32f44bc5aff0e2 100644 (file)
@@ -176,7 +176,7 @@ lli = 'lli'
 # we don't support COFF in MCJIT well enough for the tests, force ELF format on
 # Windows.  FIXME: the process target triple should be used here, but this is
 # difficult to obtain on Windows.
-if re.search(r'cygwin|mingw32|windows-gnu|win32', config.host_triple):
+if re.search(r'cygwin|mingw32|windows-gnu|windows-msvc|win32', config.host_triple):
   lli += ' -mtriple='+config.host_triple+'-elf'
 config.substitutions.append( ('%lli', lli ) )
 
@@ -236,6 +236,7 @@ for pattern in [r"\bbugpoint\b(?!-)",
                 r"\bllvm-dwarfdump\b",
                 r"\bllvm-extract\b",
                 r"\bllvm-go\b",
+                r"\bllvm-lib\b",
                 r"\bllvm-link\b",
                 r"\bllvm-lto\b",
                 r"\bllvm-mc\b",
@@ -247,6 +248,7 @@ for pattern in [r"\bbugpoint\b(?!-)",
                 r"\bllvm-readobj\b",
                 r"\bllvm-rtdyld\b",
                 r"\bllvm-size\b",
+                r"\bllvm-split\b",
                 r"\bllvm-tblgen\b",
                 r"\bllvm-c-test\b",
                 r"\bmacho-dump\b",
@@ -254,7 +256,14 @@ for pattern in [r"\bbugpoint\b(?!-)",
                 r"\bFileCheck\b",
                 r"\bobj2yaml\b",
                 r"\byaml2obj\b",
+                r"\byaml-bench\b",
                 r"\bverify-uselistorder\b",
+                r"\bKaleidoscope-Ch3\b",
+                r"\bKaleidoscope-Ch4\b",
+                r"\bKaleidoscope-Ch5\b",
+                r"\bKaleidoscope-Ch6\b",
+                r"\bKaleidoscope-Ch7\b",
+                r"\bKaleidoscope-Ch8\b",
                 # Handle these specially as they are strings searched
                 # for during testing.
                 r"\| \bcount\b",
@@ -267,8 +276,12 @@ for pattern in [r"\bbugpoint\b(?!-)",
                           pattern)
     tool_pipe = tool_match.group(2)
     tool_name = tool_match.group(4)
-    tool_path = lit.util.which(tool_name, llvm_tools_dir)
-    if not tool_path:
+    # Did the user specify the tool path + arguments? This allows things like
+    # llvm-lit "-Dllc=llc -enable-misched -verify-machineinstrs"
+    tool_path = lit_config.params.get(tool_name)
+    if tool_path is None:
+        tool_path = lit.util.which(tool_name, llvm_tools_dir)
+    if tool_path is None:
         # Warn, but still provide a substitution.
         lit_config.note('Did not find ' + tool_name + ' in ' + llvm_tools_dir)
         tool_path = llvm_tools_dir + '/' + tool_name
@@ -327,10 +340,11 @@ if config.have_zlib == "1":
 else:
     config.available_features.add("nozlib")
 
-# Native compilation: host arch == target arch
+# Native compilation: host arch == target arch and native backend built-in
 # FIXME: Consider cases that target can be executed
 # even if host_triple were different from target_triple.
-if config.host_triple == config.target_triple:
+if (config.host_triple == config.target_triple and
+    config.native_target in config.targets_to_build):
     config.available_features.add("native")
 
 import subprocess