summaryrefslogtreecommitdiffstats
path: root/libcxx/test
Commit message (Collapse)AuthorAgeFilesLines
...
* Fix linker script generation for in-tree buildsEric Fiselier2016-10-091-6/+12
| | | | llvm-svn: 283700
* Remove all _LIBCPP_VERSION tests from under test/stdEric Fiselier2016-10-0813-24/+127
| | | | llvm-svn: 283644
* Purge all usages of _LIBCPP_STD_VER under test/std/algorithmEric Fiselier2016-10-0817-121/+132
| | | | llvm-svn: 283643
* Add missing <memory> include in testEric Fiselier2016-10-081-0/+1
| | | | llvm-svn: 283633
* Add missing include in test_allocator.hEric Fiselier2016-10-081-2/+3
| | | | llvm-svn: 283632
* [libc++] Fix stack_allocatorEric Fiselier2016-10-0832-135/+142
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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 shadow warnings. Patch from STL@microsoft.comEric Fiselier2016-10-071-10/+10
| | | | llvm-svn: 283618
* Fix various issues in std::any and the related tests.Eric Fiselier2016-10-0715-214/+193
| | | | | | | | | | | | | | | | | | | | * 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] Recover no-exceptions XFAILs - IAsiri Rathnayake2016-10-0621-28/+95
| | | | | | | | | | | | | | | | First batch of changes to get some of these XFAILs working in the no-exceptions libc++ variant. Changed some XFAILs to UNSUPPORTED where the test is all about exception handling. In other cases, used the test macros TEST_THROW and TEST_HAS_NO_EXCEPTIONS to conditionally exclude those parts of the test that concerns exception handling behaviour. Reviewers: EricWF, mclow.lists Differential revision: https://reviews.llvm.org/D24562 llvm-svn: 283441
* Comment out failing test while I figure out who is at faultMarshall Clow2016-10-051-1/+1
| | | | llvm-svn: 283360
* Make tests for is_empty better. No functional change.Marshall Clow2016-10-051-5/+31
| | | | llvm-svn: 283339
* Add another append test for basic_stringMarshall Clow2016-10-051-0/+4
| | | | llvm-svn: 283331
* [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
* Add tests to make sure that is_constructible<cv-void> is false. We already ↵Marshall Clow2016-10-031-0/+3
| | | | | | checked 'unqualified void'. This was brought up by LWG#2738 llvm-svn: 283161
* [lit] Allow more file extensions for test cases.Logan Chien2016-10-031-1/+3
| | | | | | | This commit splits the file extensions before determining the test format. This allows libc++abi to add assembly-based test cases. llvm-svn: 283118
* Remove all instances of _LIBCPP_HAS_NO_RVALUE_REFERENCES from test/std/utilitiesEric Fiselier2016-10-0145-209/+118
| | | | llvm-svn: 283032
* Replace test_throw.h header with a single test macroEric Fiselier2016-10-018-39/+17
| | | | llvm-svn: 283030
* [libc++] Extension: Make `move` and `forward` constexpr in C++11.Eric Fiselier2016-09-2616-477/+301
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: `std::move` and `std::forward` were not marked constexpr in C++11. This can be very damaging because it makes otherwise constant expressions non-constant. For example: ``` #include <utility> template <class T> struct Foo { constexpr Foo(T&& tx) : t(std::move(tx)) {} T t; }; [[clang::require_constant_initialization]] Foo<int> f(42); // Foo should be constant initialized but C++11 move is not constexpr. As a result `f` is an unsafe global. ``` This patch applies `constexpr` to `move` and `forward` as an extension in C++11. Normally the library is not allowed to add `constexpr` because it may be observable to the user. In particular adding constexpr may cause valid code to stop compiling. However these problems only happen in more complex situations, like making `__invoke(...)` constexpr. `forward` and `move` are simply enough that applying `constexpr` is safe. Note that libstdc++ has offered this extension since at least 4.8.1. Most of the changes in this patch are simply test cleanups or additions. The main changes in the tests are: * Fold all `forward_N.fail.cpp` tests into a single `forward.fail.cpp` test using -verify. * Delete most `move_only_N.fail.cpp` tests because they weren't actually testing anything. * Fold `move_copy.pass.cpp` and `move_only.pass.cpp` into a single `move.pass.cpp` test. * Add return type and noexcept tests for `forward` and `move`. Reviewers: rsmith, mclow.lists, EricWF Subscribers: K-ballo, loladiro Differential Revision: https://reviews.llvm.org/D24637 llvm-svn: 282439
* Update -verify test to use new static assert messageEric Fiselier2016-09-251-5/+0
| | | | llvm-svn: 282352
* [libc++] Remove various C++03 feature test macrosEric Fiselier2016-09-2519-60/+61
| | | | | | | | | | | | | | | | | | | | | | | | | 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
* Fix a few static_asserts that need extra parens on -03Marshall Clow2016-09-243-6/+6
| | | | llvm-svn: 282343
* Implement proposed resolution for LWG#2758. Reviewed as D24446. Normally, I ↵Marshall Clow2016-09-245-6/+13928
| | | | | | would wait for these to be voted upon at a committee meeting (November), but the current draft standard is broken, and this should fix it. (And if it doesn't, we want to know about it soonest) llvm-svn: 282342
* Fix incorrect include in is_error_code_enum.pass.cppMarshall Clow2016-09-241-2/+2
| | | | llvm-svn: 282332
* Implement is_error_code_v and is_error_condition_v for c++17. Rework the ↵Marshall Clow2016-09-244-1/+132
| | | | | | tests for is_error_code and is_error_condition, since they were really lacking. Thanks to Alisdair for the heads-up that we were missing these. llvm-svn: 282331
* Fix failure on 03 botMarshall Clow2016-09-221-2/+2
| | | | llvm-svn: 282134
* Add missing _v traits. is_bind_expression_v, is_placeholder_v and ↵Marshall Clow2016-09-223-8/+38
| | | | | | uses_allocator_v llvm-svn: 282126
* [libcxx] Add missing c++98 xfail. NFC.Asiri Rathnayake2016-09-161-1/+1
| | | | | | This is the only test failing in c++98 mode at the moment. llvm-svn: 281731
* [libcxx] Allow sanitizing libcxx with ASan+UBSan simultaneouslyKuba Brecka2016-09-151-6/+12
| | | | | | | | Allow building with LLVM_USE_SANITIZER=“Address;Undefined” (and “Undefined;Address”). Differential Revision: https://reviews.llvm.org/D24569 llvm-svn: 281603
* [libcxx] Add a TSan regression test for a data race in call_onceKuba Brecka2016-09-141-0/+48
| | | | | | Differential Revision: https://reviews.llvm.org/D24297 llvm-svn: 281477
* [libcxx] Fix a typo in test/libcxx/test/target_info.py that prevents running ↵Kuba Brecka2016-09-141-1/+1
| | | | | | | | tests on Darwin with sanitizers Differential Revision: https://reviews.llvm.org/D24297 llvm-svn: 281476
* [libcxx] Introduce an externally-threaded libc++ variant.Asiri Rathnayake2016-09-119-6/+26
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* Avoid compile error by giving the test type a user defined default constructorEric Fiselier2016-09-071-1/+1
| | | | llvm-svn: 280780
* Fix PR#30303 - no matching function for call to '__ptr_in_range'Marshall Clow2016-09-074-0/+40
| | | | llvm-svn: 280779
* Improve constexpr tests for std::anyEric Fiselier2016-09-071-9/+9
| | | | llvm-svn: 280777
* Fix PR30260 - optional<const T> not working.Eric Fiselier2016-09-078-0/+94
| | | | | | | | | | This patch fixes PR30260 by using a (void*) cast on the placement argument to placement new to casts away the const. See also http://llvm.org/PR30260. As a drive by change this patch also changes the header guard for <experimental/optional> to _LIBCPP_EXPERIMENTAL_OPTIONAL from _LIBCPP_OPTIONAL. llvm-svn: 280775
* Fix Bug 30240 - std::string: append(first, last) error when aliasing. Add ↵Marshall Clow2016-09-0512-0/+193
| | | | | | test cases for append/insert/assign/replace while we're at it, and fix a similar bug in insert. llvm-svn: 280643
* Apply curr_symbol.pass.cpp test fix to missed test caseEric Fiselier2016-09-041-1/+6
| | | | llvm-svn: 280612
* Fix bad locale test data when using the newest glibcEric Fiselier2016-09-042-0/+15
| | | | llvm-svn: 280608
* Mark test as XFAIL for C++03, rather than providing a dummy pass.Marshall Clow2016-09-041-5/+2
| | | | llvm-svn: 280605
* Fix PR30202 - notify_all_at_thread_exit seg faults if run from a raw pthread ↵Eric Fiselier2016-09-031-0/+75
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | context. Summary: This patch allows threads not created using `std::thread` to use `std::notify_all_at_thread_exit` by ensuring the TL state has been initialized within `std::notify_all_at_thread_exit`. Additionally this patch "fixes" a potential oddity in `__thread_local_pointer::reset(pointer)`, which would previously delete the old thread local data. However there should *never* be old thread local data because pthread *should* null it out on thread exit. Unfortunately it's possible that pthread failed to do this according to the spec: > > Upon key creation, the value NULL shall be associated with the new key in all active threads. Upon thread creation, the value NULL shall be associated with all defined keys in the new thread. > > An optional destructor function may be associated with each key value. At thread exit, if a key value has a non-NULL destructor pointer, and the thread has a non-NULL value associated with that key, the value of the key is set to NULL, and then the function pointed to is called with the previously associated value as its sole argument. The order of destructor calls is unspecified if more than one destructor exists for a thread when it exits. > > If, after all the destructors have been called for all non-NULL values with associated destructors, there are still some non-NULL values with associated destructors, then the process is repeated. If, after at least {PTHREAD_DESTRUCTOR_ITERATIONS} iterations of destructor calls for outstanding non-NULL values, there are still some non-NULL values with associated destructors, implementations may stop calling destructors, or they may continue calling destructors until no non-NULL values with associated destructors exist, even though this might result in an infinite loop. However if pthread fails to delete the value it is probably incorrect for us to do it. Destroying the value performs all of the "at thread exit" actions registered with it but we are way past "at thread exit". Reviewers: mclow.lists, bcraig, EricWF Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D24159 llvm-svn: 280588
* Add "FLAKY_TEST" test directive to support re-running flaky tests.Eric Fiselier2016-08-3016-8/+48
| | | | | | | | Some of the mutex tests fail on machines with high load. This patch implements the test directive "// FLAKY_TEST" which allows a test to be run 3 times before it's considered a failure. llvm-svn: 280050
* Fix pair::operator=(TupleLike&&).Eric Fiselier2016-08-291-0/+140
| | | | | | | | | | | This assignment operator was previously broken since the SFINAE always resulted in substitution failure. This caused assignments to turn into copy construction + assignment. This patch was originally committed as r279953 but was reverted due to warnings in the test-suite. This new patch corrects those warnings. llvm-svn: 279955
* Revert r279953 - Fix pair::operator=(TupleLike&&)Eric Fiselier2016-08-291-135/+0
| | | | | | | The test emits warnings causing the test-suite to fail. Since I want this patch merged into 3.9 I'll recommit it with a clean test. llvm-svn: 279954
* Fix pair::operator=(TupleLike&&).Eric Fiselier2016-08-291-0/+135
| | | | | | | | This assignment operator was previously broken since the SFINAE always resulted in substitution failure. This caused assignments to turn into copy construction + assignment. llvm-svn: 279953
* Implement C++17 std::sample.Eric Fiselier2016-08-285-4/+250
| | | | | | | | 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
* Mark LWG 2716 as complete - shuffle and sample disallows lvalue URNGs.Eric Fiselier2016-08-284-12/+15
| | | | | | | | | | | Libc++'s implementation of shuffle and sample already support lvalue and rvalue RNG's. This patch adds tests for both categories and marks the issue as complete. This patch also contains drive-by change for std::experimental::sample which improves the diagnostics produced when the correct iterator categories are not supplied. llvm-svn: 279947
* Implement LWG 2711. Constrain path members.Eric Fiselier2016-08-285-11/+207
| | | | llvm-svn: 279945
* [CMake] Be more consistent about naming targets and componentsChris Bieneman2016-08-241-1/+3
| | | | | | | | | | | | | | | Summary: The point of this patch is to have a consistent convention for naming build, check and install targets so that the targets can be constructed from the project name. This change renames a bunch of CMake components and targets from libcxx to cxx. For each renamed target I've added a convenience target that matches the old target name and depends on the new target. This will preserve function of the old targets so that the change doesn't break the world. We can evaluate if it is worth removing the extra targets later. Reviewers: EricWF Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D23699 llvm-svn: 279675
* libcxx: Fix libcxx tests on aarch64 with libunwindAdhemerval Zanella2016-08-231-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | Some tests uses 'long double' to/from conversions and for some targets they are provided by compiler runtime (either compiler-rt or libgcc). However when building libcxx with linunwinder current test configuration at target_info.py do not include the required libraries, as: not llvm_unwinder: "-lc++" "-lm" "-lgcc_s" "-lgcc" "-lpthread" "-lc" "-lgcc_s" "-lgcc" llvm_unwinder "-lc++" "-lm" "-lpthread" "-lc" "-lunwind" "-ldl" This causes some tests build issues with missing symbols on aarch64, for instance, where 'long double' is a binary float with 128-bits with mostly of internal operations being provided by software routines. This patch changes how to define the default linker flags with libunwinder by adding libgcc regardless. I checked and aarch64 and x86_64 with libcxx and libunwind (with and without LIBCXXABI_USE_LLVM_UNWINDER). llvm-svn: 279552
OpenPOWER on IntegriCloud