summaryrefslogtreecommitdiffstats
path: root/libcxx/test/support
Commit message (Collapse)AuthorAgeFilesLines
* Fix archetypes.hpp under libcpp-no-extensions and std level < 14Roger Ferrer Ibanez2016-10-311-2/+2
| | | | | | | | | | | | Under -fno-exceptions TEST_THROW becomes abort / __builtin_abort which returns void. This causes a type mismatch in the conditional operator when testing the library in C++98,03,11 modes. Use a comma operator to workaround this problem. Differential Revision: https://reviews.llvm.org/D26147 llvm-svn: 285572
* Silence unused parameter warnings in archetypes.hppCasey Carter2016-10-261-6/+6
| | | | | | Reviewed at: https://reviews.llvm.org/D25958 llvm-svn: 285213
* Fix unreferenced parameters. Patch from STL@microsoft.comEric Fiselier2016-10-231-6/+6
| | | | llvm-svn: 284942
* Update issue status for LWG 2744Eric Fiselier2016-10-161-5/+14
| | | | llvm-svn: 284322
* Correctly grant rebound limited_allocators friendship.Eric Fiselier2016-10-121-0/+1
| | | | llvm-svn: 284006
* Unbreak C++03 buildEric Fiselier2016-10-121-1/+1
| | | | llvm-svn: 284004
* Remove usages of _ALIGNAS_TYPEEric Fiselier2016-10-121-0/+6
| | | | llvm-svn: 283999
* Fix more C++11 constexpr issues in the testsEric Fiselier2016-10-121-9/+24
| | | | llvm-svn: 283996
* Fix nasty_containers.hpp for other stdlibsEric Fiselier2016-10-122-44/+58
| | | | llvm-svn: 283994
* Fix use of C++14 constexpr in C++11Eric Fiselier2016-10-121-0/+4
| | | | llvm-svn: 283993
* Protect special members of NullBase archetype to avoid exposing themEric Fiselier2016-10-121-4/+11
| | | | llvm-svn: 283983
* Implement N4606 optionalEric Fiselier2016-10-122-43/+420
| | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: Adapt implementation of Library Fundamentals TS optional into an implementation of N4606 optional. - Update relational operators per http://wg21.link/P0307 - Update to requirements of http://wg21.link/P0032 - Extension: Implement trivial copy/move construction/assignment for `optional<T>` when `T` is trivially copyable. Audit P/Rs for optional LWG issues: - 2756 "C++ WP optional<T> should 'forward' T's implicit conversions" Implemented, which also resolves 2753 "Optional's constructors and assignments need constraints" (modulo my refusal to explicitly delete the move operations, which is a design error that I'm working on correcting in the 2756 P/R). - 2736 "nullopt_t insufficiently constrained" Already conforming. I've added a test ensuring that `nullopt_t` is not copy-initializable from an empty braced-init-list, which I believe is the root intent of the issue, to avoid regression. - 2740 "constexpr optional<T>::operator->" Already conforming. - 2746 "Inconsistency between requirements for emplace between optional and variant" No P/R, but note that the author's '"suggested resolution" is already implemented. - 2748 "swappable traits for optionals" Already conforming. - 2753 "Optional's constructors and assignments need constraints" Implemented. Most of the work for this patch was done by Casey Carter @ Microsoft. Thank you Casey! Reviewers: mclow.lists, CaseyCarter, EricWF Differential Revision: https://reviews.llvm.org/D22741 llvm-svn: 283980
* Revert Add <optional>. Will recommit with better commit messageEric Fiselier2016-10-122-421/+44
| | | | llvm-svn: 283978
* Add <optional> header.Eric Fiselier2016-10-122-44/+421
| | | | | | | | This patch is largely thanks to Casey Carter @ Microsoft. He did the initial work of porting our experimental implementation and tests over to namespace std. llvm-svn: 283977
* Add missing include in test_allocator.hEric Fiselier2016-10-081-2/+3
| | | | llvm-svn: 283632
* [libc++] Fix stack_allocatorEric Fiselier2016-10-081-0/+73
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: To quote STL the problems with stack allocator are" >"stack_allocator<T, N> is seriously nonconformant to N4582 17.6.3.5 [allocator.requirements]. > First, it lacks a rebinding constructor. (The nested "struct rebind" isn't sufficient.) > Second, it lacks templated equality/inequality. > Third, it completely ignores alignment. > Finally, and most severely, the Standard forbids its existence. Allocators are forbidden from returning memory "inside themselves". This requirement is implied by the Standard's requirements for rebinding and equality. It's permitted to return memory from a separate buffer object on the stack, though." This patch attempts to address all of those issues. First, instead of storing the buffer inside the allocator I've change `stack_allocator` to accept the buffer as an argument. Second, in order to fix rebinding I changed the parameter list from `<class T, size_t NumElements>` to `<class T, size_t NumBytes>`. This allows allocator rebinding between types that have different sizes. Third, I added copy and rebinding constructors and assignment operators. And finally I fixed the allocation logic to always return properly aligned storage. Reviewers: mclow.lists, howard.hinnant, STL_MSFT Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D25154 llvm-svn: 283631
* Fix various issues in std::any and the related tests.Eric Fiselier2016-10-072-61/+2
| | | | | | | | | | | | | | | | | | | | * Fix self-swap. Patch from Casey Carter. * Remove workarounds and tests for types with deleted move constructors. This was originally added as part of a LWG proposed resolution that has since changed. * Re-apply most recent PR for LWG 2769. * Re-apply most recent PR for LWG 2754. Specifically fix the SFINAE checks to use the decayed type. * Fix tests to allow moved-from std::any's to have a non-empty state. This is the behavior of MSVC's std::any. * Various whitespace and test fixes. llvm-svn: 283606
* Remove MSVC workarounds. Patch from STL@microsoft.comEric Fiselier2016-10-071-8/+2
| | | | llvm-svn: 283580
* [libcxx] [test] Guard __has_include usage with a macroEric Fiselier2016-10-041-1/+7
| | | | | | | | | | | | Summary: There's a macro scheme already being used for __has_feature etc. Use it for __has_include too, which makes MSVC happy (it doesn't support __has_include yet, and unguarded use explodes horribly). Reviewers: mclow.lists, EricWF Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D25251 llvm-svn: 283260
* Replace test_throw.h header with a single test macroEric Fiselier2016-10-012-27/+11
| | | | llvm-svn: 283030
* [libc++] Remove various C++03 feature test macrosEric Fiselier2016-09-251-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | Summary: Libc++ still uses per-feature configuration macros when configuring for C++11. However libc++ requires a feature-complete C++11 compiler so there is no reason to check individual features. This patch starts the process of removing the feature specific macros and replacing their usage with `_LIBCPP_CXX03_LANG`. This patch removes the __config macros: * _LIBCPP_HAS_NO_TRAILING_RETURN * _LIBCPP_HAS_NO_TEMPLATE_ALIASES * _LIBCPP_HAS_NO_ADVANCED_SFINAE * _LIBCPP_HAS_NO_DEFAULT_FUNCTION_TEMPLATE_ARGS * _LIBCPP_HAS_NO_STATIC_ASSERT As a drive I also changed our C++03 static_assert to use _Static_assert if available. I plan to commit this without review if nobody voices an objection. Reviewers: mclow.lists Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D24895 llvm-svn: 282347
* [libcxx] Introduce an externally-threaded libc++ variant.Asiri Rathnayake2016-09-111-0/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch further decouples libc++ from pthread, allowing libc++ to be built against other threading systems. There are two main use cases: - Building libc++ against a thread library other than pthreads. - Building libc++ with an "external" thread API, allowing a separate library to provide the implementation of that API. The two use cases are quite similar, the second one being sligtly more de-coupled than the first. The cmake option LIBCXX_HAS_EXTERNAL_THREAD_API enables both kinds of builds. One needs to place an <__external_threading> header file containing an implementation of the "libc++ thread API" declared in the <__threading_support> header. For the second use case, the implementation of the libc++ thread API can delegate to a custom "external" thread API where the implementation of this external API is provided in a seperate library. This mechanism allows toolchain vendors to distribute a build of libc++ with a custom thread-porting-layer API (which is the "external" API above), platform vendors (recipients of the toolchain/libc++) are then required to provide their implementation of this API to be linked with (end-user) C++ programs. Note that the second use case still requires establishing the basic types that get passed between the external thread library and the libc++ library (e.g. __libcpp_mutex_t). These cannot be opaque pointer types (libc++ sources won't compile otherwise). It should also be noted that the second use case can have a slight performance penalty; as all the thread constructs need to cross a library boundary through an additional function call. When the header <__external_threading> is omitted, libc++ is built with the "libc++ thread API" (declared in <__threading_support>) as the "external" thread API (basic types are pthread based). An implementation (pthread based) of this API is provided in test/support/external_threads.cpp, which is built into a separate DSO and linked in when running the libc++ test suite. A test run therefore demonstrates the second use case (less the intermediate custom API). Differential revision: https://reviews.llvm.org/D21968 Reviewers: bcraig, compnerd, EricWF, mclow.lists llvm-svn: 281179
* Fix bad locale test data when using the newest glibcEric Fiselier2016-09-041-0/+7
| | | | llvm-svn: 280608
* Implement C++17 std::sample.Eric Fiselier2016-08-281-1/+1
| | | | | | | | This patch implements the std::sample function added to C++17 from LFTS. It also removes the std::experimental::sample implementation which now forwards to std::sample. llvm-svn: 279948
* Implement LWG 2711. Constrain path members.Eric Fiselier2016-08-281-11/+13
| | | | llvm-svn: 279945
* Support allocators with explicit conversion constructors. Fixes bug #29000Marshall Clow2016-08-171-0/+25
| | | | llvm-svn: 278904
* Fix new ASAN failuresEric Fiselier2016-08-151-0/+1
| | | | llvm-svn: 278736
* Refactor test archetypes implementation.Eric Fiselier2016-08-112-99/+135
| | | | llvm-svn: 278319
* [libcxx] Add std::anyEric Fiselier2016-08-113-29/+519
| | | | | | | | | | | | | | | | | | | Summary: This patch adds std::any by moving/adapting <experimental/any>. This patch also implements the std::any parts of p0032r3 (http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2016/p0032r3.pdf) and LWG 2509 (http://cplusplus.github.io/LWG/lwg-defects.html#2509). I plan to push it in a day or two if there are no comments. Reviewers: mclow.lists, EricWF Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D22733 llvm-svn: 278310
* Fix copy/move constructor annotation for the uses-allocator test types.Eric Fiselier2016-08-081-9/+19
| | | | | | | Previously the copy/move constructors of the test types did not properly set the arg_id to T const& or T&& respectivly. llvm-svn: 277970
* Silence another occurrence of MSVC's suprious unused warning. Patch from ↵Eric Fiselier2016-08-031-1/+4
| | | | | | STL@microsoft.com llvm-svn: 277572
* Implement the std::pair parts of "Improving pair and tuple". Completes N4387.Eric Fiselier2016-07-251-0/+110
| | | | llvm-svn: 276605
* Implement P0040r3: Extending memory management toolsEric Fiselier2016-07-241-0/+27
| | | | llvm-svn: 276544
* Unbreak traits tests by handling differences between version macros in ↵Eric Fiselier2016-07-201-0/+8
| | | | | | clang/apple-clang. llvm-svn: 276200
* Add checkpoint diagnostics to help diagnose buildbot failures.Eric Fiselier2016-07-181-2/+7
| | | | llvm-svn: 275754
* Always use the allocator to construct/destruct elements of a deque/vector. ↵Marshall Clow2016-07-111-0/+78
| | | | | | Fixes PR#28412. Thanks to Jonathan Wakely for the report. llvm-svn: 275105
* Fix UB in uses_alloc_types.hppEric Fiselier2016-06-271-2/+2
| | | | llvm-svn: 273840
* Implement P0163r0. Add shared_ptr::weak_type.Eric Fiselier2016-06-271-1/+1
| | | | | | | | | | This patch adds the weak_type typedef in shared_ptr. It is available in C++17 and newer. This patch also updates the _LIBCPP_STD_VER and TEST_STD_VER macros to have the value of 16, since 2016 is the current year. llvm-svn: 273839
* Implement p0337r0. Delete operator= for polymorphic_allocator.Eric Fiselier2016-06-271-11/+11
| | | | llvm-svn: 273838
* Add [[noreturn]] attribute to throw_bad_alloc_helper().Eric Fiselier2016-06-262-3/+8
| | | | llvm-svn: 273819
* Use correct Clang feature names. I got them wrong in the previous commitEric Fiselier2016-06-221-2/+2
| | | | llvm-svn: 273384
* Support old GCC exception and rtti detection macrosEric Fiselier2016-06-221-2/+4
| | | | llvm-svn: 273383
* Add tests for RTTI/exceptions test macros.Eric Fiselier2016-06-225-0/+105
| | | | llvm-svn: 273382
* Fix exception/rtti detection in tests.Eric Fiselier2016-06-221-2/+2
| | | | | | | | | | So the macros TEST_HAS_NO_EXCEPTIONS and TEST_HAS_NO_RTTI were always getting defined because I spelt __cpp_exceptions and __cpp_rtti as __cxx_exceptions and __cxx_rtti. Tests incoming after this patch. llvm-svn: 273381
* Cleanup [list.modifiers] tests.Eric Fiselier2016-06-221-1/+34
| | | | llvm-svn: 273371
* Suppress stupid and incorrect MSVC warning. patch from STL@microsoft.comEric Fiselier2016-06-221-1/+5
| | | | llvm-svn: 273350
* Allow the libc++ build/source paths to contain symlinks.Eric Fiselier2016-06-211-0/+2
| | | | | | | | The filesystem tests were expecting the paths to the build/source directories did not contain any symlinks. This patch resolves those symlinks before running the test suite. llvm-svn: 273323
* Implement std::experimental::propagate_const from LFTS v2Jonathan Coe2016-06-191-0/+119
| | | | | | | | | | | | | Summary: An implementation of std::experimental::propagate_const from Library Fundamentals Technical Specification v2. No tests are provided for disallowed types like fancy pointers or function pointers as no code was written to handle these. Reviewers: EricWF, mclow.lists Differential Revision: http://reviews.llvm.org/D12486 llvm-svn: 273122
* Fix SleepFor(...) helper when a monotonic clock is not available.Eric Fiselier2016-06-181-3/+7
| | | | | | | | Single threaded builds often don't provide a monotonic clock, so we can't always provide a monotonic SleepFor(...) implementation. Hopefully this won't cause the builds to hang. llvm-svn: 273091
* Use monotonic clock in synthetic SleepFor test helperEric Fiselier2016-06-181-2/+2
| | | | llvm-svn: 273089
OpenPOWER on IntegriCloud