summaryrefslogtreecommitdiffstats
path: root/libcxx/test/std
Commit message (Collapse)AuthorAgeFilesLines
...
* fix destroying delete test with older apple compilersEric Fiselier2019-05-242-0/+54
| | | | llvm-svn: 361593
* P0722R3: Implement library support for destroying deleteEric Fiselier2019-05-233-6/+71
| | | | | | | | | | | | | | | | | | Summary: This provides the `std::destroying_delete_t` declaration in C++2a and after. (Even when the compiler doesn't support the language feature). However, the feature test macro `__cpp_lib_destroying_delete` is only defined when we have both language support and C++2a. Reviewers: ldionne, ckennelly, serge-sans-paille, EricWF Reviewed By: EricWF Subscribers: dexonsmith, riccibruno, christof, jwakely, jdoerfert, mclow.lists, ldionne, libcxx-commits Differential Revision: https://reviews.llvm.org/D55840 llvm-svn: 361572
* [libcxx][tests] Fix order checking in unordered_multiset tests.Louis Dionne2019-05-235-120/+45
| | | | | | | | | | | | | | | | Some tests assume that iteration through an unordered multiset elements will return them in the same order as at the container creation. This assumption is not true since the container is unordered, so that no specific order of elements is ever guaranteed for such container. This patch introduces checks verifying that any iteration will return elements exactly from a set of valid values and without repetition, but in no particular order. Thanks to Andrey Maksimov for the patch. Differential Revision: https://reviews.llvm.org/D56500 llvm-svn: 361494
* [libcxx][test] Fix order checking in some more unordered_multimap testsLouis Dionne2019-05-2224-858/+643
| | | | | | | | | | | | | | | | Some tests assume that iteration through an unordered multimap elements will return them in the same order as at the container creation. This assumption is not true since the container is unordered, so that no specific order of elements is ever guaranteed for such container. This patch is a continuation of D54838 and introduces checks verifying that any iteration will return elements exactly from a set of valid values and without repetition, but in no particular order. Thanks to Andrey Maksimov for the patch. Differential Revision: https://reviews.llvm.org/D56498 llvm-svn: 361414
* Ensure that hash<basic_string> uses char_traits. Fixes PR#41876. Reviewed as ↵Marshall Clow2019-05-201-0/+66
| | | | | | https://reviews.llvm.org/D61954 llvm-svn: 361201
* Improve the test coverage for std::is_base_ofMarshall Clow2019-05-161-0/+15
| | | | llvm-svn: 360911
* [libc++] [test] Use std::nextafter() instead of std::nexttoward()Michal Gorny2019-05-141-2/+2
| | | | | | | | | | | | Use std::nextafter() instead of std::nexttoward() in midpoint tests. In the context of this test, this should not cause any difference. Since nexttowardl() is not implemented on NetBSD 8, the latter function combined with 'long double' type caused test failure. nextafterl() does not have this problem. Differential Revision: https://reviews.llvm.org/D61748 llvm-svn: 360673
* Add a test for LWG#3204 and mark it as complete. Reviewed as ↵Marshall Clow2019-05-131-0/+33
| | | | | | https://reviews.llvm.org/D61829 Thanks to Zoe for the patch. llvm-svn: 360586
* Mark is_trivially_destructible as unsupported with apple-clang-9Nico Weber2019-05-031-0/+1
| | | | | | See discussion on https://reviews.llvm.org/D48292 llvm-svn: 359907
* [libc++][test] Remove non-portable assumption that thread's constructor ↵Casey Carter2019-05-021-10/+19
| | | | | | | | | | | | | allocates with ::new Drive-by: * Fix potential race between check and update of `throw_one` in `operator new` * Fix latent bug in `operator delete`, which shouldn't decrement `outstanding_new` when passed a null pointer * Specifically catch the expected `bad_alloc` in `main` instead of `...` Differential Revision: https://reviews.llvm.org/D50860 llvm-svn: 359827
* Add missing locale requirement to test.Dan Albert2019-05-011-0/+1
| | | | | | | | Linux is failing even though the test runner does report this locale is available, but the test still isn't expected to work on platforms without the locale (like Android). llvm-svn: 359726
* Get rid of a bunch of 'unused variable' warnings in test when run with ↵Marshall Clow2019-05-015-4/+8
| | | | | | debug_level set. NFC llvm-svn: 359672
* Fix a bunch of unordered container tests that were failing when ↵Marshall Clow2019-05-0118-46/+41
| | | | | | _LIBCPP_DEBUG was set. llvm-svn: 359642
* Support overaligned types in `aligned_storage`.Eric Fiselier2019-04-301-0/+8
| | | | | | | | | | | | | | | | | Summary: The current implementation of aligned storage was written before we had `alignas`, so it used a list of builtin types to force the alignment. But this doesn't work overaligned requests. This patch adds a fallback case supporting over-alignment. It only affects case that were previously ill-formed. Reviewers: rsmith, ldionne, dlj, mclow.lists Reviewed By: mclow.lists Subscribers: mclow.lists, dexonsmith, libcxx-commits Differential Revision: https://reviews.llvm.org/D61301 llvm-svn: 359596
* Implement LWG 2960: nonesuch is insufficiently uselessMarshall Clow2019-04-302-0/+61
| | | | llvm-svn: 359526
* Add tests specifically for LWG2164. We already did this; but now we have ↵Marshall Clow2019-04-292-0/+23
| | | | | | tests. NFC llvm-svn: 359458
* Add '_LIBCPP_ASSERT(ready())' to several match_results method that have this ↵Marshall Clow2019-04-267-7/+7
| | | | | | precondtion. Fix several tests which did not honor this precondition. Thanks to Andrey Maksimov for pointing this out. llvm-svn: 359324
* [libc++] Relax libc++-only test on regex_constantsLouis Dionne2019-04-261-13/+13
| | | | | | | | | | | | | | The standard requires the following for the std::regex_constants::error_type values: "The type error_type is an implementation-defined enumerated type." The values of this enumerated type are not required to be non-zero. This patch makes such checks in tests libc++-specific to let the tests pass for other conforming implementations. Thanks to Andrey Maksimov for the patch. Differential Revision: https://reviews.llvm.org/D61195 llvm-svn: 359320
* add tuple_cat test for const TEric Fiselier2019-04-261-6/+6
| | | | llvm-svn: 359256
* Fix return type of std::tuple_cat.Eric Fiselier2019-04-261-0/+15
| | | | | | | | | | | | When the arguments to tuple cat were const, the const was incorrectly propagated into the type of the resulting tuple. For example: const std::tuple<int> t(42); auto r = std::tuple_cat(t, t); // Incorrect! should be std::tuple<int, int>. static_assert(is_same_v<decltype(r), std::tuple<const int, const int>>); llvm-svn: 359255
* [libc++][test] Fix noexcept assertions in variant's get testsCasey Carter2019-04-252-6/+14
| | | | | | | | | | All constant expressions are non-potentially-throwing in C++14, but that is *not* the case in C++17. Change these tests of the `variant`-flavored overloads of `std::get` to expect the correct behavior when the compiler is not GCC or is GCC 9+. Credit to Jonathan Wakely for providing an improved version of my initial change that validates the incorrect behavior on GCC < 9 as well as validating the correct behavior on other compilers. Differential Revision: https://reviews.llvm.org/D61033 llvm-svn: 359220
* Implement 'lerp'; which is the last bit of P0811. Mark that paper as complete.Marshall Clow2019-04-251-0/+75
| | | | llvm-svn: 359211
* Implement midpoint for floating point types. Reviewed as ↵Marshall Clow2019-04-253-0/+153
| | | | | | https://reviews.llvm.org/D61014. llvm-svn: 359184
* Update test to better check for the non-constexpr-ness of a move ↵Marshall Clow2019-04-251-5/+20
| | | | | | constructor. Fixes PR#41577. llvm-svn: 359162
* Use modern type trait implementations when available.Richard Smith2019-04-251-0/+6
| | | | | | | | | | | | | | Teach libcxx to stop using various deprecated __has_* type traits, in favor of the ("modern", C++11 era) __is_* type traits. This is mostly just a simplification, but fixes at least one bug: _Atomic T should be considered trivially-destructible, but is not considered to be POD by Clang, and __has_trivial_destructor is specified in the GCC documentation as returning false for non-POD non-class types. Differential Revision: https://reviews.llvm.org/D48292 llvm-svn: 359159
* Add std::is_constant_evaluated.Eric Fiselier2019-04-244-6/+85
| | | | | | | | | Clang recently added __builtin_is_constant_evaluated() and GCC 9.0 has it as well. This patch adds support for it in libc++. llvm-svn: 359119
* Make the test object callable. libstdc++'s bind checks that (libc++ ↵Marshall Clow2019-04-241-1/+1
| | | | | | currently does not). Thanks to Jonathan Wakely for the fix. llvm-svn: 359108
* Fix a one more compare test that assumed -1/0/1 instsad of <0/0/>0. NFC.Marshall Clow2019-04-241-1/+1
| | | | llvm-svn: 359106
* Fix a couple of tests that assumed that compare retunred -1/0/1 instead of ↵Marshall Clow2019-04-244-7/+7
| | | | | | <0/0/>0. Thanks to Jonathan Wakely for the report. llvm-svn: 359104
* Add an any_cast test for array types. Thanks to Jonathan Wakely for the ↵Marshall Clow2019-04-242-8/+25
| | | | | | suggestion. llvm-svn: 359085
* Fix namespace name conflict with GCCEric Fiselier2019-04-236-55/+55
| | | | llvm-svn: 359023
* Fix implementation of ::abs and std::abs LWG 2192.Eric Fiselier2019-04-234-14/+182
| | | | | | | | | | | | | | | | | | | Summary: All overloads of `::abs` and `std::abs` must be present in both `<cmath>` and `<cstdlib>`. This is problematic to implement because C defines `fabs` in `math.h` and `labs` in `stdlib.h`. This introduces a circular dependency between the two headers. This patch implements that requirement by moving `abs` into `math.h` and making `stdlib.h` include `math.h`. In order to get the underlying C declarations from the "real" `stdlib.h` inside our `math.h` we need some trickery. Specifically we need to make `stdlib.h` include next itself. Suggestions for a cleaner implementation are welcome. Reviewers: mclow.lists, ldionne Reviewed By: ldionne Subscribers: krytarowski, fedor.sergeev, dexonsmith, jdoerfert, jsji, libcxx-commits Differential Revision: https://reviews.llvm.org/D60097 llvm-svn: 359020
* [libc++][test] Update some wstring_convert tests for MSVC quirksCasey Carter2019-04-223-20/+23
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Due to MSVC's decision to encode `wchar_t` as UTF-16, it rejects wide character/string literals that expect a character value greater than `\xffff`. UTF-16 `wchar_t` is clearly non-conforming, given that the standard requires wchar_t to be capable of representing all characters in the supported wide character execution sets, but rejecting e.g. `\x40003` is a reasonably sane compromise given that encoding choice: there's an expectation that `\xFOO` produces a single character in the resulting literal. Consequently `L'\x40003'`/`L"\x40003"` are ill-formed literals on MSVC. `L'\U00040003'` is a high surrogate (and produces a warning about ignoring the "second character" in a multi-character literal), and `L"\U00040003"` is a perfectly-valid `const wchar_t[3]`. This change updates these tests to use universal-character-names instead of raw values for the intended character values, which technically makes them portable even to implementations that don't use a unicode transformation format encoding for their wide character execution character set. The two-character literal `L"\u1005e"` is awkward - the `e` looks like part of the UCN's hex encoding - but necessary to compile in '03 mode since '03 didn't allow UCNs to be used for members of the basic execution character set even in character/string literals. I've also eliminated the extraneous `\x00` "bonus null-terminator" in some of the string literals which doesn't affect the tested behavior. I'm sorry about using `*L"\U00040003"` in `conversions.string/to_bytes.pass.cpp`, but it's correct for platforms with 32-bit wchar_t, *and* doesn't trigger narrowing warnings as did the prior `CharT(0x40003)`. Differential Revision: https://reviews.llvm.org/D60950 llvm-svn: 358908
* [libc++] [test] Add missing required headers to midpoint.integer.pass.cppBilly Robert O'Neal III2019-04-181-0/+2
| | | | | | This change authored by Paolo Torres <t-pator@microsoft.com> llvm-svn: 358698
* Add tests for stability to list::sort and forward_list::sort. Thanks to ↵Marshall Clow2019-04-174-0/+184
| | | | | | Jonathan Wakely for the notice llvm-svn: 358541
* Fix list/forward_list implementations of remove_if and unique to deal with ↵Marshall Clow2019-04-164-0/+94
| | | | | | predicates that are part of the sequence passed in. We already do this for remove. llvm-svn: 358534
* [libc++] Add XFAILs for istream tests that were added in r357775Louis Dionne2019-04-0521-0/+143
| | | | | | | | We fixed incorrect behavior of input streams in r357775 and tests were added accordingly. However, older versions of macOS don't have the change in the dylib yet, so the tests fail on those platforms. llvm-svn: 357794
* [libc++] Fix error flags and exceptions propagated from input stream operationsLouis Dionne2019-04-0540-159/+1962
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: This is a re-application of r357533 and r357531. They had been reverted because we thought the commits broke the LLDB data formatters, but it turns out this was because only r357531 had been included in the CI run. Before this patch, we would only ever throw an exception if the badbit was set on the stream. The Standard is currently very unclear on how exceptions should be propagated and what error flags should be set by the input stream operations. This commit changes libc++ to behave under a different (but valid) interpretation of the Standard. This interpretation of the Standard matches what other implementations are doing. This effectively implements the wording in p1264r0. It hasn't been voted into the Standard yet, however there is wide agreement that the fix is correct and it's just a matter of time before the fix is standardized. PR21586 PR15949 rdar://problem/15347558 Reviewers: mclow.lists, EricWF Subscribers: christof, dexonsmith, cfe-commits Differential Revision: https://reviews.llvm.org/D49863 llvm-svn: 357775
* [libc++] Use std::is_nothrow_callable for std::invoke according to LWG 2807Louis Dionne2019-04-031-2/+3
| | | | | | | Thanks to Zoe Carver for the patch. Differential Revision: https://reviews.llvm.org/D58097 llvm-svn: 357616
* [libc++][NFC] Rename test file according to the libc++ conventionLouis Dionne2019-04-031-0/+0
| | | | llvm-svn: 357588
* [libcxx] [test] Add missing <stdexcept> to name std::out_of_range to ↵Billy Robert O'Neal III2019-04-031-2/+3
| | | | | | string.conversions\stold.pass.cpp. llvm-svn: 357547
* [libcxx] [test] Use ptrdiff_t rather than int in splice_after_range.pass.cpp ↵Billy Robert O'Neal III2019-04-031-23/+24
| | | | | | | | to avoid narrowing from pointer subtraction to int warnings. Reviewed as https://reviews.llvm.org/D60104 llvm-svn: 357546
* [libcxx] [test] Fix test bugs in string.cons/copy_alloc.pass.cpp.Billy Robert O'Neal III2019-04-031-6/+7
| | | | | | | | | | | | | | Fixed the inability to properly rebind the testing allocator, by making the inner alloc_impl type a plain struct and making the operations templates. Before rebind failed to compile complaining that a alloc_impl<T>* was not convertible to an alloc_impl<U>*. This enables the test to pass for MSVC++ once we provide the strong guarantee for the copy assignment operator. Reviewed as https://reviews.llvm.org/D60023 llvm-svn: 357545
* Revert "[libc++] Fix error flags and exceptions propagated from input stream ↵Louis Dionne2019-04-0240-1962/+159
| | | | | | | | | | operations" This reverts commits r357533 and r357531, which broke the LLDB data formatters. I'll hold off until we know how to fix the data formatters accordingly. llvm-svn: 357536
* [libc++] Fix error flags and exceptions propagated from input stream operationsLouis Dionne2019-04-0240-159/+1962
| | | | | | | | | | | | | | | | | | | | | | | | | | Summary: Before this patch, we would only ever throw an exception if the badbit was set on the stream. The Standard is currently very unclear on how exceptions should be propagated and what error flags should be set by the input stream operations. This commit changes libc++ to behave under a different (but valid) interpretation of the Standard. This interpretation of the Standard matches what other implementations are doing. I will submit a paper in San Diego to clarify the Standard such that the interpretation used in this commit (and other implementations) is the only possible one. PR21586 PR15949 rdar://problem/15347558 Reviewers: mclow.lists, EricWF Subscribers: christof, dexonsmith, cfe-commits Differential Revision: https://reviews.llvm.org/D49863 llvm-svn: 357531
* Fix a number of bugs in __val_expr's subset operator[].Eric Fiselier2019-04-028-218/+340
| | | | | | | | The current definitions were entirely broken. They didn't call any existing constructor and the forgot to friend the expression types they were trying to construct. llvm-svn: 357453
* [libcxx] Make sure reference_wrapper works with incomplete typesLouis Dionne2019-04-014-0/+162
| | | | | | | | | | | | Summary: Completes P0357R3, which was merged into the C++20 Working Draft in San Diego. Reviewers: EricWF, mclow.lists Subscribers: christof, jkorous, dexonsmith, libcxx-commits Differential Revision: https://reviews.llvm.org/D54722 llvm-svn: 357423
* [libc++] Declare std::tuple_element as struct instead of classLouis Dionne2019-04-014-8/+4
| | | | | | | | | | | | Similarly to https://reviews.llvm.org/rL350972, this revision changes std::tuple_element from class to struct. Fixes PR41331. Thanks to Jan Wilken Dörrie for the patch. Differential Revision: https://reviews.llvm.org/D60069 llvm-svn: 357411
* Fix PR41130 - 'operator/ of std::chrono::duration and custom type'. Thanks ↵Marshall Clow2019-04-018-2/+127
| | | | | | to Zulan for the report, and Howard for the direction of the fix. llvm-svn: 357410
* Make common_type's implementation common Eric Fiselier2019-03-311-77/+98
| | | | | | | | | | | | | | | | | | | Summary: Currently the C++03 implementation of common_type has much different behavior than the C++11 one. This causes bugs, including inside `<chrono>`. This patch unifies the two implementations as best it can. The more code they share, the less their behavior can diverge. Reviewers: mclow.lists, ldionne, sbenza Reviewed By: mclow.lists, ldionne Subscribers: libcxx-commits Tags: #libc Differential Revision: https://reviews.llvm.org/D59678 llvm-svn: 357370
OpenPOWER on IntegriCloud