summaryrefslogtreecommitdiffstats
path: root/libcxx/test/std
Commit message (Collapse)AuthorAgeFilesLines
...
* [libcxx] Fix a bug in strstreambuf::overflow.Akira Hatanaka2016-06-291-0/+32
| | | | | | | | | | | The end pointer should point to one past the end of the newly allocated buffer. rdar://problem/24265174 Differential Revision: http://reviews.llvm.org/D20334 llvm-svn: 274132
* Implement P0163r0. Add shared_ptr::weak_type.Eric Fiselier2016-06-271-0/+6
| | | | | | | | | | This patch adds the weak_type typedef in shared_ptr. It is available in C++17 and newer. This patch also updates the _LIBCPP_STD_VER and TEST_STD_VER macros to have the value of 16, since 2016 is the current year. llvm-svn: 273839
* Implement p0337r0. Delete operator= for polymorphic_allocator.Eric Fiselier2016-06-271-2/+2
| | | | llvm-svn: 273838
* Implement P0358r1. Fixes for not_fn.Eric Fiselier2016-06-271-28/+69
| | | | llvm-svn: 273837
* Fix C++03 failure in enable_shared_from_this testEric Fiselier2016-06-271-1/+2
| | | | llvm-svn: 273836
* Fix PR27115 - enable_shared_from_this does not work as a virtual base class.Eric Fiselier2016-06-261-0/+16
| | | | | | | | | | | | | See https://llvm.org/bugs/show_bug.cgi?id=27115 The problem was that the conversion from 'const enable_shared_from_this<T>*' to 'const T*' didn't work if T inherited enable_shared_from_this as a virtual base class. The fix is to take the original pointer passed to shared_ptr's constructor in the __enable_weak_this method and perform an upcast to 'const T*' instead of performing a downcast from the enable_shared_from_this base. llvm-svn: 273835
* Fix C++03 buildEric Fiselier2016-06-261-0/+4
| | | | llvm-svn: 273832
* Fix PR28079 - std::wstring_convert move constructor broken.Eric Fiselier2016-06-261-0/+27
| | | | | | | | | | | | | The move constructor for wstring_convert accidentally copied the state member into the converted count member in the move constructor. This patch fixes the typo. While working on this I discovered that wstring_convert doesn't actually provide a move constructor according to the standard and therefore this constructor is a libc++ extension. I'll look further into whether libc++ should provide this constructor at all. Neither libstdc++ or MSVC's STL provide it. llvm-svn: 273831
* Implement LWG 2488 - Make the placeholders constexpr.Eric Fiselier2016-06-261-0/+28
| | | | | | | | | | | | | | | | | | | This patch makes the bind placeholders in std::placeholders both (1) const and (2) constexpr (See below). This is technically a breaking change for any code using the placeholders outside of std::bind and depending on them being non-const. However I don't think this will break any real world code. (1) Previously the placeholders were non-const extern globals in all dialects. This patch changes these extern globals to be const in all dialects. Since the cv-qualifiers don't participate in name mangling for globals this is an ABI compatible change. (2) Make the placeholders constexpr in C++11 and beyond. Although LWG 2488 only applies to C++17 I don't see any reason not to backport this change. llvm-svn: 273824
* Make default_noexcept.pass.cpp container tests more portable. Patch from ↵Eric Fiselier2016-06-2615-27/+42
| | | | | | STL@microsoft.com llvm-svn: 273823
* Work around MSVC bug in atomics.types.generic/address.pass.cpp test. Patch ↵Eric Fiselier2016-06-261-1/+1
| | | | | | from STL@microsoft.com llvm-svn: 273822
* Use L"cat" L"dog" when concatenating string literals. Patch from ↵Eric Fiselier2016-06-261-8/+8
| | | | | | STL@microsoft.com llvm-svn: 273821
* Add array bounds assertions to satisfy MSVC's /analyze flag. Patch from ↵Eric Fiselier2016-06-263-0/+11
| | | | | | STL@microsoft.com llvm-svn: 273820
* Avoid narrowing conversions in quoted test. Patch from STL@microsoft.comEric Fiselier2016-06-261-6/+6
| | | | llvm-svn: 273818
* Finish converting list _LIBCPP_DEBUG tests.Eric Fiselier2016-06-225-81/+7
| | | | llvm-svn: 273394
* Cleanup _LIBCPP_DEBUG tests in std::list. More to come.Eric Fiselier2016-06-2211-515/+7
| | | | llvm-svn: 273393
* Placate MSVC's unchecked malloc warning in thread tests.Eric Fiselier2016-06-221-1/+3
| | | | llvm-svn: 273385
* Make shared_ptr constructor tests use count_new.hppEric Fiselier2016-06-225-151/+92
| | | | llvm-svn: 273379
* Make locale constructors tests use count_new.hppEric Fiselier2016-06-228-129/+18
| | | | llvm-svn: 273375
* Placate MSVC's unchecked malloc warnings.Eric Fiselier2016-06-224-5/+12
| | | | llvm-svn: 273374
* UBSan doesn't globally replace new/delete but it still makes some tests ↵Eric Fiselier2016-06-226-0/+20
| | | | | | fail. Investigation needed. llvm-svn: 273372
* Cleanup [list.modifiers] tests.Eric Fiselier2016-06-229-566/+53
| | | | llvm-svn: 273371
* Don't use non-conforming pointer_traits specialization it tests.Eric Fiselier2016-06-221-1/+3
| | | | llvm-svn: 273368
* Move remaining _LIBCPP_VERSION tests into test/libcxxEric Fiselier2016-06-2242-842/+0
| | | | llvm-svn: 273367
* Move more _LIBCPP_VERSION tests to test/libcxx.Eric Fiselier2016-06-2217-316/+0
| | | | llvm-svn: 273365
* Move all tests for _LIBCPP_VERSION in language.support to ↵Eric Fiselier2016-06-2215-300/+0
| | | | | | test/libcxx/language.support. llvm-svn: 273364
* Move typoed dir meta.hel to meta.helpEric Fiselier2016-06-222-0/+0
| | | | llvm-svn: 273362
* Use static_assert instead of runtime assert in std::money_base tests.Eric Fiselier2016-06-221-7/+7
| | | | llvm-svn: 273360
* Remove locale tests that depend on LC_ALL. These are non-portable.Eric Fiselier2016-06-222-32/+0
| | | | llvm-svn: 273359
* Fix comment typos, strip trailing whitespace. Patch from STL@microsoft.comEric Fiselier2016-06-225-6/+6
| | | | llvm-svn: 273357
* Avoid huge main() functions and huge arrays. Patch from STL@microsoft.comEric Fiselier2016-06-2210-2458/+2689
| | | | llvm-svn: 273354
* Don't use C++17 terse static assert. Patch from STL@microsoft.comEric Fiselier2016-06-228-120/+120
| | | | llvm-svn: 273353
* Fix operator precedence mistake in valarray/not.pass.cpp. Patch from ↵Eric Fiselier2016-06-221-1/+1
| | | | | | STL@microsoft.com llvm-svn: 273352
* Avoid assignment in return. Patch from STL@microsoft.comEric Fiselier2016-06-222-2/+2
| | | | llvm-svn: 273349
* Suppress unused warnings in std::invoke tests.Eric Fiselier2016-06-221-4/+4
| | | | llvm-svn: 273348
* Guard libc++ assumption about identity hashing in test. Patch from ↵Eric Fiselier2016-06-221-3/+7
| | | | | | STL@microsoft.com llvm-svn: 273345
* Guard use of non-standard macros in denorm_min() tests.Eric Fiselier2016-06-221-0/+11
| | | | llvm-svn: 273344
* Allow placement new array test to consume extra bytes as specified by the ↵Eric Fiselier2016-06-221-4/+8
| | | | | | standard. llvm-svn: 273342
* Move native_handle thread tests to test/libcxxEric Fiselier2016-06-225-164/+0
| | | | llvm-svn: 273341
* Fix PR27684 - std::tuple no longer accepts reference to incomplete type in ↵Eric Fiselier2016-06-212-20/+56
| | | | | | | | | | | | | | | | | some cases. Libc++ has to deduce the 'allocator_arg_t' parameter as 'AllocArgT' for the following constructor: template <class Alloc> tuple(allocator_arg_t, Alloc const&) Previously libc++ has tried to support tags derived from 'allocator_arg_t' by using 'is_base_of<AllocArgT, allocator_arg_t>'. However this breaks whenever a 2-tuple contains a reference to an incomplete type as its first parameter. See https://llvm.org/bugs/show_bug.cgi?id=27684 llvm-svn: 273334
* Implement LWG issue 2720. Replace perms::resolve_symlinks with ↵Eric Fiselier2016-06-212-10/+14
| | | | | | | | | | | | | | | perms::symlink_nofollow. This changes how filesystem::permissions(p, perms) handles symlinks. Previously symlinks were not resolved by default instead only getting resolved when "perms::resolve_symlinks" was used. After this change symlinks are resolved by default and perms::symlink_nofollow must be given to change this. This issue has not yet been moved to Ready status, and I will revert if it doesn't get moved at the current meeting. However I feel confident that it will and it's nice to have implementations when moving issues. llvm-svn: 273328
* Implement LWG issue 2725. The issue should move this meetingEric Fiselier2016-06-211-0/+4
| | | | llvm-svn: 273325
* Implement std::experimental::propagate_const from LFTS v2Jonathan Coe2016-06-1941-0/+1436
| | | | | | | | | | | | | Summary: An implementation of std::experimental::propagate_const from Library Fundamentals Technical Specification v2. No tests are provided for disallowed types like fancy pointers or function pointers as no code was written to handle these. Reviewers: EricWF, mclow.lists Differential Revision: http://reviews.llvm.org/D12486 llvm-svn: 273122
* Fix various undefined behavior found by UBSan.Eric Fiselier2016-06-194-22/+38
| | | | | | | | | | | | | | | | | | | | | | | * Fix non-null violation in strstream.cpp Overflow was calling memcpy with a null parameter and a size of 0. * Fix std/atomics/atomics.flag/ tests: a.test_and_set() was reading from an uninitialized atomic, but wasn't using the value. The tests now clear the flag before performing the first test_and_set. This allows UBSAN to test that clear doesn't read an invalid value. * Fix std/experimental/algorithms/alg.random.sample/sample.pass.cpp The tests were dereferencing a past-the-end pointer to an array so that they could do pointer arithmetic with it. Instead of dereference the iterator I changed the tests to use the special 'base()' test iterator method. * Add -fno-sanitize=float-divide-by-zero to suppress division by zero UBSAN diagnostics. The tests that cause float division by zero are explicitly aware that they are doing that. Since this is well defined for IEEE floats suppress the warnings for now. llvm-svn: 273107
* Implement LWG issue 1169. num_get not fully compatible with strto*Eric Fiselier2016-06-193-0/+75
| | | | | | | | | | | Use strtof and strtod for floats and doubles respectively instead of always using strtold. The other parts of the change are already implemented in libc++. This patch also has a drive by fix to wbuffer_convert::underflow() which prevents it from calling memmove(buff, null, 0). llvm-svn: 273106
* Fix bugs in last_write_time implementation.Eric Fiselier2016-06-191-23/+89
| | | | | | | | | | | | | | | * Fix passing a negative number as either tv_usec or tv_nsec. When file_time_type is negative and has a non-zero sub-second value we subtract 1 from tv_sec and make the sub-second duration positive. * Detect and report when 'file_time_type' cannot be represented by time_t. This happens when using large/small file_time_type values with a 32 bit time_t. There is more work to be done in the implementation. It should start to use stat's st_mtim or st_mtimeval if it's provided as an extension. That way we can provide a better resolution. llvm-svn: 273103
* Fix 3 bugs in filesystem tests and implementation.Eric Fiselier2016-06-183-40/+25
| | | | | | | | | | | | | | | | | | | | | | | | This patch fixes the following bugs, all of which were discovered while testing a 32 bit build on a 64 bit machine. * path.itr/iterator.pass.cpp has undefined behavior. 'path::iterator' stashes the value of the element inside the iterator. This violates the BiDirIterator requirements but is allowed for path::iterator. However this means that using reverse_iterator<path::iterator> has undefined behavior because it assumes that 'Iter tmp = it; return *tmp' will not create a dangling reference. However it does, and this caused this particular test to fail. * path.native.obs/string_alloc.pass.cpp tested the SSO with a long string. On 32 bit builds std::wstring only has the SSO for strings of size 2. The test was using a string of size 4. * fs.op.space/space.pass.cpp had overflows while calculating the expected values. The fix here is to convert the statvfs data members to std::uintmax_t before multiplying them. The internal implementation already does this but the tests needed to do it as well. llvm-svn: 273078
* Add additional tests in an attempt to diagnose ARM test failures.Eric Fiselier2016-06-183-12/+63
| | | | | | | | | | | | | | | | | | | | | | | | | Currently 4 tests are failing on the ARM buildbot. To try and diagnose each of the failures this patch does the following: 1) path.itr/iterator.pass.cpp * Temporarily print iteration sequence to see where its failing. 2) path.native.obs/string_alloc.pass.cpp * Remove test that ::new is not called when constructing a short string that requires a conversion. Since during the conversion global locale objects might be constructed. 3) fs.op.funcs/space.pass.cpp * Explicitly use uintmax_t in the implementation of space, hopefully preventing possible overflows. * Add additional tests that check for overflow is the calculation of the space_info values. * Add additional tests for the values returned from statfvs. 4) fs.op.funcs/last_write_time.pass.cpp * No changes made yet. llvm-svn: 273075
* Add checkpoints to string allocation test to help with debugging arm failures.Eric Fiselier2016-06-181-1/+6
| | | | llvm-svn: 273072
* Fix bugs in recursive_directory_iterator::increment(ec) implementation and ↵Eric Fiselier2016-06-171-9/+17
| | | | | | | | | | | | | | | tests. r273060 didn't completely fix the issues in recursive_directory_iterator and the tests. This patch follows up with more fixes * Fix bug where recursive_directory_iterator::increment(ec) did not reset the error code if no failure occurred. * Fix bad assertion in the recursive_directory_iterator::increment(ec) test that would only fire for certain iteration orders. llvm-svn: 273070
OpenPOWER on IntegriCloud