summaryrefslogtreecommitdiffstats
path: root/libcxx/test
Commit message (Collapse)AuthorAgeFilesLines
* Implement N4508: shared_mutex. Reviewed as http://reviews.llvm.org/D10480Marshall Clow2015-06-308-0/+327
| | | | llvm-svn: 241067
* Make support for thread-unsafe C functions optional.Ed Schouten2015-06-2413-3/+104
| | | | | | | | | | | | | | | | | | | | | | | | 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
* Make seeking on an ostream that has eofbit set work correctly. Fixes PR#21361Marshall Clow2015-06-222-0/+22
| | | | llvm-svn: 240286
* Fix PR#18843. Thanks to Howard for the fixMarshall Clow2015-06-191-0/+4
| | | | llvm-svn: 240136
* Fix std::function allocator constructors in C++03.Eric Fiselier2015-06-144-125/+212
| | | | | | | | | 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
* Cleanup result_of tests and fix issues with the C++03 result_of.Eric Fiselier2015-06-132-61/+306
| | | | | | | | | | 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
* Fix PR12999 - unordered_set::insert calls operator new when no insert occursEric Fiselier2015-06-131-0/+48
| | | | | | | | | | | | | | | | | | | | | | | 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
* LWG2442: call_once() shouldn't DECAY_COPY(). Patch from K-Ballo.Eric Fiselier2015-06-131-1/+47
| | | | | | | 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
* Refactor is_member_function_pointer to use is_function and not ↵Eric Fiselier2015-06-131-13/+47
| | | | | | | | | | __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
* Fix PR23293 - Do not unlock shared state before notifying consumers.Eric Fiselier2015-06-121-0/+67
| | | | | | | | 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
* Change #ifdefs in test to UNSUPPORTED. No functionality change in the testsMarshall Clow2015-06-119-48/+10
| | | | llvm-svn: 239562
* Fix PR#23767. Add tests for iterator invalidation for ↵Marshall Clow2015-06-054-0/+246
| | | | | | deque::erase/pop_front/pop_back llvm-svn: 239196
* While applying N4258, I forgot about LWG#2455, which modified the ↵Marshall Clow2015-06-044-25/+1
| | | | | | modifications. Correct those - h/t: Howard llvm-svn: 239004
* More N4258 changes. This time vector's constructorsMarshall Clow2015-06-044-5/+48
| | | | llvm-svn: 238990
* More of N4258 implementation. Mark all of our test_allocators as noexcept ↵Marshall Clow2015-06-037-27/+86
| | | | | | 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
* Add 'is_always_equal' tests for scoped_allocator. Found that I had typed ↵Marshall Clow2015-06-031-0/+75
| | | | | | '||' where I meant '&&' in the code; fixed that, too llvm-svn: 238931
* Implement the first part of N4258 - allocator_traits<X>::is_always_equal. ↵Marshall Clow2015-06-021-0/+48
| | | | | | Also fixes PR#23723 llvm-svn: 238848
* Implement uncaught_exceptions() using the newly added hooks in libc++abi, ↵Marshall Clow2015-06-021-0/+45
| | | | | | when available llvm-svn: 238846
* Add TODO items and remove use of 'noexcept' in C++03 test.Eric Fiselier2015-06-021-1/+1
| | | | llvm-svn: 238802
* Fix PR#23647 - make_shared<volatile bool> - second tryMarshall Clow2015-05-271-3/+3
| | | | llvm-svn: 238370
* Revert 238354 while I figure out what broke in weak_ptrMarshall Clow2015-05-271-3/+3
| | | | llvm-svn: 238355
* Fix PR#23647 - make_shared<volatile bool>Marshall Clow2015-05-271-0/+61
| | | | llvm-svn: 238354
* Get thread sleep_for test passing in C++03Eric Fiselier2015-05-271-2/+5
| | | | llvm-svn: 238273
* Mark __convert_to_integral test as XFAIL in c++03Eric Fiselier2015-05-271-0/+3
| | | | llvm-svn: 238271
* Cleanup move/forward tests and remove references to __rv.Eric Fiselier2015-05-273-30/+15
| | | | llvm-svn: 238270
* Add test macros header to remove dependance on __config macros.Eric Fiselier2015-05-272-0/+141
| | | | llvm-svn: 238267
* Fix broken test I just addedMarshall Clow2015-05-261-3/+3
| | | | llvm-svn: 238234
* Add tests to ensure that string/vector/array have contiguous iterators - ↵Marshall Clow2015-05-263-0/+124
| | | | | | which they did. Mark N4284 as complete llvm-svn: 238233
* Fix race condition in thread test.Eric Fiselier2015-05-191-8/+25
| | | | llvm-svn: 237745
* Address @danalberts comments on r237700Eric Fiselier2015-05-193-3/+3
| | | | llvm-svn: 237740
* Fix uninitialized values and bad enum conversions found by UBSAN.Eric Fiselier2015-05-194-17/+17
| | | | llvm-svn: 237738
* Add compiler flag test support to LIT. Fix new/delete tests on apple-clang.Eric Fiselier2015-05-194-11/+28
| | | | llvm-svn: 237700
* Implement LWG2433: uninitialized_copy()/etc. should tolerate overloaded ↵Marshall Clow2015-05-194-0/+94
| | | | | | operator& llvm-svn: 237699
* mark new/delete tests as XFAIL more carefullyEric Fiselier2015-05-194-10/+20
| | | | llvm-svn: 237664
* [libcxx] Rework sized delete.Eric Fiselier2015-05-1914-516/+505
| | | | | | | | | | | | | | | | | | | | | | | | | | 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
* Add support for N4389 - std::bool_constantMarshall Clow2015-05-181-0/+32
| | | | llvm-svn: 237636
* Fix for LWG Issue 2458: N3778 and new library deallocation signatures.Marshall Clow2015-05-182-218/+0
| | | | llvm-svn: 237592
* libcxx: Enhance lit test command in verbose mode.Logan Chien2015-05-171-5/+8
| | | | | | | 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
* Fix test that was failing on C++03 b/c it was using initializer listsMarshall Clow2015-05-161-2/+2
| | | | llvm-svn: 237527
* Fix build when libunwind is disabled.Logan Chien2015-05-161-0/+1
| | | | | | | | | | 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
* libcxx: Fix ARM libc++/abi and libunwind buildbot.Logan Chien2015-05-161-0/+1
| | | | | | | | | | | | | 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
* Implement std::experimental::sample.Evgeniy Stepanov2015-05-136-0/+276
| | | | | | | 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
* Fix for LWG Issue 2415: Inconsistency between unique_ptr and shared_ptrMarshall Clow2015-05-102-2/+14
| | | | llvm-svn: 236953
* Fix for LWG Issue 2369: constexpr max(initializer_list) vs max_elementMarshall Clow2015-05-106-0/+89
| | | | llvm-svn: 236952
* Fix for LWG Issue 2059: C++0x ambiguity problem with map::eraseMarshall Clow2015-05-108-0/+180
| | | | llvm-svn: 236950
* Remove some debugging printout lines. No functionality change.Marshall Clow2015-05-101-2/+0
| | | | llvm-svn: 236949
* Fix for LWG2454: Add raw_storage_iterator::base() memberMarshall Clow2015-05-101-0/+48
| | | | llvm-svn: 236948
* Fix some preprocessor directives that were generating warnings in the test ↵Marshall Clow2015-04-282-2/+2
| | | | | | suite. llvm-svn: 235999
* Remove constexpr support for std::apply because it introduces regressions.Eric Fiselier2015-04-192-0/+8
| | | | llvm-svn: 235274
* A few bits of N2994 didn't get fully implemented a long time ago. Thanks to ↵Marshall Clow2015-04-166-9/+80
| | | | | | STL@microsoft.com for the bug report llvm-svn: 235134
OpenPOWER on IntegriCloud