Reverting r199886 (Prevent repetitive warnings for unrecognized processors and features)
[oota-llvm.git] / test / lit.cfg
index df1f4a101965bffa707e8ba41287cd355ff5ce9d..622f6ede1a126ec9ee3db97f07a0b64ffab59365 100644 (file)
@@ -188,6 +188,7 @@ else:
 config.substitutions.append( ('%ocamlopt', config.ocamlopt_executable) )
 config.substitutions.append( ('%llvmshlibdir', config.llvm_shlib_dir) )
 config.substitutions.append( ('%shlibext', config.llvm_shlib_ext) )
+config.substitutions.append( ('%exeext', config.llvm_exe_ext) )
 
 # For each occurrence of an llvm tool name as its own word, replace it
 # with the full path to the build directory holding that tool.  This
@@ -305,18 +306,19 @@ if config.have_zlib == "1":
 if config.host_triple == config.target_triple:
     config.available_features.add("native")
 
-# llc knows whether he is compiled with -DNDEBUG.
+# Ask llvm-config about assertion mode.
 import subprocess
 try:
-    llc_cmd = subprocess.Popen([os.path.join(llvm_tools_dir, 'llc'), '-version'],
-                           stdout = subprocess.PIPE)
+    llvm_config_cmd = subprocess.Popen(
+        [os.path.join(llvm_tools_dir, 'llvm-config'), '--assertion-mode'],
+        stdout = subprocess.PIPE)
 except OSError:
-    print("Could not find llc in " + llvm_tools_dir)
+    print("Could not find llvm-config in " + llvm_tools_dir)
     exit(42)
 
-if re.search(r'with assertions', llc_cmd.stdout.read().decode('ascii')):
+if re.search(r'ON', llvm_config_cmd.stdout.read().decode('ascii')):
     config.available_features.add('asserts')
-llc_cmd.wait()
+llvm_config_cmd.wait()
 
 if 'darwin' == sys.platform:
     try: