[libcxxabi] Refactor building and testing libc++abi without threads
Summary:
This patch adds CMake support for building and testing libc++abi without threads.
1. Add `LIBCXXABI_ENABLE_THREADS` option to CMake.
2. Propagate `LIBCXXABI_ENABLE_THREADS` to lit via lit.site.cfg.in
3. Configure tests for `LIBCXXABI_ENABLE_THREADS=OFF
Currently the test suite does not work when libc++abi is built without threads because that information does not propagate to the test suite.
Reviewers: danalbert, mclow.lists, jroelofs
Reviewed By: jroelofs
Subscribers: cfe-commits
Differential Revision: http://reviews.llvm.org/D6393
llvm-svn: 222702
diff --git a/libcxxabi/test/test_exception_storage.cpp b/libcxxabi/test/test_exception_storage.cpp
index f1e2fb5..0d5deaa 100644
--- a/libcxxabi/test/test_exception_storage.cpp
+++ b/libcxxabi/test/test_exception_storage.cpp
@@ -56,7 +56,10 @@
#if LIBCXXABI_HAS_NO_THREADS
size_t thread_globals;
- retVal = thread_code(&thread_globals) != 0;
+ // Check that __cxa_get_globals() is not NULL.
+ if (thread_code(&thread_globals) == 0) {
+ retVal = 1;
+ }
#else
// Make the threads, let them run, and wait for them to finish
for ( int i = 0; i < NUMTHREADS; ++i )