summaryrefslogtreecommitdiffstats
path: root/libcxx/test
Commit message (Collapse)AuthorAgeFilesLines
...
* [libc++] Take 2: Implement LWG 2510Louis Dionne2019-09-2614-11/+369
| | | | | | | | | | | | | | | | | | | | | | | Summary: LWG2510 makes tag types like allocator_arg_t explicitly default constructible instead of implicitly default constructible. It also makes the constructors for std::pair and std::tuple conditionally explicit based on the explicit-ness of the default constructibility for the pair/tuple's elements. This was previously committed as r372777 and reverted in r372832 due to the commit breaking LLVM's build in C++14 mode. This issue has now been addressed. Reviewers: mclow.lists Subscribers: christof, jkorous, dexonsmith, libcxx-commits Tags: #libc Differential Revision: https://reviews.llvm.org/D65161 llvm-svn: 372983
* [libcxx] Do not implicitly #include assert.hDavid Zarzycki2019-09-266-2/+178
| | | | | | | | | Users should only get the assert() macros if they explicitly include them. Found after switching from the GNU C++ stdlib to the LLVM C++ stdlib. llvm-svn: 372963
* [libc++] Purge mentions of GCC 4 from the test suiteLouis Dionne2019-09-2525-59/+6
| | | | | | | | | We don't support GCC 4 and older according to the documentation, so we should pretend it doesn't exist. This is a re-application of r372787. llvm-svn: 372916
* Add forward declaration of operator<< in <string_view> as required.Eric Fiselier2019-09-251-0/+26
| | | | | | | | This declaration was previously missing despite appearing in the synopsis. Users are still required to include <ostream> to get the definition of the streaming operator. llvm-svn: 372909
* add tests that debug mode catches nullptr->string_view conversions in ↵Eric Fiselier2019-09-251-0/+5
| | | | | | comparison operators llvm-svn: 372907
* Add a missing default parameter to regex::assign. This is LWG3296; reviewed ↵Marshall Clow2019-09-251-0/+10
| | | | | | as https://reviews.llvm.org/D67944 llvm-svn: 372896
* Revert r372777: [libc++] Implement LWG 2510 and its follow-upsIlya Biryukov2019-09-2540-372/+70
| | | | | | | | | | | | This also reverts: - r372778: [libc++] Implement LWG 3158 - r372782: [libc++] Try fixing tests that fail on GCC 5 and older - r372787: Purge mentions of GCC 4 from the test suite Reason: the change breaks compilation of LLVM with libc++, for details see http://lists.llvm.org/pipermail/libcxx-dev/2019-September/000599.html llvm-svn: 372832
* [libc++] Purge mentions of GCC 4 from the test suiteLouis Dionne2019-09-2432-66/+13
| | | | | | | We don't support GCC 4 and older according to the documentation, so we should pretend it doesn't exist. llvm-svn: 372787
* [libc++] Try fixing tests that fail on GCC 5 and olderLouis Dionne2019-09-247-1/+27
| | | | llvm-svn: 372782
* [libc++] Remove C++03 variadics in shared_ptrZoe Carver2019-09-243-129/+80
| | | | | | | | | | | | | | Summary: As suggested by @ldionne in D66178, this patch removes C++03 variadics //only//. Following patches will apply more updates. Reviewers: ldionne, EricWF, mclow.lists Subscribers: christof, dexonsmith, libcxx-commits, ldionne Tags: #libc Differential Revision: https://reviews.llvm.org/D67675 llvm-svn: 372780
* [libc++] Implement LWG 3158Louis Dionne2019-09-242-1/+34
| | | | | | | | | | | | | | | | | Summary: LWG 3158 marks the allocator_arg_t constructor of std::tuple as conditionnally explicit based on whether the default constructors of the tuple's members are explicitly default constructible. Reviewers: EricWF, mclow.lists Subscribers: christof, jkorous, dexonsmith, libcxx-commits Tags: #libc Differential Revision: https://reviews.llvm.org/D65232 llvm-svn: 372778
* [libc++] Implement LWG 2510Louis Dionne2019-09-2414-10/+306
| | | | | | | | | | | | | | | | | | | Summary: LWG2510 makes tag types like allocator_arg_t explicitly default constructible instead of implicitly default constructible. It also makes the constructors for std::pair and std::tuple conditionally explicit based on the explicit-ness of the default constructibility for the pair/tuple's elements. Reviewers: mclow.lists, EricWF Subscribers: christof, jkorous, dexonsmith, libcxx-commits Tags: #libc Differential Revision: https://reviews.llvm.org/D65161 llvm-svn: 372777
* [libc++] Mark CTAD tests as not failing on AppleClang 10.0.1Louis Dionne2019-09-238-8/+8
| | | | | | They do fail on AppleClang 10.0.0, but not AppleClang 10.0.1 llvm-svn: 372632
* [libc++] Mark iostreams test as XFAIL on older macOSesLouis Dionne2019-09-231-0/+12
| | | | llvm-svn: 372620
* Revert "Extension: Mark the default constructor of chrono::duration as ↵Marshall Clow2019-09-231-47/+0
| | | | | | | | conditionally noexcept"; this breaks the gcc5 bot for C++11 This reverts commit c8ca15c95c4c0d6d1356500d5fe49a319ea4ca01. llvm-svn: 372546
* Extension: Mark the default constructor of chrono::duration as conditionally ↵Marshall Clow2019-09-231-0/+47
| | | | | | noexcept llvm-svn: 372539
* Revert "Revert "Implement std::condition_variable via ↵Dan Albert2019-09-181-11/+22
| | | | | | | | | | pthread_cond_clockwait() where available"" With the fix for non-Linux. This reverts commit c1c519d2f1a66dd2eeaa4c321d8d7b50f623eb71. llvm-svn: 372242
* Revert "Implement std::condition_variable via pthread_cond_clockwait() where ↵Dan Albert2019-09-161-22/+11
| | | | | | | | available" This reverts commit 5e37d7f9ff257ec62d733d3d94b11f03e0fe51ca. llvm-svn: 372034
* Implement std::condition_variable via pthread_cond_clockwait() where availableDan Albert2019-09-161-11/+22
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | std::condition_variable is currently implemented via pthread_cond_timedwait() on systems that use pthread. This is problematic, since that function waits by default on CLOCK_REALTIME and libc++ does not provide any mechanism to change from this default. Due to this, regardless of if condition_variable::wait_until() is called with a chrono::system_clock or chrono::steady_clock parameter, condition_variable::wait_until() will wait using CLOCK_REALTIME. This is not accurate to the C++ standard as calling condition_variable::wait_until() with a chrono::steady_clock parameter should use CLOCK_MONOTONIC. This is particularly problematic because CLOCK_REALTIME is a bad choice as it is subject to discontinuous time adjustments, that may cause condition_variable::wait_until() to immediately timeout or wait indefinitely. This change fixes this issue with a new POSIX function, pthread_cond_clockwait() proposed on http://austingroupbugs.net/view.php?id=1216. The new function is similar to pthread_cond_timedwait() with the addition of a clock parameter that allows it to wait using either CLOCK_REALTIME or CLOCK_MONOTONIC, thus allowing condition_variable::wait_until() to wait using CLOCK_REALTIME for chrono::system_clock and CLOCK_MONOTONIC for chrono::steady_clock. pthread_cond_clockwait() is implemented in glibc (2.30 and later) and Android's bionic (Android API version 30 and later). This change additionally makes wait_for() and wait_until() with clocks other than chrono::system_clock use CLOCK_MONOTONIC.<Paste> llvm-svn: 372016
* Add debug check for null pointers passed to <string_view>Eric Fiselier2019-09-141-0/+36
| | | | llvm-svn: 371925
* Mark [[nodiscard]] test as unsupported with GCC 5Eric Fiselier2019-09-131-0/+1
| | | | llvm-svn: 371886
* Fix pretty printer test with GCCEric Fiselier2019-09-131-3/+14
| | | | llvm-svn: 371884
* Fix various test failures with GCCEric Fiselier2019-09-132-3/+7
| | | | llvm-svn: 371880
* Fix failing negative compilation test for some versions of ClangEric Fiselier2019-09-131-0/+1
| | | | llvm-svn: 371874
* Recommit r370502: Make `vector` unconditionally move elements whenEric Fiselier2019-09-133-45/+102
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | exceptions are disabled. The patch was reverted due to some confusion about non-movable types. ie types that explicitly delete their move constructors. However, such types do not meet the requirement for `MoveConstructible`, which is required by `std::vector`: Summary: `std::vector<T>` is free choose between using copy or move operations when it needs to resize. The standard only candidates that the correct exception safety guarantees are provided. When exceptions are disabled these guarantees are trivially satisfied. Meaning vector is free to optimize it's implementation by moving instead of copying. This patch makes `std::vector` unconditionally move elements when exceptions are disabled. This optimization is conforming according to the current standard wording. There are concerns that moving in `-fno-noexceptions`mode will be a surprise to users. For example, a user may be surprised to find their code is slower with exceptions enabled than it is disabled. I'm sympathetic to this surprised, but I don't think it should block this optimization. Reviewers: mclow.lists, ldionne, rsmith Reviewed By: ldionne Subscribers: zoecarver, christof, dexonsmith, libcxx-commits Tags: #libc Differential Revision: https://reviews.llvm.org/D62228 llvm-svn: 371867
* Only initialize the streams cout/wcout/cerr/wcerr etc once, rather than any ↵Marshall Clow2019-09-131-0/+32
| | | | | | time Init::Init is called. Fixes PR#43300 llvm-svn: 371864
* Add gdb pretty printers for a wide variety of libc++ data structures (take 2).Sterling Augustine2019-09-052-0/+744
| | | | | | | | | | | | | | | | | Summary: This patch is an exact duplicate of https://reviews.llvm.org/D65609, except that it uses the newly introduced testing framework to detect if gdb is present so that the tests won't fail on machines without gdb. Reviewers: echristo, EricWF Subscribers: christof, ldionne, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D67238 llvm-svn: 371131
* [libcxx] Codesign test executables if necessaryVedant Kumar2019-09-052-1/+4
| | | | | | | | | If LLVM_CODESIGNING_IDENTITY is set, test executables need to be codesigned. Differential Revision: https://reviews.llvm.org/D66496 llvm-svn: 371126
* Add testing infrastructure to check if gdb is available for testing.Sterling Augustine2019-09-052-1/+9
| | | | | | | | | | | | Reviewers: echristo, EricWF Subscribers: mgorny, christof, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D67194 llvm-svn: 371120
* [libc++] Revert "Make `vector` unconditionally move elements when exceptions ↵Louis Dionne2019-09-051-57/+0
| | | | | | | | | | are disabled." This reverts r370502, which broke the use case of a copy-only T (with a deleted move constructor) when exceptions are disabled. Until we figure out the right behavior, I'm reverting the commit. llvm-svn: 371068
* [libc++] Add a test for resizing of a vector with copy-only elementsLouis Dionne2019-09-051-0/+45
| | | | | | See https://reviews.llvm.org/D62228#1658620 llvm-svn: 371067
* [libc++] Move __clamp_to_integral to <cmath>, and harden against min()/max() ↵Louis Dionne2019-09-041-0/+19
| | | | | | macros llvm-svn: 370900
* [libc++] Add `__truncating_cast` for safely casting float types to integersLouis Dionne2019-09-041-0/+90
| | | | | | | | | | | This is needed anytime we need to clamp an arbitrary floating point value to an integer type. Thanks to Eric Fiselier for the patch. Differential Revision: https://reviews.llvm.org/D66836 llvm-svn: 370891
* Revert "Add gdb pretty printers for a wide variety of libc++ data structures."Sterling Augustine2019-08-312-743/+0
| | | | | | This reverts commit d8c9f2f572fe06a34ccfc28ee9223b64d7d275d3. llvm-svn: 370553
* Add gdb pretty printers for a wide variety of libc++ data structures.Sterling Augustine2019-08-302-0/+743
| | | | | | | | | | | | | | | | | | | | Summary: Also add a test suite. Reviewers: EricWF Subscribers: christof, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D65609 Run a pep8 formatter. Run pep8 formatter. Convert to PEP8, address other comments from code review. llvm-svn: 370551
* Make `vector` unconditionally move elements when exceptions are disabled.Eric Fiselier2019-08-301-0/+57
| | | | | | | | | | | | | | | | | | | | | | | | Summary: `std::vector<T>` is free choose between using copy or move operations when it needs to resize. The standard only candidates that the correct exception safety guarantees are provided. When exceptions are disabled these guarantees are trivially satisfied. Meaning vector is free to optimize it's implementation by moving instead of copying. This patch makes `std::vector` unconditionally move elements when exceptions are disabled. This optimization is conforming according to the current standard wording. There are concerns that moving in `-fno-noexceptions`mode will be a surprise to users. For example, a user may be surprised to find their code is slower with exceptions enabled than it is disabled. I'm sympathetic to this surprised, but I don't think it should block this optimization. Reviewers: mclow.lists, ldionne, rsmith Reviewed By: ldionne Subscribers: zoecarver, christof, dexonsmith, libcxx-commits Tags: #libc Differential Revision: https://reviews.llvm.org/D62228 llvm-svn: 370502
* [libc++] Add yet another test for inverted character classesLouis Dionne2019-08-271-0/+3
| | | | | | | | This was reported as part of a bug report that ended up being a duplicate for r340609, but I'm adding the test case since it's ever so slightly different from what we had before. llvm-svn: 370109
* [libc++] Fix broken <random> testLouis Dionne2019-08-221-16/+23
| | | | | | | | | | | | In r369429, I hoisted a floating point computation to a variable in order to remove a warning. However, it turns out this doesn't play well with floating point arithmetic. This commit reverts r369429 and instead casts the result of the floating point computation to remove the warning. Whether hoisting the computaiton to a variable should give the same result can be investigated independently. llvm-svn: 369693
* [libc++] Mark lock_guard nodiscard test as unsupported in C++03Louis Dionne2019-08-221-0/+3
| | | | llvm-svn: 369672
* libcxx: Rename last two .hpp files in libcxx to .hNico Weber2019-08-2110-13/+13
| | | | | | Differential Revision: https://reviews.llvm.org/D66544 llvm-svn: 369597
* libcxx: Rename .hpp files in libcxx/test/support to .hNico Weber2019-08-21445-720/+720
| | | | | | | | | | | | | | | | | | | | | | | | | | LLVM uses .h as its extension for header files. Files renamed using: for f in libcxx/test/support/*.hpp; do git mv $f ${f%.hpp}.h; done References to the files updated using: for f in $(git diff master | grep 'rename from' | cut -f 3 -d ' '); do a=$(basename $f); echo $a; rg -l $a libcxx | xargs sed -i '' "s/$a/${a%.hpp}.h/"; done HPP include guards updated manually using: for f in $(git diff master | grep 'rename from' | cut -f 3 -d ' '); do echo ${f%.hpp}.h ; done | xargs mvim Differential Revision: https://reviews.llvm.org/D66104 llvm-svn: 369481
* Fix a couple of unguarded operator, calls in algorithm. Fixes PR#43063. ↵Marshall Clow2019-08-2012-0/+93
| | | | | | Updated all the heap tests to check this. llvm-svn: 369448
* [libc++] Fix std::abs testsZoe Carver2019-08-201-7/+14
| | | | | | | | | | On systems where sizeof(long) == sizeof(int) the current tests failed. This commit updates those tests to work on all systems. std::abs has specific long specializations which can be used instead. llvm-svn: 369437
* [libc++] Avoid implicit conversion warning in a <random> testLouis Dionne2019-08-201-23/+16
| | | | | | | | | | By stashing the computation of `E::max() - E::min()` in a variable, we avoid the warning introduced in r367497. Note that we use `auto` to avoid having to deduce the type of the computation, which is not a problem since Clang provides `auto` as an extension even in C++03 (and we disable warnings related to using C++11 extensions in the test suite). llvm-svn: 369429
* [libc++] Implement LWG 3199Louis Dionne2019-08-201-0/+12
| | | | | | | | | | | | | | | | Summary: The resolution of LWG 3199 makes sure that input-streaming into an empty bitset does not set the failbit on the input stream. Reviewers: mclow.lists, EricWF Subscribers: christof, jkorous, dexonsmith, libcxx-commits Tags: #libc Differential Revision: https://reviews.llvm.org/D65105 llvm-svn: 369422
* [libc++] Precise XFAIL for AppleClang 11Louis Dionne2019-08-201-1/+1
| | | | | | This test doesn't fail on all patch levels of AppleClang 11 llvm-svn: 369420
* [libc++] fix test for unsigned charZoe Carver2019-08-201-1/+7
| | | | | | | | | On some systems char is unsigned. If that is the case, we will now test signed char twice in std::abs. NFC. Fixes the build bots. llvm-svn: 369413
* [libc++] Disable <chrono> ""d and ""y literal tests on AppleClang 10.0.0Louis Dionne2019-08-202-0/+2
| | | | | | | | In r368882, I enabled those tests for all AppleClang's above version 9. However, it turns out that the feature is only supported starting with AppleClang 10.0.1, not AppleClang 10.0.0. This commit fixes that hole. llvm-svn: 369409
* [libc++] std::abs should not return doubleZoe Carver2019-08-202-0/+97
| | | | | | | | Implement LWG Issue 2735 by adding std::abs tests for several types and checking their return value. NFC. llvm-svn: 369394
* [libc++] Add XFAIL for is_base_of test on AppleClang 11Louis Dionne2019-08-191-2/+2
| | | | llvm-svn: 369280
OpenPOWER on IntegriCloud