summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorEric Fiselier <eric@efcs.ca>2017-03-04 01:26:41 +0000
committerEric Fiselier <eric@efcs.ca>2017-03-04 01:26:41 +0000
commitda7d616fd2870e097eaa85bcec38b97a6d6dbde2 (patch)
tree456d7a3ee7bed40b732b66996326889b9fb2a54f /test
parent9e9cb7b0c2dfc5a108b1f76a05ea415c19e5f890 (diff)
Fix PR25874 - Detect features required for cxa_thread_atexit_test.pass.cpp
git-svn-id: https://llvm.org/svn/llvm-project/libcxxabi/trunk@296940 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test')
-rw-r--r--test/CMakeLists.txt1
-rw-r--r--test/cxa_thread_atexit_test.pass.cpp5
-rw-r--r--test/libcxxabi/test/config.py3
-rw-r--r--test/lit.site.cfg.in1
4 files changed, 10 insertions, 0 deletions
diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt
index c1819d7..f0c10ec 100644
--- a/test/CMakeLists.txt
+++ b/test/CMakeLists.txt
@@ -18,6 +18,7 @@ pythonize_bool(LIBCXXABI_ENABLE_THREADS)
pythonize_bool(LIBCXXABI_ENABLE_EXCEPTIONS)
pythonize_bool(LIBCXXABI_USE_LLVM_UNWINDER)
pythonize_bool(LIBCXXABI_BUILD_EXTERNAL_THREAD_LIBRARY)
+pythonize_bool(LIBCXXABI_HAS_CXA_THREAD_ATEXIT_IMPL)
set(LIBCXXABI_TARGET_INFO "libcxx.test.target_info.LocalTI" CACHE STRING
"TargetInfo to use when setting up test environment.")
set(LIBCXXABI_EXECUTOR "None" CACHE STRING
diff --git a/test/cxa_thread_atexit_test.pass.cpp b/test/cxa_thread_atexit_test.pass.cpp
index 56984f0..f612848 100644
--- a/test/cxa_thread_atexit_test.pass.cpp
+++ b/test/cxa_thread_atexit_test.pass.cpp
@@ -10,6 +10,11 @@
// UNSUPPORTED: libcxxabi-no-threads
// REQUIRES: linux
+// this test will only work if CMake detects a real __cxa_thread_atexit_impl
+// at configure time. This function, however, was added only in glibc 2.18,
+// and there are still plenty of systems only using 2.17 (Ex RHEL 7).
+// XFAIL: libcxxabi-no-cxa-thread-atexit-impl
+
#include <assert.h>
#include <cxxabi.h>
diff --git a/test/libcxxabi/test/config.py b/test/libcxxabi/test/config.py
index e219961..c6982ad 100644
--- a/test/libcxxabi/test/config.py
+++ b/test/libcxxabi/test/config.py
@@ -45,6 +45,9 @@ class Configuration(LibcxxConfiguration):
# test_exception_storage_nodynmem.pass.cpp fails under this specific configuration
if self.get_lit_bool('cxx_ext_threads', False) and self.get_lit_bool('libcxxabi_shared', False):
self.config.available_features.add('libcxxabi-shared-externally-threaded')
+ if not self.get_lit_bool('has_cxa_thread_atexit_impl', True):
+ self.config.available_features.add(
+ 'libcxxabi-no-cxa-thread-atexit-impl')
def configure_compile_flags(self):
self.cxx.compile_flags += ['-DLIBCXXABI_NO_TIMER']
diff --git a/test/lit.site.cfg.in b/test/lit.site.cfg.in
index 9c0fdf2..a650660 100644
--- a/test/lit.site.cfg.in
+++ b/test/lit.site.cfg.in
@@ -20,6 +20,7 @@ config.host_triple = "@LLVM_HOST_TRIPLE@"
config.target_triple = "@TARGET_TRIPLE@"
config.use_target = len("@LIBCXXABI_TARGET_TRIPLE@") > 0
config.cxx_ext_threads = "@LIBCXXABI_BUILD_EXTERNAL_THREAD_LIBRARY@"
+config.has_cxa_thread_atexit_impl = "@LIBCXXABI_HAS_CXA_THREAD_ATEXIT_IMPL@"
# Let the main config do the real work.
lit_config.load_config(config, "@LIBCXXABI_SOURCE_DIR@/test/lit.cfg")