llvm-project/libcxx/test/libcxx
Asiri Rathnayake 8c2bf45da9 [libcxx] Introduce an externally-threaded libc++ variant.
This patch further decouples libc++ from pthread, allowing libc++ to be built
against other threading systems. There are two main use cases:

- Building libc++ against a thread library other than pthreads.

- Building libc++ with an "external" thread API, allowing a separate library to
  provide the implementation of that API.

The two use cases are quite similar, the second one being sligtly more
de-coupled than the first. The cmake option LIBCXX_HAS_EXTERNAL_THREAD_API
enables both kinds of builds. One needs to place an <__external_threading>
header file containing an implementation of the "libc++ thread API" declared
in the <__threading_support> header.

For the second use case, the implementation of the libc++ thread API can
delegate to a custom "external" thread API where the implementation of this
external API is provided in a seperate library. This mechanism allows toolchain
vendors to distribute a build of libc++ with a custom thread-porting-layer API
(which is the "external" API above), platform vendors (recipients of the
toolchain/libc++) are then required to provide their implementation of this API
to be linked with (end-user) C++ programs.

Note that the second use case still requires establishing the basic types that
get passed between the external thread library and the libc++ library
(e.g. __libcpp_mutex_t). These cannot be opaque pointer types (libc++ sources
won't compile otherwise). It should also be noted that the second use case can
have a slight performance penalty; as all the thread constructs need to cross a
library boundary through an additional function call.

When the header <__external_threading> is omitted, libc++ is built with the
"libc++ thread API" (declared in <__threading_support>) as the "external" thread
API (basic types are pthread based). An implementation (pthread based) of this
API is provided in test/support/external_threads.cpp, which is built into a
separate DSO and linked in when running the libc++ test suite. A test run
therefore demonstrates the second use case (less the intermediate custom API).

Differential revision: https://reviews.llvm.org/D21968

Reviewers: bcraig, compnerd, EricWF, mclow.lists
llvm-svn: 281179
2016-09-11 21:46:40 +00:00
..
algorithms Add heterogeneous comparator support for __debug_less. Fixes PR17147. 2016-07-19 23:27:18 +00:00
atomics atomics.align: XFAIL GCC 2016-08-01 20:28:13 +00:00
containers Fix new ASAN failures 2016-08-15 20:50:01 +00:00
depr Move remaining _LIBCPP_VERSION tests into test/libcxx 2016-06-22 02:23:22 +00:00
diagnostics Move more _LIBCPP_VERSION tests to test/libcxx. 2016-06-22 02:07:26 +00:00
experimental [libcxx] Add std::any 2016-08-11 03:13:11 +00:00
extensions Fix or move various non-standard tests. 2016-04-29 04:07:45 +00:00
input.output Move remaining _LIBCPP_VERSION tests into test/libcxx 2016-06-22 02:23:22 +00:00
iterators Mark LWG 2716 as complete - shuffle and sample disallows lvalue URNGs. 2016-08-28 21:55:00 +00:00
language.support Move all tests for _LIBCPP_VERSION in language.support to test/libcxx/language.support. 2016-06-22 01:55:59 +00:00
localization Fix C++03 build 2016-06-26 23:18:23 +00:00
numerics Move remaining _LIBCPP_VERSION tests into test/libcxx 2016-06-22 02:23:22 +00:00
selftest Add some checking so that the TEST_HAS_XXX macros match up with the _LIBCPP_NO_HAS_XXX macros. No functional change 2016-05-17 14:58:09 +00:00
strings Move more _LIBCPP_VERSION tests to test/libcxx. 2016-06-22 02:07:26 +00:00
test [libcxx] Introduce an externally-threaded libc++ variant. 2016-09-11 21:46:40 +00:00
thread [libcxx] Introduce an externally-threaded libc++ variant. 2016-09-11 21:46:40 +00:00
type_traits Move __lazy_* metafunctions to type traits and add tests 2015-08-31 03:50:31 +00:00
utilities Add missing REQUIRES for C++14 2016-08-11 03:33:41 +00:00
__init__.py
compiler.py Disable warning flags when running .fail.cpp tests. 2016-07-20 23:37:28 +00:00
double_include.sh.cpp Suppress clang warnings in some tests 2015-08-30 22:04:20 +00:00
util.py Add missing license headers 2016-01-19 21:52:04 +00:00