[WinEH] Add some test cases I forgot to add to previous commits
[oota-llvm.git] / test / lit.cfg
index d34ca69a6890d473857ff535b12534af0d0bf318..6d3c41256422afa4e2fa078981b11245506c7538 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 ) )
 
@@ -188,6 +188,7 @@ config.substitutions.append( ('%llc_dwarf', llc_dwarf) )
 
 # Add site-specific substitutions.
 config.substitutions.append( ('%gold', config.gold_executable) )
+config.substitutions.append( ('%ld64', config.ld64_executable) )
 config.substitutions.append( ('%go', config.go_executable) )
 config.substitutions.append( ('%llvmshlibdir', config.llvm_shlib_dir) )
 config.substitutions.append( ('%shlibext', config.llvm_shlib_ext) )
@@ -235,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",
@@ -253,6 +255,7 @@ for pattern in [r"\bbugpoint\b(?!-)",
                 r"\bFileCheck\b",
                 r"\bobj2yaml\b",
                 r"\byaml2obj\b",
+                r"\byaml-bench\b",
                 r"\bverify-uselistorder\b",
                 # Handle these specially as they are strings searched
                 # for during testing.
@@ -266,8 +269,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
@@ -369,6 +376,22 @@ def have_ld_plugin_support():
 if have_ld_plugin_support():
     config.available_features.add('ld_plugin')
 
+def have_ld64_plugin_support():
+    if config.ld64_executable == '':
+        return False
+
+    ld_cmd = subprocess.Popen([config.ld64_executable, '-v'], stderr = subprocess.PIPE)
+    ld_out = ld_cmd.stderr.read().decode()
+    ld_cmd.wait()
+
+    if 'ld64' not in ld_out or 'LTO' not in ld_out:
+        return False
+
+    return True
+
+if have_ld64_plugin_support():
+    config.available_features.add('ld64_plugin')
+
 # Ask llvm-config about assertion mode.
 try:
     llvm_config_cmd = subprocess.Popen(