summaryrefslogtreecommitdiffstats
path: root/libcxx/test
Commit message (Collapse)AuthorAgeFilesLines
...
* [libcxx][test] Include test_workarounds.h where neededLouis Dionne2019-06-052-0/+2
| | | | | | | | | | | Some tests require `TEST_WORKAROUND_CONSTEXPR_IMPLIES_NOEXCEPT`, but they did not include the header that defines that macro. Thanks to Michael Park for the patch. Differential Revision: https://reviews.llvm.org/D62920 llvm-svn: 362660
* [libcxx] Add test to check min/max requirement to regular expressionLouis Dionne2019-06-041-0/+67
| | | | | | | | | | | This commit adds tests that repeated characters in regular expressions are within numeric limits, and that a <= b in a regex like `x{a,b}`. Thanks to Andrey Maksimov for the patch. Differential Revision: https://reviews.llvm.org/D62816 llvm-svn: 362525
* No longer reject inputs when using a locale that has grouping information ↵Marshall Clow2019-06-041-2/+2
| | | | | | _and_ the input has no grouping characters at all. We continue to reject cases when the input has grouping characters in the wrong place. Fixes PR#28704 llvm-svn: 362508
* Add include for 'test_macros.h' to all the tests that were missing them. ↵Marshall Clow2019-05-313295-0/+5607
| | | | | | Thanks to Zoe for the (big, but simple) patch. NFC intended. llvm-svn: 362252
* [libcxx] Add regex test cases from PR40904Louis Dionne2019-05-301-1/+11
| | | | llvm-svn: 362115
* Add additional constraints on midpoint(pointer, pointer). Fixes PR#42037.Marshall Clow2019-05-291-3/+12
| | | | llvm-svn: 361970
* Fix test that used raw string literals. Doesn't work in C++03Marshall Clow2019-05-281-2/+2
| | | | llvm-svn: 361894
* Fix an incorrect 'Throws' in the regex code. Add a test for the new ↵Marshall Clow2019-05-281-0/+38
| | | | | | behavior. Reviewed as https://reviews.llvm.org/D61828. Thanks to Mark for the catch and the fix. llvm-svn: 361887
* fix test for older clang versionsEric Fiselier2019-05-241-0/+1
| | | | llvm-svn: 361594
* 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
* Remove `using namespace std;` in __gnu_cxx namespace.Eric Fiselier2019-05-172-1/+13
| | | | | | | | The `using namespace std;` opens us up to ambiguity when any of the std:: names are also present in the global namespace. Instead we should properly qualify names we use from std::. llvm-svn: 361074
* 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
* [libcxx] teach type_traits test about long uint32_tBrian Cain2019-05-131-1/+8
| | | | | | Patch by Ben Craig. llvm-svn: 360590
* 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
* force the bots to cycleEric Fiselier2019-05-091-1/+0
| | | | llvm-svn: 360306
* 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
* [WebAssembly] WASI support for libcxxDan Gohman2019-05-011-1/+1
| | | | | | | | | | | | | This adds explicit support for the WASI platform to libcxx. WASI libc uses some components from musl, however it's not fully compatible with musl, so we're planning to stop using _LIBCPP_HAS_MUSL_LIBC and customize for WASI libc specifically. Differential Revision: https://reviews.llvm.org/D61336 Reviewers: sbc100, ldionne llvm-svn: 359703
* 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-253-6/+20
| | | | | | | | | | 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-254-0/+199
| | | | | | 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
* Avoid name conflict with kernel headersEric Fiselier2019-04-241-0/+3
| | | | llvm-svn: 359080
* 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] Silence C++20 deprecation warnings in the MSVC STLCasey Carter2019-04-191-1/+2
| | | | | | ... when including msvc_stdlib_force_include.hpp. llvm-svn: 358782
* [libc++] Make __debug_less::operator() constexprThomas Anderson2019-04-191-0/+13
| | | | | | | | | | | | | | This is a followup to [1] which added a new `__debug_less::operator()` overload. [2] added `_LIBCPP_CONSTEXPR_AFTER_CXX17` to the original `__debug_less::operator()` between the time of writing [1] and landing it. This change adds `_LIBCPP_CONSTEXPR_AFTER_CXX17` to the new overload too. [1] https://reviews.llvm.org/rL358423 [2] https://reviews.llvm.org/rL358252 Differential Revision: https://reviews.llvm.org/D60724 llvm-svn: 358725
* [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
OpenPOWER on IntegriCloud