test/lit.cfg: Enable the feature 'asserts' to check output of llc -version.
authorNAKAMURA Takumi <geek4civic@gmail.com>
Mon, 28 Nov 2011 05:09:15 +0000 (05:09 +0000)
committerNAKAMURA Takumi <geek4civic@gmail.com>
Mon, 28 Nov 2011 05:09:15 +0000 (05:09 +0000)
llc knows whether he is compiled with -DNDEBUG.
|  Optimized build with assertions.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@145230 91177308-0d34-0410-b5e6-96231b3b80d8

test/lit.cfg

index 1f08c9320d9c8e110101234a3bea8fd7d2df005e..6bc170cdf944afd7cff1dc49e7989a2f18eabdca 100644 (file)
@@ -283,5 +283,10 @@ else:
 if loadable_module:
     config.available_features.add('loadable_module')
 
-if config.enable_assertions:
+# llc knows whether he is compiled with -DNDEBUG.
+import subprocess
+llc_cmd = subprocess.Popen([os.path.join(llvm_tools_dir, 'llc'), '-version'],
+                           stdout = subprocess.PIPE)
+if re.search(r'with assertions', llc_cmd.stdout.read()):
     config.available_features.add('asserts')
+llc_cmd.wait()