summaryrefslogtreecommitdiff
path: root/test
AgeCommit message (Collapse)Author
2018-02-15Merging r325147:llvm_60-amp-20180630release_60-f1b37feef3d-amp-20180630Hans Wennborg
------------------------------------------------------------------------ r325147 | marshall | 2018-02-14 19:05:25 +0100 (Wed, 14 Feb 2018) | 3 lines Add a catch for std::length_error for the case where the string can't handle 2GB. (like say 32-bit big-endian) ------------------------------------------------------------------------ git-svn-id: https://llvm.org/svn/llvm-project/libcxx/branches/release_60@325219 91177308-0d34-0410-b5e6-96231b3b80d8
2018-02-06Merging r324153:Hans Wennborg
------------------------------------------------------------------------ r324153 | ericwf | 2018-02-02 23:39:59 +0100 (Fri, 02 Feb 2018) | 6 lines Fix has_unique_object_representation after Clang commit r324134. Clang previously reported an empty union as having a unique object representation. This was incorrect and was fixed in a recent Clang commit. This patch fixes the libc++ tests. ------------------------------------------------------------------------ git-svn-id: https://llvm.org/svn/llvm-project/libcxx/branches/release_60@324345 91177308-0d34-0410-b5e6-96231b3b80d8
2018-01-17Merging r321963:Hans Wennborg
------------------------------------------------------------------------ r321963 | dim | 2018-01-07 08:45:11 -0800 (Sun, 07 Jan 2018) | 51 lines Add pre-C++11 is_constructible wrappers for 3 arguments Summary: After rL319736 for D28253 (which fixes PR28929), gcc cannot compile `<memory>` anymore in pre-C+11 modes, complaining: ``` In file included from /usr/include/c++/v1/memory:648:0, from test.cpp:1: /usr/include/c++/v1/memory: In static member function 'static std::__1::shared_ptr<_Tp> std::__1::shared_ptr<_Tp>::make_shared(_A0&, _A1&, _A2&)': /usr/include/c++/v1/memory:4365:5: error: wrong number of template arguments (4, should be at least 1) static_assert((is_constructible<_Tp, _A0, _A1, _A2>::value), "Can't construct object in make_shared" ); ^ In file included from /usr/include/c++/v1/memory:649:0, from test.cpp:1: /usr/include/c++/v1/type_traits:3198:29: note: provided for 'template<class _Tp, class _A0, class _A1> struct std::__1::is_constructible' struct _LIBCPP_TEMPLATE_VIS is_constructible ^~~~~~~~~~~~~~~~ In file included from /usr/include/c++/v1/memory:648:0, from test.cpp:1: /usr/include/c++/v1/memory:4365:5: error: template argument 1 is invalid static_assert((is_constructible<_Tp, _A0, _A1, _A2>::value), "Can't construct object in make_shared" ); ^ /usr/include/c++/v1/memory: In static member function 'static std::__1::shared_ptr<_Tp> std::__1::shared_ptr<_Tp>::allocate_shared(const _Alloc&, _A0&, _A1&, _A2&)': /usr/include/c++/v1/memory:4444:5: error: wrong number of template arguments (4, should be at least 1) static_assert((is_constructible<_Tp, _A0, _A1, _A2>::value), "Can't construct object in allocate_shared" ); ^ In file included from /usr/include/c++/v1/memory:649:0, from test.cpp:1: /usr/include/c++/v1/type_traits:3198:29: note: provided for 'template<class _Tp, class _A0, class _A1> struct std::__1::is_constructible' struct _LIBCPP_TEMPLATE_VIS is_constructible ^~~~~~~~~~~~~~~~ In file included from /usr/include/c++/v1/memory:648:0, from test.cpp:1: /usr/include/c++/v1/memory:4444:5: error: template argument 1 is invalid static_assert((is_constructible<_Tp, _A0, _A1, _A2>::value), "Can't construct object in allocate_shared" ); ^ ``` This is also reported in https://bugs.freebsd.org/224946 (FreeBSD is apparently one of the very few projects that regularly builds programs against libc++ with gcc). The reason is that the static assertions are invoking `is_constructible` with three arguments, while gcc does not have the built-in `is_constructible` feature, and the pre-C++11 `is_constructible` wrappers in `<type_traits>` only provide up to two arguments. I have added additional wrappers for three arguments, modified the `is_constructible` entry point to take three arguments instead, and added a simple test to is_constructible.pass.cpp. Reviewers: EricWF, mclow.lists Reviewed By: EricWF Subscribers: krytarowski, cfe-commits, emaste Differential Revision: https://reviews.llvm.org/D41805 ------------------------------------------------------------------------ git-svn-id: https://llvm.org/svn/llvm-project/libcxx/branches/release_60@322659 91177308-0d34-0410-b5e6-96231b3b80d8
2018-01-03Mark LWG2824 as complete. We already did it, but I added a test to be sureMarshall Clow
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@321689 91177308-0d34-0410-b5e6-96231b3b80d8
2018-01-03Implement p0258r2: has_unique_object_representationsMarshall Clow
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@321685 91177308-0d34-0410-b5e6-96231b3b80d8
2017-12-20Fix the definitions of 'reference' and 'pointer' in string_view that no one ↵Marshall Clow
uses :-). Thanks to K-ballo for the catch. git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@321188 91177308-0d34-0410-b5e6-96231b3b80d8
2017-12-19libcxx: Fix for basic_stringbuf::seekoff() after r320604.Peter Collingbourne
As a result of this change, the basic_stringbuf constructor that takes a mode ends up leaving __hm_ set to 0, causing the comparison "__hm_ - __str_.data() < __noff" in seekoff() to succeed, which caused the function to incorrectly return -1. The fix is to account for the possibility of __hm_ being 0 when computing the distance from __hm_ to the start of the string. Differential Revision: https://reviews.llvm.org/D41319 git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@321124 91177308-0d34-0410-b5e6-96231b3b80d8
2017-12-13[libcxx] Fix basic_stringbuf constructorZhihao Yuan
Summary: [libcxx] Fix basic_stringbuf constructor The C++ Standard [stringbuf.cons]p1 defines the effects of the basic_stringbuf constructor that takes ios_base::openmode as follows: Effects: Constructs an object of class basic_stringbuf, initializing the base class with basic_streambuf(), and initializing mode with which. Postconditions: str() == "". The default constructor of basic_streambuf shall initialize all its pointer member objects to null pointers [streambuf.cons]p1. Currently libc++ calls "str(string_type());" in the aforementioned constructor setting basic_streambuf's pointers to a non-null value. This patch removes the call (note that the postcondition str() == "" remains valid because __str_ is default-initialized) and adds a test checking that the basic_streambuf's pointers are null after construction. Thanks Mikhail Maltsev for the patch. Reviewers: EricWF, mclow.lists Reviewed By: mclow.lists Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D40707 git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@320604 91177308-0d34-0410-b5e6-96231b3b80d8
2017-12-13[libcxx] [test] Fix line endings, avoid unnecessary non-ASCII.Stephan T. Lavavej
benchmarks/util_smartptr.bench.cpp Change CRLF to LF. test/std/localization/locale.categories/category.monetary/locale.money.get/locale.money.get.members/get_long_double_fr_FR.pass.cpp Consistently comment "\u20ac" as EURO SIGN, its Unicode name, instead of the actual Unicode character. test/std/utilities/allocator.adaptor/allocator.adaptor.members/construct_type.pass.cpp Avoid non-ASCII dash. Fixes D40991. git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@320536 91177308-0d34-0410-b5e6-96231b3b80d8
2017-12-13[libcxx] [test] Fix MSVC warnings, null pointer deref.Stephan T. Lavavej
test/std/algorithms/alg.modifying.operations/alg.generate/generate_n.pass.cpp Silence MSVC warning C4244. This is expected when passing floating-point values for size. test/std/utilities/template.bitset/bitset.members/to_ullong.pass.cpp test/std/utilities/template.bitset/bitset.members/to_ulong.pass.cpp Avoid MSVC "warning C4293: '<<': shift count negative or too big, undefined behavior". MSVC sees (1ULL << N) and warns - being guarded by const bool canFit is insufficient. A small change to the code avoids the warning without the need for a pragma. Remove a spurious printf() declaration from to_ullong.pass.cpp. Change ULL to UL in to_ulong.pass.cpp. The ULL suffix was probably copy-pasted. test/std/utilities/tuple/tuple.general/ignore.pass.cpp Use LIBCPP_STATIC_ASSERT for consistency with other files. test/support/container_test_types.h Fix a null pointer dereference, found by MSVC /analyze warning C6011 "Dereferencing NULL pointer 'm_expected_args'." Fixes D41030. git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@320535 91177308-0d34-0410-b5e6-96231b3b80d8
2017-12-12[libcxx] P0604, invoke_result and is_invocableZhihao Yuan
Summary: Introduce a new form of `result_of` without function type encoding. Rename and split `is_callable/is_nothrow_callable` into `is_invocable/is_nothrow_invocable/is_invocable_r/is_nothrow_invocable_r` (and associated types accordingly) Change function type encoding of previous `is_callable/is_nothrow_callable` traits to conventional template type parameter lists. Reviewers: EricWF, mclow.lists, bebuch Reviewed By: EricWF, bebuch Subscribers: lichray, bebuch, cfe-commits Differential Revision: https://reviews.llvm.org/D38831 git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@320509 91177308-0d34-0410-b5e6-96231b3b80d8
2017-12-11[libcxx] Define istream_iterator equality comparison operators out-of-lineRoger Ferrer Ibanez
Currently libc++ defines operator== and operator!= as friend functions in the definition of the istream_iterator class template. Such definition has a subtle difference from an out-of-line definition required by the C++ Standard: these functions can only be found by argument-dependent lookup, but not by qualified lookup. This patch changes the definition, so that it conforms to the C++ Standard and adds a check involving qualified lookup to the test suite. Patch contributed by Mikhail Maltsev. Differential Revision: https://reviews.llvm.org/D40415 git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@320363 91177308-0d34-0410-b5e6-96231b3b80d8
2017-12-07[libcxx] [test] Strip trailing whitespace. NFC.Stephan T. Lavavej
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@319994 91177308-0d34-0410-b5e6-96231b3b80d8
2017-12-05Land D28253 which fixes PR28929 (which we mistakenly marked as fixed before)Marshall Clow
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@319736 91177308-0d34-0410-b5e6-96231b3b80d8
2017-12-04Commit tests for changes in revision 319710Marshall Clow
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@319711 91177308-0d34-0410-b5e6-96231b3b80d8
2017-12-04Ooops. I checked in a test for a bug I haven't fixed yet. Temporrarily ↵Marshall Clow
commented it out. git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@319693 91177308-0d34-0410-b5e6-96231b3b80d8
2017-12-04Implement P0457R2: 'String Prefix and Suffix Checking' for c++2aMarshall Clow
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@319687 91177308-0d34-0410-b5e6-96231b3b80d8
2017-12-04Fix PR#35948: generate_n does not accept floating point Size arguments.Marshall Clow
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@319675 91177308-0d34-0410-b5e6-96231b3b80d8
2017-12-01Include AddLLVM needed for tests in the right contextPetr Hosek
AddLLVM is needed for several functions that are used in tests and as such needs to be included from the right context which previously wasn't the case. Differential Revision: https://reviews.llvm.org/D40280 git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@319515 91177308-0d34-0410-b5e6-96231b3b80d8
2017-11-27Fix problems with r'890 when building on machines where sizeof(size_t) != ↵Marshall Clow
sizeof(unsigned long long) and C++03 git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@319106 91177308-0d34-0410-b5e6-96231b3b80d8
2017-11-27Revert commit removing allocator support from packaged_task. Will ↵Marshall Clow
investigate further git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@319091 91177308-0d34-0410-b5e6-96231b3b80d8
2017-11-27Implement LWG#2921 and LWG#2976 - removing allocator support from packaged_task.Marshall Clow
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@319080 91177308-0d34-0410-b5e6-96231b3b80d8
2017-11-27Fix PR#35438 - bitset constructor does not zero unused bitsMarshall Clow
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@319074 91177308-0d34-0410-b5e6-96231b3b80d8
2017-11-27Fix failure on C++03 botsMarshall Clow
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@319042 91177308-0d34-0410-b5e6-96231b3b80d8
2017-11-27Implement LWG#2948: unique_ptr does not define operator<< for stream outputMarshall Clow
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@319038 91177308-0d34-0410-b5e6-96231b3b80d8
2017-11-26More of P0600; marking allocation routines as [[nodiscard]]Marshall Clow
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@318992 91177308-0d34-0410-b5e6-96231b3b80d8
2017-11-26Fix copy/paste bug in test where we were putting a '3' into a vector<bool>. NFC.Marshall Clow
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@318990 91177308-0d34-0410-b5e6-96231b3b80d8
2017-11-23Add additional 'UNSUPPORTED' to the test case.Marshall Clow
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@318897 91177308-0d34-0410-b5e6-96231b3b80d8
2017-11-23Add [[nodiscard]] to std::async as part of P0600.Marshall Clow
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@318889 91177308-0d34-0410-b5e6-96231b3b80d8
2017-11-22[libcxx] Implement std::to_address for C++20Eric Fiselier
Summary: Now implements P0653R2 - Utility to convert to raw pointer. Reviewers: mclow.lists, EricWF Reviewed By: EricWF Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D35470 git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@318865 91177308-0d34-0410-b5e6-96231b3b80d8
2017-11-22Implement p0137r1 - std::launder. Reviewed as https://reviews.llvm.org/D40144Marshall Clow
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@318864 91177308-0d34-0410-b5e6-96231b3b80d8
2017-11-22[libcxx][fixup] Mark std::basic_istream::getline tests as failing for ↵Volodymyr Sapsai
previous libcxx versions. r318862 added a fix for 0-termination input array in case of an error. Previous libcxx versions don't have the fix and corresponding tests should be failing. git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@318863 91177308-0d34-0410-b5e6-96231b3b80d8
2017-11-22[libcxx] Make std::basic_istream::getline 0-terminate input array in case of ↵Volodymyr Sapsai
error. It covers the cases when the sentry object returns false and when an exception was thrown. Corresponding standard paragraph is C++14 [istream.unformatted]p21: In any case, if n is greater than zero, it then stores a null character (using charT()) into the next successive location of the array. Patch by Reimar Döffinger. git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@318862 91177308-0d34-0410-b5e6-96231b3b80d8
2017-11-22Add another test_macros.h include I missed to tuple.by.type.pass.cppBilly Robert O'Neal III
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@318830 91177308-0d34-0410-b5e6-96231b3b80d8
2017-11-22Add some tests for operations on const associative containers. Part of LWG#2542Marshall Clow
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@318818 91177308-0d34-0410-b5e6-96231b3b80d8
2017-11-21Replace assert(true) in tests with actual asserts. Reviewed as ↵Billy Robert O'Neal III
https://reviews.llvm.org/D40324 In a17cd7c641c34b6c4bd4845a4d4fb590cb6c238c Marshall added assert(true) to the vector<bool>::size tests, which break on C1XX: D:\Contest\gl0qojfu.5pe\src\qa\vc\libs\libcxx\upstream\test\std\containers\sequences\vector.bool\size.pass.cpp(62): error C2220: warning treated as error - no 'object' file generated d:\contest\gl0qojfu.5pe\src\qa\vc\libs\libcxx\upstream\test\std\containers\sequences\vector.bool\size.pass.cpp(33) : warning C6326: Potential comparison of a constant with another constant. d:\contest\gl0qojfu.5pe\src\qa\vc\libs\libcxx\upstream\test\std\containers\sequences\vector.bool\size.pass.cpp(52) : warning C6326: Potential comparison of a constant with another constant. The corresponding test for vector::size asserts assert(c.size() == 3);, so I changed it to do that here. git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@318812 91177308-0d34-0410-b5e6-96231b3b80d8
2017-11-21Add missing test_macros.h inclusion.Billy Robert O'Neal III
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@318808 91177308-0d34-0410-b5e6-96231b3b80d8
2017-11-21Change (void) casts to TEST_IGNORE_NODISCARD, as requested by Eric. Reviewed ↵Billy Robert O'Neal III
as https://reviews.llvm.org/D40065 git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@318804 91177308-0d34-0410-b5e6-96231b3b80d8
2017-11-19[libc++] Shrink variant's index type when possibleEric Fiselier
Summary: Currently `std::variant` always uses an unsigned int to store the variant index. However this isn't nessesary and causes `std::variant` to be larger than it needs to be in most cases. This patch changes the index type to be `unsigned char` when possible, and `unsigned short` or `unsigned int` otherwise, depending on the size (Although it's questionable if it's even possible to create a variant with 65535 elements. Unfortunately this change is an ABI break, and as such is only enabled in ABI v2. Reviewers: mpark Reviewed By: mpark Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D40210 git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@318621 91177308-0d34-0410-b5e6-96231b3b80d8
2017-11-19Fix nodiscard test when modules are enabledEric Fiselier
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@318618 91177308-0d34-0410-b5e6-96231b3b80d8
2017-11-16More of P0600 - '[[nodiscard]] in the Library' mark empty() as nodiscard in ↵Marshall Clow
filesystem::path git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@318378 91177308-0d34-0410-b5e6-96231b3b80d8
2017-11-16More of P0600 - '[[nodiscard]] in the Library' mark empty() as nodiscard in ↵Marshall Clow
match_results. <regex> git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@318375 91177308-0d34-0410-b5e6-96231b3b80d8
2017-11-15More of P0600 - '[[nodiscard]] in the Library' mark empty() as nodiscard in ↵Marshall Clow
string, string_view, and the free function std::empty(). Removed tabs from <string_view>, which is why the diff is so big. git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@318328 91177308-0d34-0410-b5e6-96231b3b80d8
2017-11-15[test] Alignment must be > __STDCPP_DEFAULT_NEW_ALIGNMENT__ to call aligned newCasey Carter
Differential Revision: D39221 git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@318325 91177308-0d34-0410-b5e6-96231b3b80d8
2017-11-15Clean up the tests for free data(), size() and empty()Marshall Clow
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@318313 91177308-0d34-0410-b5e6-96231b3b80d8
2017-11-15Tolerate even more [[nodiscard]] in the STL. Reviewed as ↵Billy Robert O'Neal III
https://reviews.llvm.org/D39080 git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@318277 91177308-0d34-0410-b5e6-96231b3b80d8
2017-11-15Tolerate [[nodiscard]] annotations in the STL. Reviewed as ↵Billy Robert O'Neal III
https://reviews.llvm.org/D39033 git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@318276 91177308-0d34-0410-b5e6-96231b3b80d8
2017-11-15First part of P0600 - '[[nodiscard] in the standard library'. Mark the ↵Marshall Clow
'empty()' methods of all the containers as nodiscard. If you're calling empty() w/o looking at the result, you probably meanto to call 'clear()'. c++2a only git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@318269 91177308-0d34-0410-b5e6-96231b3b80d8
2017-11-15Still more missing tests - this time for the unordered containersMarshall Clow
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@318268 91177308-0d34-0410-b5e6-96231b3b80d8
2017-11-15Named the macro wrong in the test.Marshall Clow
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@318259 91177308-0d34-0410-b5e6-96231b3b80d8