summaryrefslogtreecommitdiffstats
path: root/libcxx/test
Commit message (Collapse)AuthorAgeFilesLines
...
* [libcxx] [test] Fix Clang -Wunused-local-typedef warnings.Stephan T. Lavavej2018-11-144-20/+0
| | | | | | C++11's [hash.requirements] never required these typedefs from users. llvm-svn: 346912
* [libcxx] [test] Include <cassert> for assert().Stephan T. Lavavej2018-11-148-0/+8
| | | | | | This fixes compiler errors with MSVC's STL. llvm-svn: 346911
* [libcxx] [test] Fix MSVC warning C4800.Stephan T. Lavavej2018-11-141-6/+6
| | | | | | | | | | | | This was implicitly converting [1, 3] to bool, which triggers an MSVC warning. The test should just pass `true`, which is simpler, has the same behavior, and avoids the warning. (This is a library test, not a compiler test, and the conversion happens before calling `push_back`, so passing [1, 3] isn't interesting in any way. This resembles a previous change to stop passing `1 == 1` in the `vector<bool>` tests.) llvm-svn: 346910
* Rename cxx-benchmark-unittests target and convert to LIT.Eric Fiselier2018-11-141-11/+2
| | | | | | | | | | | | | | This patch renames the cxx-benchmark-unittests to check-cxx-benchmarks and converts the target to use LIT in order to make the tests run faster and provide better output. In particular this runs each benchmark in a suite one by one, allowing more parallelism while ensuring output isn't garbage with multiple threads. Additionally, it adds the CMake flag '-DLIBCXX_BENCHMARK_TEST_ARGS=<list>' to specify what options are passed when running the benchmarks. llvm-svn: 346888
* [libcxx] [test] Strip trailing whitespace. NFC.Stephan T. Lavavej2018-11-14164-539/+538
| | | | llvm-svn: 346826
* Implement P0972R0: <chrono> zero(), min(), and max() should be noexcept. ↵Marshall Clow2018-11-138-8/+57
| | | | | | Reviewed as https://reviews.llvm.org/D53828 llvm-svn: 346766
* [libcxx] Implement http://wg21.link/p1006, constexpr in pointer_traitsLouis Dionne2018-11-131-3/+14
| | | | | | | | | | | | | | | | Summary: P1006 adds support for constexpr in the specialization of pointer_traits for raw pointers. This is necessary in order to use pointer_traits in the upcoming constexpr containers. We expect P1006 to be voted into the working draft for C++20 at the San Diego meeting. Reviewers: mclow.lists, EricWF Subscribers: christof, dexonsmith, libcxx-commits Differential Revision: https://reviews.llvm.org/D53867 llvm-svn: 346764
* Add emplace tests for multiset/unordered_multiset.Eric Fiselier2018-11-133-1/+46
| | | | | | | | This patch adds tests to ensure that multiset/unordered_multiset's emplace method correctly constructs the elements without any intervening constructions. llvm-svn: 346743
* Fix PR39619 - iterator_traits isn't SFINAE-friendly enough. Thanks to Eric ↵Marshall Clow2018-11-132-0/+123
| | | | | | for the report llvm-svn: 346738
* [NFC] Reformat std::optional testsLouis Dionne2018-11-122-4/+4
| | | | llvm-svn: 346630
* Fix test assumption that Linux implies glibc.Dan Albert2018-11-011-3/+9
| | | | | | | | | | | | | | | | | | | | | Summary: This fixes an regression when using bionic introduced in r345173. I need to follow up and figure out what exactly is implied by TEST_HAS_C11_FEATURES and see what the correct configuration is for bionic (new versions should have everything the tests care about, versions that predate C11 certainly don't), but this gets the tests back to the old behavior. Reviewers: EricWF Reviewed By: EricWF Subscribers: mclow.lists, christof, ldionne, libcxx-commits, cfe-commits Differential Revision: https://reviews.llvm.org/D53956 llvm-svn: 345900
* Revert "Bug 39129: Speeding up partition_point/lower_bound/upper_bound/ by ↵Louis Dionne2018-11-011-59/+0
| | | | | | | | | | | using unsigned division by 2 when possible." This reverts r345525. I'm reverting because that patch apparently caused a regression on certain platforms (see https://reviews.llvm.org/D53994). Since we don't fully understand the reasons for the regression, I'm reverting until we can provide a fix we understand. llvm-svn: 345893
* [libcxx] Fix usage of _C2, which is a "nasty macro" in some environmentsLouis Dionne2018-11-011-0/+3
| | | | | | The problem was pointed out in https://reviews.llvm.org/D48896#inline-475775. llvm-svn: 345834
* Second half of C++17's splicing maps and setsErik Pilkington2018-10-318-0/+1232
| | | | | | | | | | This commit adds a merge member function to all the map and set containers, which splices nodes from the source container. This completes support for P0083r3. Differential revision: https://reviews.llvm.org/D48896 llvm-svn: 345744
* XFAIL test on OS X availabilityEric Fiselier2018-10-291-6/+6
| | | | llvm-svn: 345529
* Bug 39129: Speeding up partition_point/lower_bound/upper_bound/ by using ↵Eric Fiselier2018-10-291-0/+59
| | | | | | | | | | | | unsigned division by 2 when possible. Patch by Denis Yaroshevskiy (denis.yaroshevskij@gmail.com) The rational and measurements can be found in the bug description: https://bugs.llvm.org/show_bug.cgi?id=39129 Reviewed as https://reviews.llvm.org/D52697 llvm-svn: 345525
* Fix PR39458 _LIBCPP_DEBUG breaks heterogeneous compare.Eric Fiselier2018-10-261-0/+51
| | | | | | | | | | | | | | | | | | | | The types/comparators passed to std::upper_bound and std::lower_bound are not required to provided to provide an operator</comp(...) which accepts the arguments in reverse order. Nor are the ranges required to have a strict weak ordering. However, in debug mode we attempted to check the result of a comparison with the arguments reversed, which may not compiler. This patch removes the use of the debug comparator for upper_bound and lower_bound. equal_range et al still use debug comparators when they call __upper_bound and __lower_bound. See llvm.org/PR39458 llvm-svn: 345434
* Work around gcc.gnu.org/PR87766Eric Fiselier2018-10-261-1/+1
| | | | llvm-svn: 345425
* XFAIL sized deallocation test with GCCEric Fiselier2018-10-261-0/+3
| | | | llvm-svn: 345400
* Run the min/max tests agaist the header <charconv>. Fix that header so it ↵Marshall Clow2018-10-261-0/+2
| | | | | | passes. NFC. llvm-svn: 345352
* Implement sized deallocation for std::allocator and friends.Eric Fiselier2018-10-251-0/+246
| | | | | | | | | | | | | | | | | | | Summary: C++14 sized deallocation is disabled by default due to ABI concerns. However, when a user manually enables it then libc++ should take advantage of it since sized deallocation can provide a significant performance win depending on the underlying malloc implementation. (Note that libc++'s definitions of sized delete don't do anything special yet, but users are free to provide their own). This patch updates __libcpp_deallocate to selectively call sized operator delete when it's available. `__libcpp_deallocate_unsized` should be used when the size of the allocation is unknown. On Apple this patch makes no attempt to determine if the sized operator delete is unavailable, only that the language feature is enabled. This could cause a compile error when using `std::allocator`, but the same compile error would occur whenever the user calls `new`, so I don't think it's a problem. Reviewers: ldionne, mclow.lists Reviewed By: ldionne Subscribers: rsmith, ckennelly, libcxx-commits, christof Differential Revision: https://reviews.llvm.org/D53120 llvm-svn: 345281
* Temporarily Revert "Implement sized deallocation for std::allocator and ↵Eric Christopher2018-10-251-245/+0
| | | | | | | | | | friends." This is breaking the bots here (and related): http://lab.llvm.org:8011/builders/libcxx-libcxxabi-x86_64-linux-ubuntu-asan/builds/1428 This reverts commit r345214. llvm-svn: 345239
* Implement sized deallocation for std::allocator and friends.Eric Fiselier2018-10-241-0/+245
| | | | | | | | | | | | | | | | | | | Summary: C++14 sized deallocation is disabled by default due to ABI concerns. However, when a user manually enables it then libc++ should take advantage of it since sized deallocation can provide a significant performance win depending on the underlying malloc implementation. (Note that libc++'s definitions of sized delete don't do anything special yet, but users are free to provide their own). This patch updates __libcpp_deallocate to selectively call sized operator delete when it's available. `__libcpp_deallocate_unsized` should be used when the size of the allocation is unknown. On Apple this patch makes no attempt to determine if the sized operator delete is unavailable, only that the language feature is enabled. This could cause a compile error when using `std::allocator`, but the same compile error would occur whenever the user calls `new`, so I don't think it's a problem. Reviewers: ldionne, mclow.lists Reviewed By: ldionne Subscribers: rsmith, ckennelly, libcxx-commits, christof Differential Revision: https://reviews.llvm.org/D53120 llvm-svn: 345214
* Revert "Teach __libcpp_is_floating_point that __fp16 and _Float16 are"Petr Hosek2018-10-241-24/+0
| | | | | | | | | This reverts commits r333103 and r333108. _Float16 and __fp16 are C11 extensions and compilers other than Clang don't define these for C++. Differential Revision: https://reviews.llvm.org/D53670 llvm-svn: 345199
* Fix use of libc++ specific macro in support/test_macros.hEric Fiselier2018-10-241-3/+4
| | | | llvm-svn: 345173
* Adjust unsupported C++ versions in some testsMikhail Maltsev2018-10-24176-176/+176
| | | | | | | | | | | | | | | | | | | | Summary: Some tests (mainly the new C++20 calendar library) fail when libc++ is tested with '--param=std=c++98'. The failures happen because the tests actually don't support C++98, but don't mention C++98 in the 'UNSUPPORTED:' line. This change fixes the issue. Reviewers: mclow.lists, ldionne Reviewed By: ldionne Subscribers: arphaman, michaelplatings, libcxx-commits Differential Revision: https://reviews.llvm.org/D53640 llvm-svn: 345148
* Mark the move construct/move assign tests as unsupported on C++03Marshall Clow2018-10-232-1/+2
| | | | llvm-svn: 345001
* Add tests for match_results copy/move assignment operators. NFCMarshall Clow2018-10-233-0/+106
| | | | llvm-svn: 344998
* Remove a 'const' from the synopsis. NFCMarshall Clow2018-10-231-1/+1
| | | | llvm-svn: 344997
* Add tests for match_results copy/move construction. NFCMarshall Clow2018-10-232-0/+83
| | | | llvm-svn: 344988
* Update commnents to reflect the changes for LWG#3127. NFCMarshall Clow2018-10-222-1/+31
| | | | llvm-svn: 344951
* Update commnents to reflect the changes for LWG#3122. NFCMarshall Clow2018-10-222-0/+2
| | | | llvm-svn: 344950
* [libcxx] [test] Don't detect Windows' UCRT with TEST_COMPILER_C1XXBilly Robert O'Neal III2018-10-202-7/+3
| | | | | | The test is trying to avoid saying aligned_alloc on Windows' UCRT, which does not (and can not) implement aligned_alloc. However, it's testing for c1xx, meaning clang on Windows will fail this test when using the UCRT. llvm-svn: 344829
* [libcxx] [test] Add missing <stdexcept> to map at tests.Billy Robert O'Neal III2018-10-192-3/+5
| | | | | | Reviewed as https://reviews.llvm.org/D50551 llvm-svn: 344821
* Repair thread-unsafe modifications of n_alive in F.pass.cppBilly Robert O'Neal III2018-10-191-4/+10
| | | | | | | | In this example, the ctor of G runs in the main thread in the expression G(), and also in the copy ctor of G() in the DECAY_COPY inside std::thread. The main thread destroys the G() instance at the semicolon, and the started thread destroys the G() after it returns. Thus there is a race between the threads on the n_alive variable. The fix is to join with the background thread before attempting to destroy the G in the main thread. llvm-svn: 344820
* [libcxx] Mark chrono literal unit tests as being unsupported on AppleClang 10Louis Dionne2018-10-174-4/+4
| | | | llvm-svn: 344661
* Recommit <chrono> changes with a couple xtra tests marked to fail on apple's ↵Marshall Clow2018-10-16178-1/+9864
| | | | | | clang. Reviewed as D51762 llvm-svn: 344627
* Re-apply r344546 "Mark a couple of test cases as 'C++17-only'..."Artem Dergachev2018-10-162-2/+6
| | | | | | Reverted too much in r344580. llvm-svn: 344582
* Revert r344529 "Implement the first part of the calendar support for C++20"Artem Dergachev2018-10-16181-9927/+2
| | | | | | | | | | Revert r344535 "Wrap up the new chrono literals in an #ifdef..." Revert r344546 "Mark a couple of test cases as 'C++17-only'..." Some of the buildbot failures were masked by another error, and this one was probably missed. llvm-svn: 344580
* Mark a couple of test cases as 'C++17-only' pending the resolution of PR#39232Marshall Clow2018-10-152-2/+6
| | | | llvm-svn: 344546
* Wrap up the new chrono literals in an #ifdef so that old versions of clang ↵Marshall Clow2018-10-152-0/+4
| | | | | | don't complain. I'm looking at you, clang 5.0.1 llvm-svn: 344535
* Implement the first part of the calendar support for C++20. This is still ↵Marshall Clow2018-10-15179-0/+9917
| | | | | | incomplete; there will be more patches coming. Reviewed as D51762 llvm-svn: 344529
* One more local type warning removed from the tests. NFCMarshall Clow2018-10-121-8/+12
| | | | llvm-svn: 344421
* Update the array tests to not use a local type; removes warnings in C++03. NFCMarshall Clow2018-10-123-9/+13
| | | | llvm-svn: 344417
* Update all the max_size tests to eliminate signed/unsigned comparison ↵Marshall Clow2018-10-1212-62/+62
| | | | | | warnings. NFC llvm-svn: 344416
* Add a test that shows what happens with throwing destructors. NFC.Marshall Clow2018-10-111-0/+11
| | | | llvm-svn: 344220
* Use TEST_STD_VER instead of __cplusplus [NFC]Aaron Puchert2018-10-1024-24/+49
| | | | | | | | While __cplusplus was only used a few dozen times, TEST_STD_VAR is used more than 2000 times. So we replace the former by the latter for consistency in the tests. There should be no functional change. llvm-svn: 344194
* Use std::scoped_lock only for C++17 and newerAaron Puchert2018-10-101-0/+2
| | | | | | This fixes a test failure caused by D53049. llvm-svn: 344192
* Add test macros for always_inline and noinlineEric Fiselier2018-10-101-0/+10
| | | | llvm-svn: 344167
* Annotate scoped_lock as with scoped_lockable attributeAaron Puchert2018-10-091-0/+6
| | | | | | | | | | | | | | | | | | Summary: Scoped capabilities need to be annotated as such, otherwise the thread safety analysis won't work as intended. Fixes PR39234. Reviewers: ldionne Reviewed By: ldionne Subscribers: christof, libcxx-commits Differential Revision: https://reviews.llvm.org/D53049 llvm-svn: 344096
OpenPOWER on IntegriCloud