summaryrefslogtreecommitdiffstats
path: root/libcxx
diff options
context:
space:
mode:
authorEric Fiselier <eric@efcs.ca>2014-12-12 02:36:23 +0000
committerEric Fiselier <eric@efcs.ca>2014-12-12 02:36:23 +0000
commit7a68749f7f9ec455fe1860b6d8f8029a0a7ed8cd (patch)
tree1d3f0718468dacdf8b2c3fff0e5b7bcadde963e0 /libcxx
parent1e3a4ebc6e1af1bbacc795d21b15efbe63bfdee2 (diff)
downloadbcm5719-llvm-7a68749f7f9ec455fe1860b6d8f8029a0a7ed8cd.tar.gz
bcm5719-llvm-7a68749f7f9ec455fe1860b6d8f8029a0a7ed8cd.zip
Fix building and running tests when LIBCXX_ENABLE_EXCEPTIONS or LIBCXX_ENABLE_RTTI are turned off.
llvm-svn: 224095
Diffstat (limited to 'libcxx')
-rw-r--r--libcxx/src/memory.cpp2
-rw-r--r--libcxx/test/CMakeLists.txt2
-rw-r--r--libcxx/test/lit.cfg11
-rw-r--r--libcxx/test/lit.site.cfg.in2
4 files changed, 16 insertions, 1 deletions
diff --git a/libcxx/src/memory.cpp b/libcxx/src/memory.cpp
index c56d031adfb..8a4eb34811f 100644
--- a/libcxx/src/memory.cpp
+++ b/libcxx/src/memory.cpp
@@ -111,7 +111,7 @@ __shared_weak_count::lock() _NOEXCEPT
return 0;
}
-#ifndef _LIBCPP_NO_RTTI
+#if !defined(_LIBCPP_NO_RTTI) || !defined(_LIBCPP_BUILD_STATIC)
const void*
__shared_weak_count::__get_deleter(const type_info&) const _NOEXCEPT
diff --git a/libcxx/test/CMakeLists.txt b/libcxx/test/CMakeLists.txt
index 4c8193eab99..0d053b4b016 100644
--- a/libcxx/test/CMakeLists.txt
+++ b/libcxx/test/CMakeLists.txt
@@ -27,6 +27,8 @@ if(PYTHONINTERP_FOUND)
set(LIBCXX_SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/..)
set(LIBCXX_BINARY_DIR ${CMAKE_BINARY_DIR})
set(PYTHON_EXECUTABLE ${PYTHON_EXECUTABLE})
+ pythonize_bool(LIBCXX_ENABLE_EXCEPTIONS)
+ pythonize_bool(LIBCXX_ENABLE_RTTI)
pythonize_bool(LIBCXX_ENABLE_SHARED)
pythonize_bool(LIBCXX_ENABLE_THREADS)
pythonize_bool(LIBCXX_ENABLE_MONOTONIC_CLOCK)
diff --git a/libcxx/test/lit.cfg b/libcxx/test/lit.cfg
index 6f1303a1963..8bad0308efc 100644
--- a/libcxx/test/lit.cfg
+++ b/libcxx/test/lit.cfg
@@ -426,6 +426,16 @@ class Configuration(object):
self.compile_flags += ['-D__STDC_FORMAT_MACROS',
'-D__STDC_LIMIT_MACROS',
'-D__STDC_CONSTANT_MACROS']
+ enable_exceptions = self.get_lit_bool('enable_exceptions', True)
+ if enable_exceptions:
+ self.config.available_features.add('exceptions')
+ else:
+ self.compile_flags += ['-fno-exceptions']
+ enable_rtti = self.get_lit_bool('enable_rtti', True)
+ if enable_rtti:
+ self.config.available_features.add('rtti')
+ else:
+ self.compile_flags += ['-fno-rtti', '-D_LIBCPP_NO_RTTI']
# Configure threading features.
enable_threads = self.get_lit_bool('enable_threads', True)
enable_monotonic_clock = self.get_lit_bool('enable_monotonic_clock', True)
@@ -439,6 +449,7 @@ class Configuration(object):
self.lit_config.fatal('enable_monotonic_clock cannot be false when'
' enable_threads is true.')
+
def configure_link_flags(self):
# Configure library search paths
abi_library_path = self.get_lit_conf('abi_library_path', '')
diff --git a/libcxx/test/lit.site.cfg.in b/libcxx/test/lit.site.cfg.in
index 47e88d8c8e9..32619717d90 100644
--- a/libcxx/test/lit.site.cfg.in
+++ b/libcxx/test/lit.site.cfg.in
@@ -4,6 +4,8 @@ config.std = "@LIBCXX_STD_VERSION@"
config.libcxx_src_root = "@LIBCXX_SOURCE_DIR@"
config.libcxx_obj_root = "@LIBCXX_BINARY_DIR@"
config.python_executable = "@PYTHON_EXECUTABLE@"
+config.enable_exceptions = "@LIBCXX_ENABLE_EXCEPTIONS@"
+config.enable_rtti = "@LIBCXX_ENABLE_RTTI@"
config.enable_shared = "@LIBCXX_ENABLE_SHARED@"
config.enable_threads = "@LIBCXX_ENABLE_THREADS@"
config.enable_monotonic_clock = "@LIBCXX_ENABLE_MONOTONIC_CLOCK@"
OpenPOWER on IntegriCloud