Commit Graph

1072 Commits

Author SHA1 Message Date
Eric Fiselier
938c96ef53 [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

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@242858 91177308-0d34-0410-b5e6-96231b3b80d8
2015-07-22 00:33:36 +00:00
Marshall Clow
f544330f34 Mark new tests as unsupported before C++11
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@242695 91177308-0d34-0410-b5e6-96231b3b80d8
2015-07-20 19:27:47 +00:00
Marshall Clow
bbe4245e63 Implement the default searcher for std::experimental::search.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@242682 91177308-0d34-0410-b5e6-96231b3b80d8
2015-07-20 16:39:28 +00:00
Marshall Clow
166dadbcbe Implement the plugin-based version of std::search. There are no searchers yet; those are coming soon.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@242679 91177308-0d34-0410-b5e6-96231b3b80d8
2015-07-20 15:40:27 +00:00
Eric Fiselier
fd9bbf52cd Fix warnings in unordered_map
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@242634 91177308-0d34-0410-b5e6-96231b3b80d8
2015-07-19 03:16:47 +00:00
Eric Fiselier
6af41ab8c2 Fix warnings in forwardlist
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@242633 91177308-0d34-0410-b5e6-96231b3b80d8
2015-07-19 00:38:37 +00:00
Eric Fiselier
18dbed9596 Fix warnings in deque tests
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@242632 91177308-0d34-0410-b5e6-96231b3b80d8
2015-07-19 00:31:54 +00:00
Eric Fiselier
b0be44f963 Commit file missing from r242629
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@242630 91177308-0d34-0410-b5e6-96231b3b80d8
2015-07-19 00:11:50 +00:00
Eric Fiselier
02bb4bdb49 Fix warnings in array and assoc containers
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@242629 91177308-0d34-0410-b5e6-96231b3b80d8
2015-07-18 23:56:04 +00:00
Eric Fiselier
212714f805 Cleanup warnings in test/std/depr
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@242627 91177308-0d34-0410-b5e6-96231b3b80d8
2015-07-18 22:51:51 +00:00
Eric Fiselier
3a07a2f4f3 Fix warnings in test/std/algorithms
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@242626 91177308-0d34-0410-b5e6-96231b3b80d8
2015-07-18 21:53:16 +00:00
Eric Fiselier
462410703d Fix unused variable warnings in atomic tests
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@242625 91177308-0d34-0410-b5e6-96231b3b80d8
2015-07-18 21:40:37 +00:00
Eric Fiselier
7b86ce5cc4 Fix warnings in test/std/language.support
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@242624 91177308-0d34-0410-b5e6-96231b3b80d8
2015-07-18 21:17:16 +00:00
Marshall Clow
0f7221ccb8 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.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@242618 91177308-0d34-0410-b5e6-96231b3b80d8
2015-07-18 18:24:15 +00:00
Eric Fiselier
7d439a455d Add missing instrumentation in vector::insert - Patch from Anna Zaks
This patch was reviewed as D10859. http://reviews.llvm.org/D10859


git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@242617 91177308-0d34-0410-b5e6-96231b3b80d8
2015-07-18 18:22:12 +00:00
Eric Fiselier
12c6d9cd93 [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

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@242612 91177308-0d34-0410-b5e6-96231b3b80d8
2015-07-18 16:43:58 +00:00
Eric Fiselier
3f339e65df Cleanup tests that fail in C++1z and with Clang 3.8
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@242581 91177308-0d34-0410-b5e6-96231b3b80d8
2015-07-17 22:27:43 +00:00
Marshall Clow
2af7d42fe3 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
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@242454 91177308-0d34-0410-b5e6-96231b3b80d8
2015-07-16 22:13:26 +00:00
Marshall Clow
cd6ed54fed Make sure that __libcpp_compressed_pair_imp default-constructs its' members, rather than value-initializing them. Fixes PR#24137
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@242377 91177308-0d34-0410-b5e6-96231b3b80d8
2015-07-16 03:05:06 +00:00
Marshall Clow
73f131f210 Mark two tests as failing on clang 3.8 (they failed on 3.7, too)
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@242375 91177308-0d34-0410-b5e6-96231b3b80d8
2015-07-16 02:44:33 +00:00
Eric Fiselier
83de1012a9 Remove non-ascii characters
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@242197 91177308-0d34-0410-b5e6-96231b3b80d8
2015-07-14 20:45:48 +00:00
Eric Fiselier
22dff5382a Implement n4169 - Add invoke function template
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@242195 91177308-0d34-0410-b5e6-96231b3b80d8
2015-07-14 20:16:15 +00:00
Eric Fiselier
26edd804ba Fix PR24114 - std::atomic for non-Clang is not a literal type
Add _LIBCPP_CONSTEXPR to the implementation of __gcc_atomic_t.


git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@242172 91177308-0d34-0410-b5e6-96231b3b80d8
2015-07-14 17:50:27 +00:00
Marshall Clow
119ed47999 Move bits from N4258. Mark vector's move-constructor unconditionally noexcept in C++1z
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@242148 91177308-0d34-0410-b5e6-96231b3b80d8
2015-07-14 14:46:32 +00:00
Marshall Clow
7d914d1bff 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.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@242056 91177308-0d34-0410-b5e6-96231b3b80d8
2015-07-13 20:04:56 +00:00
Eric Fiselier
f301a117e1 [libcxx] LWG2420 bits for bind<void> - Patch from K-Ballo
Implemented LWG2420 bits for bind<void>

Review: http://reviews.llvm.org/D10997


git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@241967 91177308-0d34-0410-b5e6-96231b3b80d8
2015-07-10 23:29:18 +00:00
Eric Fiselier
4f55ef701a Fix error string in test suite
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@241757 91177308-0d34-0410-b5e6-96231b3b80d8
2015-07-08 23:10:20 +00:00
Marshall Clow
0ce05a9f86 The rest of N4279 and LWG#2464 - for unordered_map
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@241555 91177308-0d34-0410-b5e6-96231b3b80d8
2015-07-07 05:45:35 +00:00
Marshall Clow
f3a1a187a1 Implement N4279 and LWG#2664 for <map>. Reviewed as http://reviews.llvm.org/D10669
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@241539 91177308-0d34-0410-b5e6-96231b3b80d8
2015-07-07 03:37:33 +00:00
Eric Fiselier
c6e466911f [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

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@241532 91177308-0d34-0410-b5e6-96231b3b80d8
2015-07-07 00:27:16 +00:00
Eric Fiselier
faaf5ee349 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.


git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@241492 91177308-0d34-0410-b5e6-96231b3b80d8
2015-07-06 19:56:45 +00:00
Marshall Clow
b81d6f5b8d Noticed that std::allocator<const T> was missing the definition for is_always_equal. Fixed this, and added a test for it.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@241190 91177308-0d34-0410-b5e6-96231b3b80d8
2015-07-01 21:23:40 +00:00
Marshall Clow
933bf68f0a Forgot the support include file in r241091
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@241092 91177308-0d34-0410-b5e6-96231b3b80d8
2015-06-30 18:16:12 +00:00
Marshall Clow
58113db00c 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>
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@241091 91177308-0d34-0410-b5e6-96231b3b80d8
2015-06-30 18:15:41 +00:00
Marshall Clow
07546f3b93 Implement LWG#2407: 'packaged_task(allocator_arg_t, const Allocator&, F&&) should neither be constrained nor explicit'
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@241068 91177308-0d34-0410-b5e6-96231b3b80d8
2015-06-30 14:16:49 +00:00
Marshall Clow
abadb458d0 Implement N4508: shared_mutex. Reviewed as http://reviews.llvm.org/D10480
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@241067 91177308-0d34-0410-b5e6-96231b3b80d8
2015-06-30 14:04:14 +00:00
Ed Schouten
323ade3e70 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


git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@240527 91177308-0d34-0410-b5e6-96231b3b80d8
2015-06-24 08:44:38 +00:00
Marshall Clow
1224e8972b Make seeking on an ostream that has eofbit set work correctly. Fixes PR#21361
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@240286 91177308-0d34-0410-b5e6-96231b3b80d8
2015-06-22 15:01:21 +00:00
Marshall Clow
c41133728d Fix PR#18843. Thanks to Howard for the fix
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@240136 91177308-0d34-0410-b5e6-96231b3b80d8
2015-06-19 15:54:13 +00:00
Eric Fiselier
b05f0599c0 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.


git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@239708 91177308-0d34-0410-b5e6-96231b3b80d8
2015-06-14 23:30:09 +00:00
Eric Fiselier
4983580dc5 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.


git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@239668 91177308-0d34-0410-b5e6-96231b3b80d8
2015-06-13 08:25:24 +00:00
Eric Fiselier
fdae69aa13 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

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@239666 91177308-0d34-0410-b5e6-96231b3b80d8
2015-06-13 07:18:32 +00:00
Eric Fiselier
bc1e44d14e 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


git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@239654 91177308-0d34-0410-b5e6-96231b3b80d8
2015-06-13 02:23:00 +00:00
Eric Fiselier
724b5ab350 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.


git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@239649 91177308-0d34-0410-b5e6-96231b3b80d8
2015-06-13 00:33:13 +00:00
Eric Fiselier
56a599b976 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.


git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@239577 91177308-0d34-0410-b5e6-96231b3b80d8
2015-06-12 00:41:34 +00:00
Marshall Clow
f54ca46a7b Change #ifdefs in test to UNSUPPORTED. No functionality change in the tests
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@239562 91177308-0d34-0410-b5e6-96231b3b80d8
2015-06-11 21:47:39 +00:00
Marshall Clow
4356f6392e Fix PR#23767. Add tests for iterator invalidation for deque::erase/pop_front/pop_back
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@239196 91177308-0d34-0410-b5e6-96231b3b80d8
2015-06-05 22:34:19 +00:00
Marshall Clow
c912c0ce7c While applying N4258, I forgot about LWG#2455, which modified the modifications. Correct those - h/t: Howard
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@239004 91177308-0d34-0410-b5e6-96231b3b80d8
2015-06-04 02:05:41 +00:00
Marshall Clow
127db91f3e More N4258 changes. This time vector's constructors
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@238990 91177308-0d34-0410-b5e6-96231b3b80d8
2015-06-04 00:10:20 +00:00
Marshall Clow
7b193f7797 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.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@238957 91177308-0d34-0410-b5e6-96231b3b80d8
2015-06-03 19:56:43 +00:00
Marshall Clow
bbf87b1c34 Add 'is_always_equal' tests for scoped_allocator. Found that I had typed '||' where I meant '&&' in the code; fixed that, too
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@238931 91177308-0d34-0410-b5e6-96231b3b80d8
2015-06-03 16:15:55 +00:00
Marshall Clow
f0324bcaa1 Implement the first part of N4258 - allocator_traits<X>::is_always_equal. Also fixes PR#23723
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@238848 91177308-0d34-0410-b5e6-96231b3b80d8
2015-06-02 16:34:03 +00:00
Marshall Clow
8731c5da46 Implement uncaught_exceptions() using the newly added hooks in libc++abi, when available
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@238846 91177308-0d34-0410-b5e6-96231b3b80d8
2015-06-02 15:33:38 +00:00
Eric Fiselier
c4324b2b94 Add TODO items and remove use of 'noexcept' in C++03 test.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@238802 91177308-0d34-0410-b5e6-96231b3b80d8
2015-06-02 01:25:34 +00:00
Marshall Clow
60784f62de Fix PR#23647 - make_shared<volatile bool> - second try
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@238370 91177308-0d34-0410-b5e6-96231b3b80d8
2015-05-27 22:44:47 +00:00
Marshall Clow
fc3a3ffc69 Revert 238354 while I figure out what broke in weak_ptr
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@238355 91177308-0d34-0410-b5e6-96231b3b80d8
2015-05-27 20:36:14 +00:00
Marshall Clow
83f8153b22 Fix PR#23647 - make_shared<volatile bool>
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@238354 91177308-0d34-0410-b5e6-96231b3b80d8
2015-05-27 20:15:33 +00:00
Eric Fiselier
970d9f7768 Get thread sleep_for test passing in C++03
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@238273 91177308-0d34-0410-b5e6-96231b3b80d8
2015-05-27 01:09:51 +00:00
Eric Fiselier
2cd0a2e4e7 Mark __convert_to_integral test as XFAIL in c++03
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@238271 91177308-0d34-0410-b5e6-96231b3b80d8
2015-05-27 01:02:51 +00:00
Eric Fiselier
ee6bfb2117 Cleanup move/forward tests and remove references to __rv.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@238270 91177308-0d34-0410-b5e6-96231b3b80d8
2015-05-27 00:51:08 +00:00
Eric Fiselier
8f1d85fde5 Add test macros header to remove dependance on __config macros.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@238267 91177308-0d34-0410-b5e6-96231b3b80d8
2015-05-27 00:28:30 +00:00
Marshall Clow
7242d18811 Fix broken test I just added
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@238234 91177308-0d34-0410-b5e6-96231b3b80d8
2015-05-26 19:17:09 +00:00
Marshall Clow
b5b66923e3 Add tests to ensure that string/vector/array have contiguous iterators - which they did. Mark N4284 as complete
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@238233 91177308-0d34-0410-b5e6-96231b3b80d8
2015-05-26 18:57:27 +00:00
Eric Fiselier
1a7ccb14e8 Fix race condition in thread test.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@237745 91177308-0d34-0410-b5e6-96231b3b80d8
2015-05-19 23:41:04 +00:00
Eric Fiselier
5d663441e7 Address @danalberts comments on r237700
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@237740 91177308-0d34-0410-b5e6-96231b3b80d8
2015-05-19 23:10:32 +00:00
Eric Fiselier
d539803d4b Fix uninitialized values and bad enum conversions found by UBSAN.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@237738 91177308-0d34-0410-b5e6-96231b3b80d8
2015-05-19 23:03:57 +00:00
Eric Fiselier
a985b8cc79 Add compiler flag test support to LIT. Fix new/delete tests on apple-clang.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@237700 91177308-0d34-0410-b5e6-96231b3b80d8
2015-05-19 15:15:53 +00:00
Marshall Clow
5dce73dd6e Implement LWG2433: uninitialized_copy()/etc. should tolerate overloaded operator&
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@237699 91177308-0d34-0410-b5e6-96231b3b80d8
2015-05-19 15:01:48 +00:00
Eric Fiselier
02be74588a mark new/delete tests as XFAIL more carefully
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@237664 91177308-0d34-0410-b5e6-96231b3b80d8
2015-05-19 03:41:22 +00:00
Eric Fiselier
f4c97290fc [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

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@237662 91177308-0d34-0410-b5e6-96231b3b80d8
2015-05-19 02:03:22 +00:00
Marshall Clow
e62560a9b6 Add support for N4389 - std::bool_constant
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@237636 91177308-0d34-0410-b5e6-96231b3b80d8
2015-05-18 23:21:06 +00:00
Marshall Clow
c42668278d Fix for LWG Issue 2458: N3778 and new library deallocation signatures.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@237592 91177308-0d34-0410-b5e6-96231b3b80d8
2015-05-18 17:48:45 +00:00
Logan Chien
21f5b24e2d 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.


git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@237530 91177308-0d34-0410-b5e6-96231b3b80d8
2015-05-17 00:24:11 +00:00
Marshall Clow
b6d12a2b3a Fix test that was failing on C++03 b/c it was using initializer lists
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@237527 91177308-0d34-0410-b5e6-96231b3b80d8
2015-05-16 17:10:49 +00:00
Logan Chien
4f8edc478b 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().



git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@237519 91177308-0d34-0410-b5e6-96231b3b80d8
2015-05-16 13:10:39 +00:00
Logan Chien
5e5e11d90d 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.


git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@237518 91177308-0d34-0410-b5e6-96231b3b80d8
2015-05-16 12:44:31 +00:00
Evgeniy Stepanov
56a8c6438a 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



git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@237264 91177308-0d34-0410-b5e6-96231b3b80d8
2015-05-13 16:55:41 +00:00
Marshall Clow
0ad232a882 Fix for LWG Issue 2415: Inconsistency between unique_ptr and shared_ptr
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@236953 91177308-0d34-0410-b5e6-96231b3b80d8
2015-05-10 13:59:45 +00:00
Marshall Clow
928735abf1 Fix for LWG Issue 2369: constexpr max(initializer_list) vs max_element
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@236952 91177308-0d34-0410-b5e6-96231b3b80d8
2015-05-10 13:53:31 +00:00
Marshall Clow
488025c316 Fix for LWG Issue 2059: C++0x ambiguity problem with map::erase
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@236950 91177308-0d34-0410-b5e6-96231b3b80d8
2015-05-10 13:35:00 +00:00
Marshall Clow
3607f8640d Remove some debugging printout lines. No functionality change.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@236949 91177308-0d34-0410-b5e6-96231b3b80d8
2015-05-10 13:26:57 +00:00
Marshall Clow
dbaf7a0d31 Fix for LWG2454: Add raw_storage_iterator::base() member
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@236948 91177308-0d34-0410-b5e6-96231b3b80d8
2015-05-10 13:14:08 +00:00
Marshall Clow
46a7ec9a3d Fix some preprocessor directives that were generating warnings in the test suite.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@235999 91177308-0d34-0410-b5e6-96231b3b80d8
2015-04-28 16:52:30 +00:00
Eric Fiselier
c254b36c29 Remove constexpr support for std::apply because it introduces regressions.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@235274 91177308-0d34-0410-b5e6-96231b3b80d8
2015-04-19 15:32:52 +00:00
Marshall Clow
e9d030687d A few bits of N2994 didn't get fully implemented a long time ago. Thanks to STL@microsoft.com for the bug report
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@235134 91177308-0d34-0410-b5e6-96231b3b80d8
2015-04-16 21:36:54 +00:00
Marshall Clow
3a4964aef3 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.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@234886 91177308-0d34-0410-b5e6-96231b3b80d8
2015-04-14 13:53:53 +00:00
Eric Fiselier
6be02cb83f 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.


git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@233946 91177308-0d34-0410-b5e6-96231b3b80d8
2015-04-02 21:12:17 +00:00
Eric Fiselier
1d55ecf513 [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

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@233944 91177308-0d34-0410-b5e6-96231b3b80d8
2015-04-02 21:02:06 +00:00
Eric Fiselier
2cea80b137 Remove statement with no effect inside tests.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@233816 91177308-0d34-0410-b5e6-96231b3b80d8
2015-04-01 15:49:02 +00:00
Eric Fiselier
bf9653d85f [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

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@233669 91177308-0d34-0410-b5e6-96231b3b80d8
2015-03-31 04:15:45 +00:00
Eric Fiselier
f68d637860 Allow enabling CCache through an env variable. This helps enable/disable the option on buildbots.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@233659 91177308-0d34-0410-b5e6-96231b3b80d8
2015-03-31 01:41:32 +00:00
Marshall Clow
3accbf03e2 Make the new tests better; make sure that we're testing the case where no reallocation has to happen
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@233641 91177308-0d34-0410-b5e6-96231b3b80d8
2015-03-30 23:26:16 +00:00
Marshall Clow
86319f01df 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
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@233557 91177308-0d34-0410-b5e6-96231b3b80d8
2015-03-30 16:07:11 +00:00
Eric Fiselier
4bd15469a9 [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

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@233552 91177308-0d34-0410-b5e6-96231b3b80d8
2015-03-30 15:22:20 +00:00
Eric Fiselier
91220d1043 Fix PR23041. Use lock_shared() as opposed to lock() in shared_lock test.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@233367 91177308-0d34-0410-b5e6-96231b3b80d8
2015-03-27 07:07:51 +00:00
Eric Fiselier
fd4de45e66 Add tests for library version of is_convertible
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@233285 91177308-0d34-0410-b5e6-96231b3b80d8
2015-03-26 16:45:21 +00:00
Ed Schouten
abd06b4c9b 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


git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@233275 91177308-0d34-0410-b5e6-96231b3b80d8
2015-03-26 14:35:46 +00:00
Ed Schouten
3f86893b6c 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


git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@233262 91177308-0d34-0410-b5e6-96231b3b80d8
2015-03-26 08:38:00 +00:00
Marshall Clow
64befb5bc5 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.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@232733 91177308-0d34-0410-b5e6-96231b3b80d8
2015-03-19 17:05:59 +00:00
Eric Fiselier
71aa376ede [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

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@232686 91177308-0d34-0410-b5e6-96231b3b80d8
2015-03-18 22:56:50 +00:00