Commit Graph

1143 Commits

Author SHA1 Message Date
Eric Fiselier 1df02ee1f9 Mark std::packaged_task tests as unsupported in C++03.
std::packaged_task requires variadic templates and is #ifdef out in C++03.
This patch silences the tests in C++03. This patch also rewrites the .fail.cpp tests so that they use clang verify.

llvm-svn: 245413
2015-08-19 04:10:15 +00:00
Eric Fiselier 10967a6ea6 [libcxx] Add Atomic test helper and fix TSAN failures.
Summary:
This patch attempts to fix the last 3 TSAN failures on the libc++ bot (http://lab.llvm.org:8011/builders/libcxx-libcxxabi-x86_64-linux-ubuntu-tsan/builds/143). This patch also adds a `Atomic` test type that can be used where `<atomic>` cannot.

`wait.exception.pass.cpp` and `wait_for.exception.pass.cpp` were failing because the test replaced `std::terminate` with `std::exit`. `std::exit` would asynchronously run the TLS and static destructors and this would cause a race condition. See PR22606 and D8802 for more details. 

This is fixed by using `_Exit` to prevent cleanup.

`notify_all_at_thread_exit.pass.cpp` exercises the same race condition but for different reasons. I fixed this test by manually joining the thread before beginning program termination.

Reviewers: EricWF, mclow.lists

Subscribers: cfe-commits

Differential Revision: http://reviews.llvm.org/D11046

llvm-svn: 245389
2015-08-18 23:29:59 +00:00
Eric Fiselier 0d28f78401 [libcxx] Fix PR23589: std::function doesn't recognize null pointer to varargs function.
Summary:
This patch fixes __not_null's detection of nullptr by breaking it down into 4 cases.

1. `__not_null(Tp const&)`: Default case. Tp is not null.
2. `__not_null(Tp* __ptr);` Case for pointers to functions.
3. `__not_null(_Ret _Class::* __ptr);` Case for pointers to members.
4. `__not_null(function<Tp> const&);`: Cases for other std::functions.

Reviewers: mclow.lists

Subscribers: cfe-commits

Differential Revision: http://reviews.llvm.org/D11111

llvm-svn: 245335
2015-08-18 19:41:51 +00:00
Marshall Clow 1378a5aec3 implement more of N4258 - Cleaning up noexcept in the standard library. Specifically add new noexcept stuff to vector and string's move-assignment operations
llvm-svn: 245330
2015-08-18 18:57:00 +00:00
Eric Fiselier 32ad52170c Fix failing unique_ptr tests.
When I was refactoring the unique_ptr.single.ctor tests I added a test
deleter, 'NCDeleter', to deleter.h. Other tests that include deleter.h
redefine the NCDeleter type causing test failures.

llvm-svn: 243733
2015-07-31 04:34:25 +00:00
Eric Fiselier a0832b5743 Start cleanup of unique_ptr tests.
One of the last sections of tests that still fail in C++03 are the unique_ptr
tests. This patch begins cleaning up the tests and fixing C++03 failures.

The main changes of this patch:
  - The "Deleter" type in "deleter.h" tried to be "move-only" in C++03. However
    the move simulation no longer works (see "__rv"). "Deleter" is now copy
    constructible in C++03. However copying "Deleter" will "move" the test value
    instead of copying it.

  - Reduce the unique.ptr.single.ctor tests files from ~25 to 4. There is no
    reason the tests were split through so many files.

llvm-svn: 243730
2015-07-31 02:43:52 +00:00
Eric Fiselier 3461dbc0a7 [libcxx] Add <experimental/any> v2.
Summary:
This patch adds the second revision of <experimental/any>. 
I've been working from the LFTS draft found at this link. https://rawgit.com/cplusplus/fundamentals-ts/v1/fundamentals-ts.html#any



Reviewers: danalbert, jroelofs, K-ballo, mclow.lists

Subscribers: cfe-commits

Differential Revision: http://reviews.llvm.org/D6762

llvm-svn: 243728
2015-07-31 02:24:58 +00:00
Eric Fiselier 10ed6c361c Reapply working parts of CMake cleanup.
This patch adds the working parts of r243503. The difference with this patch
is that it doesn't include the HandleLLVMOptions.cmake file.

llvm-svn: 243698
2015-07-30 22:30:34 +00:00
Marshall Clow 40631133b4 Change some #ifdefs to #if - thanks to Dexon for thge catch.
llvm-svn: 243641
2015-07-30 13:56:00 +00:00
Eric Fiselier b98aa4359a Revert recent CMake changes again due to failing compiler-rt builds
llvm-svn: 243593
2015-07-29 23:46:55 +00:00
Eric Fiselier ff16b9ac90 Recommit r243503 "[libcxx] Cleanup CMake configuration and integrate with LLVM"
This change was reverted in r243550 because it broke clang-format builds
(see PR24306).

This patch recommits a fixed version of the original.

llvm-svn: 243574
2015-07-29 21:07:28 +00:00
Hans Wennborg 1e33bbecb9 Revert r243503 "[libcxx] Cleanup CMake configuration and integrate with LLVM"
This caused clang-format to stop linking on Mac; see PR24306.

llvm-svn: 243550
2015-07-29 18:32:21 +00:00
Marshall Clow adfdae18c8 Fix a self-move bug in inplace_merge. Thanks to Ted and Dexon for the report and the suggested fix.
llvm-svn: 243530
2015-07-29 16:25:45 +00:00
Eric Fiselier 7eb30deff1 [libcxx] Cleanup CMake configuration and integrate with LLVM
Summary:
This patch contains the following changes:

1. Require that libc++ can find a LLVM source directory. This is done the same way as `libc++abi` currently does.
2. Cleanup ugly configuration code in CMakeLists.txt by using `add_flags`, `add_flags_if`, and `add_flags_if_supported` macros.

The goals for this patch are:

1. Help libc++ be more consistent with how LLVM handles CMake options (see PR23670 PR23671).
2. Make it easier to use sanitizers using the `LLVM_USE_SANITIZER` option.
3. Make libc++'s CMakeLists.txt file easier to understand and change.
4. Move towards allowing libc++ to create Sphinx documentation (see http://efcs.ca/libcxx-docs). 
5. Move towards allowing  libc++ to use other LLVM utilities such as `not` and `FileCheck`.

  

Reviewers: mclow.lists, jroelofs, danalbert

Subscribers: cfe-commits

Differential Revision: http://reviews.llvm.org/D11308

llvm-svn: 243503
2015-07-29 00:03:51 +00:00
Eric Fiselier 99a47ef90e Remove sanitizer XFAILs on a test.
llvm-svn: 243499
2015-07-28 23:27:03 +00:00
Eric Fiselier 10e51f84d4 Mark async tests as UNSUPPORTED in C++03 because it requires variadics
llvm-svn: 243393
2015-07-28 07:49:15 +00:00
Eric Fiselier abd52cad84 Fix a handful of tests that fail in C++03
llvm-svn: 243392
2015-07-28 07:31:50 +00:00
Eric Fiselier 522b1d14ef Checking more __invoke tests.
Before I start trying to fix __invoke in C++03 it needs better test coverage.
This patch adds a large amount of tests for __invoke.

llvm-svn: 243366
2015-07-28 01:25:36 +00:00
Marshall Clow 983d178108 Detect and throw on a class of bad regexes that we mistakenly accepted before. Thanks to Trevor Smigiel for the report
llvm-svn: 243030
2015-07-23 18:27:51 +00:00
Justin Bogner 2ea8daaee1 Mark this test as XFAIL with older compilers, since they hit PR18097
llvm-svn: 242967
2015-07-22 23:32:57 +00:00
Eric Fiselier e5407178d6 Cleanup <__functional_03>
<__functional_03> provides the C++03 definitions for std::memfun and
std::function. However the interaction between <functional> and <__functional_03>
is ugly and duplicates code needlessly. This patch cleans up how the two
headers work together.

The major changes are:

- Provide placeholders, is_bind_expression and is_placeholder in <functional>
  for both C++03 and C++11.

- Provide bad_function_call, function fwd decl,
  __maybe_derive_from_unary_function and __maybe_derive_from_binary_function
  in <functional> for both C++03 and C++11.

- Move the <__functional_03> include to the bottom of <functional>. This makes
  it easier to see how <__functional_03> interacts with <functional>

- Remove a commented out implementation of bind in C++03. It's never going
  to get implemented.

- Mark almost all std::bind tests as unsupported in C++03. std::is_placeholder
  works in C++03 and C++11. std::is_bind_expression is provided in C++03 but
  always returns false.

llvm-svn: 242870
2015-07-22 04:14:38 +00:00
Eric Fiselier d1bac4ce57 [libcxx] Add support for sanitizers on OS X.
Summary: This patch adds special configuration logic to find the compiler_rt libraries required by sanitizers on OS X. The supported sanitizers are Address and Undefined.

Reviewers: mclow.lists

Subscribers: cfe-commits

Differential Revision: http://reviews.llvm.org/D11381

llvm-svn: 242858
2015-07-22 00:33:36 +00:00
Marshall Clow 1aa4567712 Mark new tests as unsupported before C++11
llvm-svn: 242695
2015-07-20 19:27:47 +00:00
Marshall Clow 205c333c99 Implement the default searcher for std::experimental::search.
llvm-svn: 242682
2015-07-20 16:39:28 +00:00
Marshall Clow 81416e492e Implement the plugin-based version of std::search. There are no searchers yet; those are coming soon.
llvm-svn: 242679
2015-07-20 15:40:27 +00:00
Eric Fiselier ca345e0032 Fix warnings in unordered_map
llvm-svn: 242634
2015-07-19 03:16:47 +00:00
Eric Fiselier 3e572598d3 Fix warnings in forwardlist
llvm-svn: 242633
2015-07-19 00:38:37 +00:00
Eric Fiselier c45b673d5d Fix warnings in deque tests
llvm-svn: 242632
2015-07-19 00:31:54 +00:00
Eric Fiselier 80fe6bd142 Commit file missing from r242629
llvm-svn: 242630
2015-07-19 00:11:50 +00:00
Eric Fiselier 2decfad7c5 Fix warnings in array and assoc containers
llvm-svn: 242629
2015-07-18 23:56:04 +00:00
Eric Fiselier 203f687971 Cleanup warnings in test/std/depr
llvm-svn: 242627
2015-07-18 22:51:51 +00:00
Eric Fiselier 19fa337610 Fix warnings in test/std/algorithms
llvm-svn: 242626
2015-07-18 21:53:16 +00:00
Eric Fiselier b67e689f02 Fix unused variable warnings in atomic tests
llvm-svn: 242625
2015-07-18 21:40:37 +00:00
Eric Fiselier 5fd308971d Fix warnings in test/std/language.support
llvm-svn: 242624
2015-07-18 21:17:16 +00:00
Marshall Clow dd2b7a0a0e Fix up typos in a couple of tests; due to agressive short-circuiting, they never failed on clang or gcc, but MSVC whined. Patch by Andrew Parker.
llvm-svn: 242618
2015-07-18 18:24:15 +00:00
Eric Fiselier 980eda3fc2 Add missing instrumentation in vector::insert - Patch from Anna Zaks
This patch was reviewed as D10859. http://reviews.llvm.org/D10859

llvm-svn: 242617
2015-07-18 18:22:12 +00:00
Eric Fiselier 083abfb3f6 [libcxx] Get is_*_destructible tests passing in C++03.
Summary: This patch adds proper guards to the is_destructible tests depending on the standard version so that they pass in c++03.

Reviewers: mclow.lists, EricWF

Subscribers: cfe-commits

Differential Revision: http://reviews.llvm.org/D10047

llvm-svn: 242612
2015-07-18 16:43:58 +00:00
Eric Fiselier 88558e22b0 Cleanup tests that fail in C++1z and with Clang 3.8
llvm-svn: 242581
2015-07-17 22:27:43 +00:00
Marshall Clow 9c9b0ec554 Include what we use, instead of letting them get pulled in implictly. This makes the tests work on VS. Thanks to STL for the report
llvm-svn: 242454
2015-07-16 22:13:26 +00:00
Marshall Clow 05fc0f25d6 Make sure that __libcpp_compressed_pair_imp default-constructs its' members, rather than value-initializing them. Fixes PR#24137
llvm-svn: 242377
2015-07-16 03:05:06 +00:00
Marshall Clow 5cbce174d9 Mark two tests as failing on clang 3.8 (they failed on 3.7, too)
llvm-svn: 242375
2015-07-16 02:44:33 +00:00
Eric Fiselier 16270a0b09 Remove non-ascii characters
llvm-svn: 242197
2015-07-14 20:45:48 +00:00
Eric Fiselier 5be45129a4 Implement n4169 - Add invoke function template
llvm-svn: 242195
2015-07-14 20:16:15 +00:00
Eric Fiselier 092c475e25 Fix PR24114 - std::atomic for non-Clang is not a literal type
Add _LIBCPP_CONSTEXPR to the implementation of __gcc_atomic_t.

llvm-svn: 242172
2015-07-14 17:50:27 +00:00
Marshall Clow 71ff7c3f0f Move bits from N4258. Mark vector's move-constructor unconditionally noexcept in C++1z
llvm-svn: 242148
2015-07-14 14:46:32 +00:00
Marshall Clow e3fbe1433b Implement the first part of N4258: 'Cleaning up noexcept in the Library'. This patch deals with swapping containers, and implements a more strict noexcept specification (a conforming extension) than the standard mandates.
llvm-svn: 242056
2015-07-13 20:04:56 +00:00
Eric Fiselier 2d15f15f28 [libcxx] LWG2420 bits for bind<void> - Patch from K-Ballo
Implemented LWG2420 bits for bind<void>

Review: http://reviews.llvm.org/D10997
llvm-svn: 241967
2015-07-10 23:29:18 +00:00
Eric Fiselier be4e0eb1c2 Fix error string in test suite
llvm-svn: 241757
2015-07-08 23:10:20 +00:00
Marshall Clow bc4c89a977 The rest of N4279 and LWG#2464 - for unordered_map
llvm-svn: 241555
2015-07-07 05:45:35 +00:00
Marshall Clow 8aaf517db7 Implement N4279 and LWG#2664 for <map>. Reviewed as http://reviews.llvm.org/D10669
llvm-svn: 241539
2015-07-07 03:37:33 +00:00
Eric Fiselier 1faf289e27 [libcxx] Add atomic_support.h header to src that handles needed atomic operations.
Summary:
In some places in libc++ we need to use the `__atomic_*` builtins. This patch adds a header that provides access to those builtins in a uniform way from within the dylib source.

If the compiler building the dylib does not support these builtins then a warning is issued.

Only relaxed loads are needed within the headers. A singe function to do these relaxed loads has been added to `<memory>`.

This patch applies the new atomic builtins to `__shared_count` and `call_once`.

Reviewers: mclow.lists

Subscribers: majnemer, jroelofs, cfe-commits

Differential Revision: http://reviews.llvm.org/D10406

llvm-svn: 241532
2015-07-07 00:27:16 +00:00
Eric Fiselier 4cd59b3f49 Automatically detect and use clang verify in failure tests.
Automatically enable clang verify whenever the '-verify-ignore-unexpected' flag
is supported.
Failure tests are run using verify if they contain one or more "expected-*"
diagnostics tags. Otherwise they are run normally.

llvm-svn: 241492
2015-07-06 19:56:45 +00:00
Marshall Clow f43a42d53e Noticed that std::allocator<const T> was missing the definition for is_always_equal. Fixed this, and added a test for it.
llvm-svn: 241190
2015-07-01 21:23:40 +00:00
Marshall Clow 5b03e1ada8 Forgot the support include file in r241091
llvm-svn: 241092
2015-06-30 18:16:12 +00:00
Marshall Clow f8457a0735 Add tests for LWG#2299. While doing so, I noticed that the tests we have for the transparent comparators don't actually call them. Fix those tests, too. Now one of them is failing, due to a missing const in <map>. Add that (twice). Next step is to do the same for <unordered_map>
llvm-svn: 241091
2015-06-30 18:15:41 +00:00
Marshall Clow 660dcd9168 Implement LWG#2407: 'packaged_task(allocator_arg_t, const Allocator&, F&&) should neither be constrained nor explicit'
llvm-svn: 241068
2015-06-30 14:16:49 +00:00
Marshall Clow f69ae47128 Implement N4508: shared_mutex. Reviewed as http://reviews.llvm.org/D10480
llvm-svn: 241067
2015-06-30 14:04:14 +00:00
Ed Schouten e0cf3b9a3c Make support for thread-unsafe C functions optional.
One of the aspects of CloudABI is that it aims to help you write code
that is thread-safe out of the box. This is very important if you want
to write libraries that are easy to reuse. For CloudABI we decided to
not provide the thread-unsafe functions. So far this is working out
pretty well, as thread-unsafety issues are detected really early on.

The following patch adds a knob to libc++,
_LIBCPP_HAS_NO_THREAD_UNSAFE_C_FUNCTIONS, that can be set to disable
thread-unsafe functions that can easily be avoided in practice. The
following functions are not thread-safe:

- <clocale>: locale handles should be preferred over setlocale().
- <cstdlib>: mbrlen(), mbrtowc() and wcrtomb() should be preferred over
  their non-restartable counterparts.
- <ctime>: asctime(), ctime(), gmtime() and localtime() are not
  thread-safe. The first two are also deprecated by POSIX.

Differential Revision:	http://reviews.llvm.org/D8703
Reviewed by:	marshall

llvm-svn: 240527
2015-06-24 08:44:38 +00:00
Marshall Clow 99f5fc937f Make seeking on an ostream that has eofbit set work correctly. Fixes PR#21361
llvm-svn: 240286
2015-06-22 15:01:21 +00:00
Marshall Clow 55112defb0 Fix PR#18843. Thanks to Howard for the fix
llvm-svn: 240136
2015-06-19 15:54:13 +00:00
Eric Fiselier b11df184ad Fix std::function allocator constructors in C++03.
The C++03 version of function tried to default construct the allocator
in the uses allocator constructors when no allocation was performed. These
constructors would fail to compile when used with allocators that had no
default constructor.

llvm-svn: 239708
2015-06-14 23:30:09 +00:00
Eric Fiselier d9ad0cbd70 Cleanup result_of tests and fix issues with the C++03 result_of.
The two main fixes this patch contains are:
- use __identity_t instead of common_type. common_type was used as an
  identity metafunction but the decay resulted in incorrect results.
- Pointers to free functions were not counted as functions. Remove the pointer
  before checking if a type is a function.

llvm-svn: 239668
2015-06-13 08:25:24 +00:00
Eric Fiselier de3f2b396c Fix PR12999 - unordered_set::insert calls operator new when no insert occurs
Summary:
when `unordered_set::insert(value_type&&)` was called it would be treated like `unordered_set::emplace(Args&&)` and it would allocate and construct a node before trying to insert it.
This caused unnecessary allocations when the value was already in the set. This patch adds an overload to `__hash_table::__insert_unique` that specifically handles `value_type&&` more link `value_type const &`. 

This patch also adds a single unified insert function for values into  `__hash_table` called `__insert_unique_value` that handles the cases for `__insert_unique(value_type&&)` and `__insert_unique(value_type const &)`. 

This patch fixes PR12999: http://llvm.org/bugs/show_bug.cgi?id=12999.




Reviewers: mclow.lists, titus, danalbert

Reviewed By: danalbert

Subscribers: cfe-commits

Differential Revision: http://reviews.llvm.org/D7570

llvm-svn: 239666
2015-06-13 07:18:32 +00:00
Eric Fiselier 793f59e767 LWG2442: call_once() shouldn't DECAY_COPY(). Patch from K-Ballo.
This patch fixes LWG issue 2422 by removing the DECAY_COPY from call once.
The review can be found here: http://reviews.llvm.org/D10191

llvm-svn: 239654
2015-06-13 02:23:00 +00:00
Eric Fiselier 8aba6a6db4 Refactor is_member_function_pointer to use is_function and not __member_function_traits.
Replacing the dependancy on __member_function_traits with is_function allows
is_member_function_pointer to work more often. In particular it allows it to
work when we don't have variadic templates but the function has an arity > 3.

llvm-svn: 239649
2015-06-13 00:33:13 +00:00
Eric Fiselier b3ec43d78a Fix PR23293 - Do not unlock shared state before notifying consumers.
Within the shared state methods do not unlock the lock guards manually. This
could cause a race condition where the shared state is destroyed before the
method is complete.

llvm-svn: 239577
2015-06-12 00:41:34 +00:00
Marshall Clow 767c45719f Change #ifdefs in test to UNSUPPORTED. No functionality change in the tests
llvm-svn: 239562
2015-06-11 21:47:39 +00:00
Marshall Clow b41e76bb0b Fix PR#23767. Add tests for iterator invalidation for deque::erase/pop_front/pop_back
llvm-svn: 239196
2015-06-05 22:34:19 +00:00
Marshall Clow 979550f221 While applying N4258, I forgot about LWG#2455, which modified the modifications. Correct those - h/t: Howard
llvm-svn: 239004
2015-06-04 02:05:41 +00:00
Marshall Clow a8ae392718 More N4258 changes. This time vector's constructors
llvm-svn: 238990
2015-06-04 00:10:20 +00:00
Marshall Clow cbf166a2b9 More of N4258 implementation. Mark all of our test_allocators as noexcept constructible. Make the constructors for basic_string noexcept all the time (under C++14). Update tests to reflect the new world order. More to come.
llvm-svn: 238957
2015-06-03 19:56:43 +00:00
Marshall Clow 2abfcd5606 Add 'is_always_equal' tests for scoped_allocator. Found that I had typed '||' where I meant '&&' in the code; fixed that, too
llvm-svn: 238931
2015-06-03 16:15:55 +00:00
Marshall Clow 31a4731370 Implement the first part of N4258 - allocator_traits<X>::is_always_equal. Also fixes PR#23723
llvm-svn: 238848
2015-06-02 16:34:03 +00:00
Marshall Clow 89102f0fa9 Implement uncaught_exceptions() using the newly added hooks in libc++abi, when available
llvm-svn: 238846
2015-06-02 15:33:38 +00:00
Eric Fiselier a84544ac7a Add TODO items and remove use of 'noexcept' in C++03 test.
llvm-svn: 238802
2015-06-02 01:25:34 +00:00
Marshall Clow a7fb9a041d Fix PR#23647 - make_shared<volatile bool> - second try
llvm-svn: 238370
2015-05-27 22:44:47 +00:00
Marshall Clow 188b98b505 Revert 238354 while I figure out what broke in weak_ptr
llvm-svn: 238355
2015-05-27 20:36:14 +00:00
Marshall Clow 263a0f7681 Fix PR#23647 - make_shared<volatile bool>
llvm-svn: 238354
2015-05-27 20:15:33 +00:00
Eric Fiselier 0961f6cc21 Get thread sleep_for test passing in C++03
llvm-svn: 238273
2015-05-27 01:09:51 +00:00
Eric Fiselier ad60a9a516 Mark __convert_to_integral test as XFAIL in c++03
llvm-svn: 238271
2015-05-27 01:02:51 +00:00
Eric Fiselier 3a8fa93ae0 Cleanup move/forward tests and remove references to __rv.
llvm-svn: 238270
2015-05-27 00:51:08 +00:00
Eric Fiselier 6871bcb122 Add test macros header to remove dependance on __config macros.
llvm-svn: 238267
2015-05-27 00:28:30 +00:00
Marshall Clow cd6f7f9d80 Fix broken test I just added
llvm-svn: 238234
2015-05-26 19:17:09 +00:00
Marshall Clow c5c29006dc Add tests to ensure that string/vector/array have contiguous iterators - which they did. Mark N4284 as complete
llvm-svn: 238233
2015-05-26 18:57:27 +00:00
Eric Fiselier 513ae1854d Fix race condition in thread test.
llvm-svn: 237745
2015-05-19 23:41:04 +00:00
Eric Fiselier 4bcd428117 Address @danalberts comments on r237700
llvm-svn: 237740
2015-05-19 23:10:32 +00:00
Eric Fiselier 3de417f408 Fix uninitialized values and bad enum conversions found by UBSAN.
llvm-svn: 237738
2015-05-19 23:03:57 +00:00
Eric Fiselier deb3033cd2 Add compiler flag test support to LIT. Fix new/delete tests on apple-clang.
llvm-svn: 237700
2015-05-19 15:15:53 +00:00
Marshall Clow a00932bddb Implement LWG2433: uninitialized_copy()/etc. should tolerate overloaded operator&
llvm-svn: 237699
2015-05-19 15:01:48 +00:00
Eric Fiselier ab8b1ced0a mark new/delete tests as XFAIL more carefully
llvm-svn: 237664
2015-05-19 03:41:22 +00:00
Eric Fiselier c1a44c4a53 [libcxx] Rework sized delete.
Summary:
This patch does 2 main things:
1. Enable sized delete if the feature test macro `__cpp_sized_deallocation` is enabled.
2. Rework and cleanup all of the sized delete tests.

Test Plan:
The sized delete replacement tests are now split into 4 files:
1. sized_delete11.pass.cpp: Ensure overriding sized delete in C++11 has no effect.
2. sized_delete14.pass.cpp: Test overriding sized delete in C++14 and ensure it is called. This test fails on clang and GCC < 5.1. 
3. size_delete_calls_unsized_delete_.pass.cpp: Test that the default sized delete calls unsized delete.
4. sized_delete_fsizeddeallocation.pass.cpp: Test overriding sized delete when -fsized-deallocation is passed. This test should pass on clang and GCC >= 5.1

I have also removed a lot of cruft from the old tests. They no longer replace the new handler and tests that it is called for bad allocations.

Reviewers: mclow.lists

Reviewed By: mclow.lists

Subscribers: cfe-commits

Differential Revision: http://reviews.llvm.org/D9831

llvm-svn: 237662
2015-05-19 02:03:22 +00:00
Marshall Clow cd6615fd71 Add support for N4389 - std::bool_constant
llvm-svn: 237636
2015-05-18 23:21:06 +00:00
Marshall Clow 0e166e5a9a Fix for LWG Issue 2458: N3778 and new library deallocation signatures.
llvm-svn: 237592
2015-05-18 17:48:45 +00:00
Logan Chien 3b6e51a73f libcxx: Enhance lit test command in verbose mode.
Print both the compiler command and linker command so that it will be
easier for developers to reproduce the failed test cases.

llvm-svn: 237530
2015-05-17 00:24:11 +00:00
Marshall Clow fd30fb22c2 Fix test that was failing on C++03 b/c it was using initializer lists
llvm-svn: 237527
2015-05-16 17:10:49 +00:00
Logan Chien a8e1a28939 Fix build when libunwind is disabled.
The previous commit breaks the builds when libc++abi is not built with
libunwind becuase the default value for LIBCXXABI_USE_LLVM_UNWINDER is
OFF, which is not pythonized.

This CL fix the problem by calling pythonize_bool().

llvm-svn: 237519
2015-05-16 13:10:39 +00:00
Logan Chien 891fd46a0a libcxx: Fix ARM libc++/abi and libunwind buildbot.
The test cases were crashing due to the mixed usage of the unwinding
functions from both libunwind and libgcc_s.  The unwind functions are
mixed because the "llvm_unwinder" entry is not available in the
lit.site.cfg for libc++.  As a result, "-lgcc_s" is picked instead of
"-lunwind".  The extra option to lit --param=link_flags="-lunwind" won't
help either.

This CL fix the problem by adding llvm_unwinder to lit.site.cfg.in.

llvm-svn: 237518
2015-05-16 12:44:31 +00:00
Evgeniy Stepanov 732e2681c7 Implement std::experimental::sample.
Following specification in "C++ Extensions for Library Fundamentals":
http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2015/n4480.html#alg.random.sample

llvm-svn: 237264
2015-05-13 16:55:41 +00:00
Marshall Clow c34f847b80 Fix for LWG Issue 2415: Inconsistency between unique_ptr and shared_ptr
llvm-svn: 236953
2015-05-10 13:59:45 +00:00
Marshall Clow 0b0671ae36 Fix for LWG Issue 2369: constexpr max(initializer_list) vs max_element
llvm-svn: 236952
2015-05-10 13:53:31 +00:00
Marshall Clow ec39296875 Fix for LWG Issue 2059: C++0x ambiguity problem with map::erase
llvm-svn: 236950
2015-05-10 13:35:00 +00:00
Marshall Clow cd26846fc5 Remove some debugging printout lines. No functionality change.
llvm-svn: 236949
2015-05-10 13:26:57 +00:00
Marshall Clow 783b372a58 Fix for LWG2454: Add raw_storage_iterator::base() member
llvm-svn: 236948
2015-05-10 13:14:08 +00:00
Marshall Clow 5e1441bce4 Fix some preprocessor directives that were generating warnings in the test suite.
llvm-svn: 235999
2015-04-28 16:52:30 +00:00
Eric Fiselier 445d718807 Remove constexpr support for std::apply because it introduces regressions.
llvm-svn: 235274
2015-04-19 15:32:52 +00:00
Marshall Clow 60d5e0e027 A few bits of N2994 didn't get fully implemented a long time ago. Thanks to STL@microsoft.com for the bug report
llvm-svn: 235134
2015-04-16 21:36:54 +00:00
Marshall Clow daa4d45c0a Qualify an internal call in is_assignable to prevent ADL lookup, which would 'complete' an type definition unnecessarily. Thanks to Richard Smith for the report.
llvm-svn: 234886
2015-04-14 13:53:53 +00:00
Eric Fiselier 9a37bc91d2 Fix race conditions in test class used throughout the std::thread tests.
The test class 'G' reads and writes to the same static variables in its
constructor, destructor and call operator. When threads are
constructed using `std::thread t((G()))` there is a race condition between the
destruction of the temporary and the execution of `G::operator()()`.

The fix is to simply create the input before creating the thread.

llvm-svn: 233946
2015-04-02 21:12:17 +00:00
Eric Fiselier 4453d2185c [libcxx] Fix bug in shared_timed_mutex that could cause a program to hang.
Summary:
The summary of the bug, provided by Stephan T. Lavavej:

In shared_timed_mutex::try_lock_until() (line 195 in 3.6.0), you need to deliver a notification.  The scenario is:
 
* There are N threads holding the shared lock.
* One thread calls try_lock_until() to attempt to acquire the exclusive lock.  It sets the "I want to write" bool/bit, then waits for the N readers to drain away.
* K more threads attempt to acquire the shared lock, but they notice that someone said "I want to write", so they block on a condition_variable.
* At least one of the N readers is stubborn and doesn't release the shared lock.
* The wannabe-writer times out, gives up, and unsets the "I want to write" bool/bit.
 
At this point, a notification (it needs to be notify_all) must be delivered to the condition_variable that the K wannabe-readers are waiting on.  Otherwise, they can block forever without waking up.



Reviewers: mclow.lists, jyasskin

Reviewed By: jyasskin

Subscribers: jyasskin, cfe-commits

Differential Revision: http://reviews.llvm.org/D8796

llvm-svn: 233944
2015-04-02 21:02:06 +00:00
Eric Fiselier ba7c3ff32f Remove statement with no effect inside tests.
llvm-svn: 233816
2015-04-01 15:49:02 +00:00
Eric Fiselier 78fdf2d0f5 [libcxx] Add code coverage configuration to CMake and LIT.
Summary:
This patch adds configuration to CMake and LIT for running the libc++ test-suite to generate code coverage.

To use code coverage use following instructions.

* Find the clang resource dir using `$CXX -print-search-dirs`. Let <library-dir> be the first library search directory.
* `cmake <regular-options> -DLIBCXX_GENERATE_COVERAGE=ON -DLIBCXX_COVERAGE_LIBRARY=<library-dir>/lib/<platform>/libclang_rt.profile.a <source>`
* `make cxx`
* `make check-libcxx`
* `make generate-libcxx-coverage`


The reason I want this patch upstreamed is so I can setup a bot that generates code coverage and posts in online for every revision. 



Reviewers: mclow.lists, jroelofs, danalbert

Reviewed By: danalbert

Differential Revision: http://reviews.llvm.org/D8716

llvm-svn: 233669
2015-03-31 04:15:45 +00:00
Eric Fiselier 19036fe19b Allow enabling CCache through an env variable. This helps enable/disable the option on buildbots.
llvm-svn: 233659
2015-03-31 01:41:32 +00:00
Marshall Clow 4c30259879 Make the new tests better; make sure that we're testing the case where no reallocation has to happen
llvm-svn: 233641
2015-03-30 23:26:16 +00:00
Marshall Clow 21471e0906 While testing Erik's code coverage scripts, I found a hole in the test suite - vector::assign where a reallocation was not required had no tests. Add some
llvm-svn: 233557
2015-03-30 16:07:11 +00:00
Eric Fiselier da6c0fb630 [libcxx] Fix PR22771 - Support access control SFINAE in the library version of is_convertible.
Summary:
Currently the conversion check does not take place in a context where access control SFINAE is applied. This patch changes the context of the test expression so that SFINAE occurs if access control does not permit the conversion.

Related bug: https://llvm.org/bugs/show_bug.cgi?id=22771

Reviewers: mclow.lists, rsmith, dim

Reviewed By: dim

Subscribers: dim, rodrigc, emaste, cfe-commits

Differential Revision: http://reviews.llvm.org/D8461

llvm-svn: 233552
2015-03-30 15:22:20 +00:00
Eric Fiselier 2f135df8f9 Fix PR23041. Use lock_shared() as opposed to lock() in shared_lock test.
llvm-svn: 233367
2015-03-27 07:07:51 +00:00
Eric Fiselier 09b80854e8 Add tests for library version of is_convertible
llvm-svn: 233285
2015-03-26 16:45:21 +00:00
Ed Schouten f4ac884f2b Make the presence of stdin and stdout optional.
The idea behind Nuxi CloudABI is that it is targeted at (but not limited to)
running networked services in a sandboxed environment. The model behind stdin,
stdout and stderr is strongly focused on interactive tools in a command shell.
CloudABI does not support the notion of stdin and stdout, as 'standard
input/output' does not apply to services. The concept of stderr does makes
sense though, as services do need some mechanism to log error messages in a
uniform way.

This patch extends libc++ in such a way that std::cin and std::cout and the
associated <cstdio>/<cwchar> functions can be disabled through the flags
_LIBCPP_HAS_NO_STDIN and _LIBCPP_HAS_NO_STDOUT, respectively. At the same time
it attempts to clean up src/iostream.cpp a bit. Instead of using a single array
of mbstate_t objects and hardcoding the array indices, it creates separate
objects that declared next to the iostream objects and their buffers. The code
is also restructured by interleaving the construction and setup of c* and wc*
objects. That way it is more obvious that this is done identically.

The c* and wc* objects already have separate unit tests. Make use of this fact
by adding XFAILs in case libcpp-has-no-std* is set. That way the tests work in
both directions. If stdin or stdout is disabled, these tests will therefore
test for the absence of c* and wc*.

Differential Revision:	http://reviews.llvm.org/D8340

llvm-svn: 233275
2015-03-26 14:35:46 +00:00
Ed Schouten 407bd03e6d Don't let time_put test use implementation dependent constructs.
The time_put test doesn't seem to work on Linux and CloudABI. For Linux
we already have an XFAIL. Closer inspection seems to reveal that this
test does not pass for a couple of reasons.

First of all, the tm_yday field is set to an invalid value. The
strftime() function doesn't behave consistently across platforms in case
the values in the tm structure are incoherent. Fix up this field to have
the value 121, which corresponds with tm_mday, tm_mon and tm_year. This
of course affects the output of time_put for some modifiers, so update
the tests accordingly.

Second, some of the tests actually use modifiers that are only present
on BSD derived systems. They are not part of the C standard/POSIX.
Simply remove them.

Finally, some of the tests actually use invalid modifiers, causing a
malformed format string to be passed to strftime(). Remove these tests
as well.

Differential Revision:	http://reviews.llvm.org/D8349

llvm-svn: 233262
2015-03-26 08:38:00 +00:00
Marshall Clow 8fa8e5fc74 Add code to honor the match_not_bol and match_not_eol regex flats. Fixes PR#22651. Thanks to Jim Porter for the report and suggested fix.
llvm-svn: 232733
2015-03-19 17:05:59 +00:00
Eric Fiselier 6d370568c3 [libc++] Fix PR22922 - Allocator support for std::function does not know how to rebind.
Summary:
This patch changes std::function to use allocator_traits to rebind the allocator instead of allocator itself.

It also changes most of the tests to use `bare_allocator` where possible instead of `test_allocator`.

Reviewers: mclow.lists

Reviewed By: mclow.lists

Subscribers: cfe-commits

Differential Revision: http://reviews.llvm.org/D8391

llvm-svn: 232686
2015-03-18 22:56:50 +00:00
Eric Fiselier 5e1c9ae34f Fix DYNLD_LIBRARY_PATH to include the ABI path if specified
llvm-svn: 232527
2015-03-17 19:37:26 +00:00
Jonathan Roelofs f0d7c16d68 Fix failed test command repro printing for *.pass.cpp tests
Before we were printing out the compile command twice, which isn't that useful.

Thanks EricWF for the report!

llvm-svn: 232526
2015-03-17 19:32:24 +00:00
Eric Fiselier ea10d2477a [libcxx] Add <experimental/tuple> header for LFTS.
Summary:
This patch adds the `<experimental/tuple>` header (almost) as specified in the latest draft of the library fundamentals TS.

The main changes in this patch are:

1. Added variable template `tuple_size_v`
2. Added function `apply(Func &&, Tuple &&)`.
3. Changed `__invoke` to be `_LIBCPP_CONSTEXPR_AFTER_CXX11`.

The `apply(...)` implementation uses `__invoke` to invoke the given function. `__invoke` already provides the required functionality. Using `__invoke` also allows `apply` to be used on pointers to member function/objects as an extension. In order to facilitate this `__invoke` has to be marked `constexpr`. 



Test Plan:
Each new feature was tested. 

The test cases for `tuple_size_v` are as follows:
1. tuple_size_v.pass.cpp
  - Check `tuple_size_v` on cv qualified tuples, pairs and arrays.
2. tuple_size_v.fail.cpp
  - Test on reference type.
3. tuple_size_v_2.fail.cpp
  - Test on non-tuple
4. tuple_size_v_3.fail.cpp
  - Test on pointer type.

The test cases for tuple.apply are as follows:

1. arg_type.pass.cpp
   - Ensure that ref/pointer/cv qualified types are properly passed.
2. constexpr_types.pass.cpp
   - Ensure constexpr evaluation of apply is possible for `tuple` and `pair`.
3. extended_types.pass.cpp
   - Test apply on function types permitted by extension.
4. large_arity.pass.cpp
   - Test that apply can evaluated on tuples and arrays with large sizes.
5. ref_qualifiers.pass.cpp
   - Test that apply respects ref qualified functions.
6. return_type.pass.cpp
   - Test that apply returns the proper type.
7. types.pass.cpp
   - Test apply on function types as required by LFTS.

Reviewers: mclow.lists

Reviewed By: mclow.lists

Subscribers: cfe-commits

Differential Revision: http://reviews.llvm.org/D4512

llvm-svn: 232515
2015-03-17 18:28:14 +00:00
Eric Fiselier 57f00f2f9c [libcxx] Move tuple_size and tuple_element overloads for pair and array out of !defined(_LIBCPP_HAS_NO_VARIADICS) block.
Summary:
There is no reason to guard `tuple_size`, `tuple_element` and `get<I>(...)` for pair and array inside of `<__tuple>` so that they are only available when we have variadic templates.
This requires there be redundant declarations and definitions. It also makes it easy to get things wrong.

For example the following code should compile (and does in c++11).
```
#define _LIBCPP_HAS_NO_VARIADICS
#include <array>

int main()
{
  static_assert((std::tuple_size<std::array<int, 10> volatile>::value == 10), "");
}
```

This patch lifts the non-variadic parts of `tuple_size`, `tuple_types`, and `get<I>(...)` to the top of `<__tuple>` where they don't require variadic templates. This patch also removes `<__tuple_03>` because there is no longer a need for it.


Reviewers: danalbert, K-ballo, mclow.lists

Reviewed By: mclow.lists

Subscribers: cfe-commits

Differential Revision: http://reviews.llvm.org/D7774

llvm-svn: 232492
2015-03-17 15:08:03 +00:00
Ed Schouten 152b637682 Don't attempt to validate the output of %p.
In one of the ostream tests we attempt to validate whether the output of
%p is correct. This is actually outside the scope of libc++, for the
%reason that the format of %p is implementation defined. Change the test
%to validate that the output of %p is non-empty and is different when
%given two unequal addresses.

Differential Revision:	http://reviews.llvm.org/D8354
Reviewed by:	marshall

llvm-svn: 232390
2015-03-16 17:56:04 +00:00
Marshall Clow b7361983d1 Fix a problem when calling throw_with_nested with a class marked 'final'. Thanks to STL @ Microsoft for the bug report.
llvm-svn: 232384
2015-03-16 15:10:28 +00:00
Ed Schouten f424990d37 Don't hardcode the Czech locale name.
We already have a definition for the Czech locale name in
platform_support.h. Use this one instead.

While there, respect the common format of the tests. For most other
tests it's the case that test_iterators.h is placed right underneath the
other #includes (without an empty line). platform_support.h is included
after an empty line.

llvm-svn: 232383
2015-03-16 15:09:15 +00:00
Ed Schouten bd250daee0 Don't hardcode the locale name string.
The rest of the test uses the #defines for the locale names properly. In
this single spot we do hardcode the string. This causes this test to
fail on CloudABI, where this locale is called en_US.UTF-8@UTC.

llvm-svn: 232365
2015-03-16 09:44:37 +00:00
Ed Schouten 69722ab7c1 Remove unneeded initialisation of fenv_t and fexcept_t.
Though common, there is no requirement that fenv_t and fexcept_t are
structure and integer types, respectively. fexcept_t is a structure on
CloudABI.

llvm-svn: 232329
2015-03-15 18:36:31 +00:00
Ed Schouten 97fdea618e Add option to disable access to the global filesystem namespace.
Systems like FreeBSD's Capsicum and Nuxi CloudABI apply the concept of
capability-based security on the way processes can interact with the
filesystem API. It is no longer possible to interact with the VFS
through calls like open(), unlink(), rename(), etc. Instead, processes
are only allowed to interact with files and directories to which they
have been granted access. The *at() functions can be used for this
purpose.

This change adds a new config switch called
_LIBCPP_HAS_NO_GLOBAL_FILESYSTEM_NAMESPACE. If set, all functionality
that requires the global filesystem namespace will be disabled. More
concretely:

- fstream's open() function will be removed.
- cstdio will no longer pull in fopen(), rename(), etc.
- The test suite's get_temp_file_name() will be removed. This will cause
  all tests that use the global filesystem namespace to break, but will
  at least make all the other tests run (as get_temp_file_name will not
  build anyway).

It is important to mention that this change will make fstream rather
useless on those systems for now. Still, I'd rather not have fstream
disabled entirely, as it is of course possible to come up with an
extension for fstream that would allow access to local filesystem
namespaces (e.g., by adding an openat() member function).

Differential revision:	http://reviews.llvm.org/D8194
Reviewed by:		jroelofs (thanks!)

llvm-svn: 232049
2015-03-12 15:44:39 +00:00
Jonathan Roelofs 29f342c6b5 Fix ctype_byname<wchar_t>::do_is() mask checking.... again
This basically reverts the revert in r216508, and fixes a few more cases while
I'm at it. Reading my commit message on that commit again, I think it's bupkis.

http://reviews.llvm.org/D8237

llvm-svn: 231940
2015-03-11 17:00:28 +00:00
Dan Albert 6846b2661d Copy data files to the remote runner.
Summary:
The data files for any given test will be in the same directory as the
source with a file name that matches *.dat. To make these available to
tests running remotely (such as over adb or ssh), copy them into the
test's remote working directory.

Note that we will perform more copies than we actually need. The data
files in the directory may only be used by one of the tests, but will
be copied for all tests in the same directory.

This patch also moves the remote test binary into the working
directory (previously it was only invoked from the working directory
rather than existing in it).

Reviewers: EricWF, jroelofs

Reviewed By: jroelofs

Subscribers: cfe-commits

Differential Revision: http://reviews.llvm.org/D8118

llvm-svn: 231864
2015-03-10 22:31:49 +00:00
Eric Fiselier 4b7533a1dd Use generic feature name for sanitizers that replace new and delete
llvm-svn: 231841
2015-03-10 20:46:04 +00:00
Dan Albert ec571f2060 Factor out RemoteExecutor from SSHExecutor.
Summary:
A lot of the pieces of SSHExecutor can be shared with my AdbExecutor
(https://android-review.googlesource.com/#/c/138807/).

Reviewers: EricWF, jroelofs

Reviewed By: jroelofs

Subscribers: cfe-commits

Differential Revision: http://reviews.llvm.org/D8117

llvm-svn: 231815
2015-03-10 18:43:16 +00:00
Ed Schouten 17f5dbef9b Add support for arc4random() to random_device.
Nuxi CloudABI (https://github.com/NuxiNL/cloudlibc) does not allow
processes to access the global filesystem namespace. This breaks
random_device, as it attempts to use /dev/{u,}random. This change adds
support for arc4random(), which is present on CloudABI.

In my opinion it would also make sense to use arc4random() on other
operating systems, such as *BSD and Mac OS X, but I'd rather leave that
to the maintainers of the respective platforms. Switching to
arc4random() does change the ABI.

This change also attempts to make some cleanups to the code. It adds a
single #define for every random interface, instead of testing against
operating systems explicitly.

As discussed, also validate the token argument to be equal to
"/dev/urandom" on all systems that only provide pseudo-random numbers.
This should cause little to no breakage, as "/dev/urandom" is also the
default argument value.

Reviewed by: jfb
Differential Revision: http://reviews.llvm.org/D8134

llvm-svn: 231764
2015-03-10 07:46:06 +00:00
Eric Fiselier 21d7ffa233 [libcxx] Fix __RAII_IncreaseAnnotator for increases >= 1
Summary: Fix suggested by @mclow.lists on D8109. Store the size of the un-poisoned vector upon construction instead of calculating it later.

Reviewers: titus, mclow.lists, kcc, EricWF

Reviewed By: EricWF

Subscribers: mclow.lists, cfe-commits

Differential Revision: http://reviews.llvm.org/D8172

llvm-svn: 231729
2015-03-10 00:25:20 +00:00
Eric Fiselier 764d030840 Move test to use correct suffix
llvm-svn: 231704
2015-03-09 21:30:48 +00:00
Eric Fiselier 66e41b66ad Add TrackedValue to test/support. Thanks to Louis Dionne
llvm-svn: 231674
2015-03-09 18:02:16 +00:00
Marshall Clow f4903afd93 Fix an exception-safety bug in <deque>. Reference: PR#22650. Not closing the bug because there's more work to do here
llvm-svn: 231672
2015-03-09 17:08:51 +00:00
Ed Schouten 1d2c052e9f Add CloudABI locale names to platform_support.h.
On CloudABI we should append the timezone name to the end of the locale
(e.g., nl_NL.UTF-8@Europe/Amsterdam). By fixing the locale names we can
already let a lot of locale related tests pass.

llvm-svn: 231649
2015-03-09 12:04:16 +00:00
Dan Albert eafe55200c Oops. This arg is passed, just ignored.
We should probably be using this argument to find the data files for
the tests, but that isn't implemented yet.

llvm-svn: 231498
2015-03-06 18:51:25 +00:00
Dan Albert ebfe1fe059 Fix the PrefixExecutor.
The PrefixExecutor wasn't passing the exe_path down the chain, so the
command was overriding that, the work_dir was being passed as the
command, and so on.

I've cleaned up a few pylint issues while I was here.

llvm-svn: 231496
2015-03-06 18:35:45 +00:00
Eric Fiselier e105ea84a2 Remove unneeded python import
llvm-svn: 231453
2015-03-06 06:22:22 +00:00
Eric Fiselier 26aaa6872d Run ShTests when the executor is an instance of LocalExecutor
llvm-svn: 231404
2015-03-05 20:27:01 +00:00
Marshall Clow b844b1a0ff Move the <dynarray> tests out of the std/ hierarchy, since it's not really part of the standard any more.
llvm-svn: 231311
2015-03-04 23:09:15 +00:00
Eric Fiselier b3be398c67 Allow declaration of map and multimap iterator with incomplete mapped type. Patch from eugenis
llvm-svn: 231119
2015-03-03 20:10:01 +00:00
Marshall Clow af670e4b37 Add better tests for ctype<char>::classic_table
llvm-svn: 231077
2015-03-03 16:15:26 +00:00
Eric Fiselier 0357171f1c [libcxx] Add support for linking libc++ against a static ABI library.
Summary:
This patch add the CMake option `LIBCXX_ENABLE_STATIC_ABI_LIBRARY` which, when enabled, will link libc++ against the static version of the ABI library.


Reviewers: mclow.lists, jroelofs, danalbert

Reviewed By: danalbert

Subscribers: compnerd, cfe-commits

Differential Revision: http://reviews.llvm.org/D8017

llvm-svn: 231076
2015-03-03 15:59:51 +00:00
Jonathan Roelofs 49ff203ec4 Add remote testing support to the lit config.
Executors can be specified at configure time by using the -DLIBCXX_EXECUTOR=""
option. Examples include:

  $ cmake <other_flags> -DLIBCXX_EXECUTOR="TimeoutExecutor(30,LocalExecutor())"
      This runs individual tests with a maximum duration

  $ cmake <other_flags> -DLIBCXX_EXECUTOR="SSHExecutor('hostname','username')"
      This runs tests on a remote target, using scp to shuttle binaries to the
      target, and ssh to invoke commands there.

  $ cmake <other_flags> -DLIBCXX_EXECUTOR="PrefixExecutor('/path/to/run/script',LocalExecutor())"
      This assumes the script knows how to copy run the executables passed to it,
      and allows for the ultimate control. This is useful for running things
      inside emulators like Valgrind & QEMU.

TODO: This doesn't claim to support ShTest tests yet, that will take a bit more
  thought & finagling (I'm still not sure how to orchestrate copy-in for those cases.

  I've also punted on what to do about tests that read data files. The testsuite
  has several tests that need to read *.dat files placed next to them, and
  currently those aren't copied over when using, say, an SSHExecutor. The
  affected tests are:

     libc++ :: std/input.output/file.streams/fstreams/filebuf.virtuals/pbackfail.pass.cpp
     libc++ :: std/input.output/file.streams/fstreams/filebuf.virtuals/underflow.pass.cpp
     libc++ :: std/input.output/file.streams/fstreams/ifstream.assign/member_swap.pass.cpp
     libc++ :: std/input.output/file.streams/fstreams/ifstream.assign/move_assign.pass.cpp
     libc++ :: std/input.output/file.streams/fstreams/ifstream.assign/nonmember_swap.pass.cpp
     libc++ :: std/input.output/file.streams/fstreams/ifstream.cons/move.pass.cpp
     libc++ :: std/input.output/file.streams/fstreams/ifstream.cons/pointer.pass.cpp
     libc++ :: std/input.output/file.streams/fstreams/ifstream.cons/string.pass.cpp
     libc++ :: std/input.output/file.streams/fstreams/ifstream.members/close.pass.cpp
     libc++ :: std/input.output/file.streams/fstreams/ifstream.members/open_pointer.pass.cpp
     libc++ :: std/input.output/file.streams/fstreams/ifstream.members/open_string.pass.cpp
     libc++ :: std/input.output/file.streams/fstreams/ifstream.members/rdbuf.pass.cpp
     libc++ :: std/localization/locales/locale.convenience/conversions/conversions.buffer/pbackfail.pass.cpp
     libc++ :: std/localization/locales/locale.convenience/conversions/conversions.buffer/underflow.pass.cpp

Note: One thing to watch out for when using the SSHExecutor for cross-testing is
  that you'll also want to specify a TargetInfo object (so that the host's
  features aren't used for available-features checks and flags setup).

http://reviews.llvm.org/D7380

llvm-svn: 230592
2015-02-26 00:42:17 +00:00