summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorNAKAMURA Takumi <geek4civic@gmail.com>2013-12-03 23:22:25 +0000
committerNAKAMURA Takumi <geek4civic@gmail.com>2013-12-03 23:22:25 +0000
commit042795734d3697fc3a6318460544b44a060d179f (patch)
treecfbe11ffae60dfdb5ce4fb75c9582f36acd5f90d /test
parente0c0a71531bb8052859b676573126fa57ccde826 (diff)
downloadllvm-042795734d3697fc3a6318460544b44a060d179f.tar.gz
llvm-042795734d3697fc3a6318460544b44a060d179f.tar.bz2
llvm-042795734d3697fc3a6318460544b44a060d179f.tar.xz
check-llvm: Ask llvm-config about assertion mode, instead of llc.
Add --assertion-mode to llvm-config. It emits ON or OFF according to NDEBUG. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@196329 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test')
-rw-r--r--test/CMakeLists.txt1
-rw-r--r--test/lit.cfg13
2 files changed, 8 insertions, 6 deletions
diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt
index d6f7dab128..373b1eec7c 100644
--- a/test/CMakeLists.txt
+++ b/test/CMakeLists.txt
@@ -15,6 +15,7 @@ endif()
# Set the depends list as a variable so that it can grow conditionally.
# NOTE: Sync the substitutions in test/lit.cfg when adding to this list.
set(LLVM_TEST_DEPENDS
+ llvm-config
UnitTests
BugpointPasses
LLVMHello
diff --git a/test/lit.cfg b/test/lit.cfg
index df1f4a1019..251dbe0966 100644
--- a/test/lit.cfg
+++ b/test/lit.cfg
@@ -305,18 +305,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: