summaryrefslogtreecommitdiffstats
path: root/libcxx/test/utilities
Commit message (Collapse)AuthorAgeFilesLines
...
* Remove cv qualifiers from member pointers in the __member_pointer_traits ↵Howard Hinnant2013-05-151-0/+18
| | | | | | test. This was causing a const-qualified bind result to malfunction. This was a recent regression due to the new use of __member_pointer_traits in restricting the __invokable and __invoke_of tests. llvm-svn: 181935
* Constrain __invoke functions more accurately. This fixes ↵Howard Hinnant2013-05-071-0/+7
| | | | | | http://llvm.org/bugs/show_bug.cgi?id=15861 . llvm-svn: 181377
* Expose accidentally removed __compressed_pair constructor taking ↵Howard Hinnant2013-05-061-0/+10
| | | | | | piecewise_construct_t. This fixes http://llvm.org/bugs/show_bug.cgi?id=15918 . llvm-svn: 181217
* default_delete needs a static_assert against void types. I had previously ↵Howard Hinnant2013-04-241-0/+24
| | | | | | thought that sizeof(void) would take care of this. I was wrong. llvm-svn: 180213
* Somehow aligned_union got dropped through the cracks. This adds it. Did a ↵Howard Hinnant2013-04-223-8/+73
| | | | | | drive-by fix of alignment_of while I was in the neighborhood. llvm-svn: 180036
* addressof misbehaving for type with an implicit conversion operator to ↵Howard Hinnant2013-04-161-0/+18
| | | | | | char&. This fixes http://llvm.org/bugs/show_bug.cgi?id=15754 llvm-svn: 179608
* Accidentally disallowed explicit tuple conversions when all elements of the ↵Howard Hinnant2013-04-141-0/+9
| | | | | | tuple can be explicitly converted. llvm-svn: 179467
* Richard Smith: It was pointed out to me off-list that libc++'s ↵Howard Hinnant2013-04-021-0/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | non-compiler-builtin implementation of std::is_polymorphic does this: template <class _Tp> struct __is_polymorphic1 : public _Tp {}; ... and that g++ rejects this if _Tp has an inaccessible virtual destructor (because __is_polymorphic1<_Tp> would have a deleted virtual destructor overriding _Tp's non-deleted destructor). Clang was failing to reject this; I've fixed that in r178563, but that causes libc++'s corresponding test case to fail with both clang and gcc when using the fallback implementation. The fallback code also incorrectly rejects final types. The attached patch fixes the fallback implementation of is_polymorphic; we now use dynamic_cast's detection of polymorphic class types rather than trying to determine if adding a virtual function makes the type larger: enable_if<sizeof((_Tp*)dynamic_cast<const volatile void*>(declval<_Tp*>())) != 0, ...> Two things of note here: * the (_Tp*) cast is necessary to work around bugs in Clang and g++ where we otherwise don't instantiate the dynamic_cast (filed as PR15656) * the 'const volatile' is here to treat is_polymorphic<cv T> as true for a polymorphic class type T -- my reading of the standard suggests this is incorrect, but it matches our builtin __is_polymorphic and gcc llvm-svn: 178576
* Test case was forming the wrong limits when size_t != unsigned long.Howard Hinnant2013-03-291-1/+2
| | | | llvm-svn: 178370
* This is a start at making the libc++ test suite friendlier to the ↵Howard Hinnant2013-03-232-2/+12
| | | | | | -fnoexceptions flag. Although this is not a complete solution, it does reduce the number of test failures on OS X from 467 to 128 on OS X when -fno-exceptions is enabled, and does not impact the number of failures at all when -fno-exceptions is not enabled. The bulk of this code was donated anonymously. llvm-svn: 177824
* [tests] One last batch of XFAILs, for tests using new symbols added to libc++.Daniel Dunbar2013-02-0613-0/+65
| | | | | | | - As of this commit, the test suite should now fully pass on both darwin11 and darwin12 when testing against either a locally built libc++ or the system libc++. llvm-svn: 174478
* Zhang Xiongpang: Add definitions for const data members. Fixes ↵Howard Hinnant2012-12-123-0/+12
| | | | | | http://llvm.org/bugs/show_bug.cgi?id=14585. llvm-svn: 170026
* Andrew Morrow: There are two tests under test/utilities/memory that heap ↵Howard Hinnant2012-08-022-4/+0
| | | | | | | | | | | | | allocate two integers which remain unused and are subsequently leaked, so the test fail when run under valgrind. Unless I'm overlooking a subtle reason why they are needed I think they can be removed, allowing these tests to pass under valgrind. The attached patch removes the variables. If there is a reason for them to exist, I can change this to just delete them at the end of the test. llvm-svn: 161195
* Implement [util.smartptr.shared.atomic]. This is the last unimplementedHoward Hinnant2012-07-3011-0/+409
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | section in libc++. This requires a recompiled dylib. Failure to rebuild the dylib will result in a link-time error if and only if the functions from [util.smartptr.shared.atomic] are used. The implementation is not lock free. After considerable thought, I know of no way to make the implementation lock free. Ideas welcome along that front. But changing the ABI of shared_ptr is not on the table at this point. The mutex used to lock these function is encapsulated by std::__sp_mut. The only thing the client knows about std::__sp_mut is that it has a void* data member, can't be constructed, and has lock and unlock members. Within the binary __sp_mut is currently implemented as a pointer to a std::mutex. That can change in the future without disturbing the ABI (as long as sizeof(__sp_mut) remains constant. I specifically did not make __sp_mut a spin lock as I have a pathological distrust of spin locks. Testing on OS X reveals that the use of std::mutex in this role is not a large performance penalty as long as the contention for the mutex is low (more likely to get the lock than to have to wait). In the future we can still make __sp_mut a spin lock if that is what is desired (without ABI damage). The dylib contains 16 __sp_mut's to be chosen based on the hash of the address of the shared_ptr. The constant 16 is a ball-park reasonable space/time tradeoff. std::hash<T*> was changed to call __murmur2_or_cityhash, instead of the identity function. I had thought we had already done this, but I was mistaken. All of this is under #if __has_feature(cxx_atomic) even though the implementation is not lock free, because the signatures require access to std::memory_order, which is currently available only under __has_feature(cxx_atomic). llvm-svn: 160940
* Relax the complete-type checks that are happening under __invokable<Fp, ↵Howard Hinnant2012-07-161-0/+29
| | | | | | Args...> to only check Fp, and not Args... . This should be sufficient to give the desired high quality diagnostics under both bind and function. And this allows a test reported by Rich E on cfe-dev to pass. Tracked by <rdar://problem/11880602>. llvm-svn: 160285
* Applied constexpr to <chrono>.Howard Hinnant2012-07-1325-6/+357
| | | | llvm-svn: 160184
* Apply constexpr to <bitset>.Howard Hinnant2012-07-073-2/+5
| | | | llvm-svn: 159899
* Give tuple a constexpr default constructor.Howard Hinnant2012-07-061-0/+14
| | | | llvm-svn: 159857
* I believe tuple is still under development in the standard. Daniel Krugler ↵Howard Hinnant2012-04-012-4/+25
| | | | | | is/will be making convincing arguments that a modified form of LWG 2051 (currently NAD Future) is easily acheivable and desirable. He has demonstrated that a tuple<T...> where all of the T are implicitly convertible from U... should have a tuple constructor that is also implicit, instead of explicit. This would support the use cases in LWG 2051 while not undermining T... with explicit conversions from U.... This check-in is an experimental implementation of Daniel's work. I believe this work to be mature enough to warrant inclusion into libc++. If anyone sees real-world problems that this check in causes, please let me know and I will revert it, and provide the feedback to the LWG. llvm-svn: 153855
* Hook up to the new clang __is_trivially_constructible and ↵Howard Hinnant2012-02-242-11/+19
| | | | | | __is_trivially_assignable traits. Fixes r10925427 and http://llvm.org/bugs/show_bug.cgi?id=12038. llvm-svn: 151406
* Modernize relational operators for shared_ptr and unique_ptr. This includes ↵Howard Hinnant2012-02-212-0/+142
| | | | | | adding support for nullptr, and using less<T*>. Fixes http://llvm.org/bugs/show_bug.cgi?id=12056. llvm-svn: 151084
* Exercise rvalue arguements to make_shared for C++11 mode.Howard Hinnant2012-02-181-0/+11
| | | | llvm-svn: 150887
* tuple was accidentally lacking a valid copy assignment operator. It went ↵Howard Hinnant2012-02-152-2/+2
| | | | | | undetected because I had failed to test assigning from a const lvalue. This fixes http://llvm.org/bugs/show_bug.cgi?id=11921 llvm-svn: 150613
* Starting using murmur2 when combining multiple size_t's into a single hash, ↵Howard Hinnant2011-12-051-1/+2
| | | | | | and also for basic_string. Also made hash<thread::id> ever so slighly more portable. I had to tweak one test which is questionable (definitely not portable) anyway. llvm-svn: 145795
* Fix ratio arithmetic with zeroHoward Hinnant2011-11-012-0/+36
| | | | llvm-svn: 143519
* Adjust two tests to account for a nasty change in copying behaviorAlexis Hunt2011-07-184-0/+18
| | | | | | | between C++03 and C++0x and its effect on exceptions, and another two to not test move construction when rvalue references are not available. llvm-svn: 135445
* Given that __underlying_type is now available in clang, implementAlexis Hunt2011-07-181-1/+15
| | | | | | std::underlying_type. llvm-svn: 135410
* Fixing up some ABI issuesHoward Hinnant2011-07-071-4/+14
| | | | llvm-svn: 134639
* Correct for new rules regarding implicitly deleted special members. ↵Howard Hinnant2011-07-012-2/+2
| | | | | | http://llvm.org/bugs/show_bug.cgi?id=10191 llvm-svn: 134248
* test for pair piecewise constructionHoward Hinnant2011-06-221-1/+34
| | | | llvm-svn: 133667
* noexcept for <memory>. I've added a few extension noexcept to: ↵Howard Hinnant2011-05-281-1/+1
| | | | | | allocator_traits<A>::deallocate, allocaate<T>::deallocate, return_temporary_buffer, and default_delete<T>::operator()(T*) const. My rationale was: If a std-dicated noexcept function needs to call another std-defined function, that called function must be noexcept. We're all a little new to noexcept, so things like this are to be expected. Also included fix for broken __is_swappable trait pointed out by Marc Glisse, thanks Marc|. And fixed a test case for is_nothrow_destructible. Destructors are now noexcept by default| llvm-svn: 132261
* Simplied bind using __invoke. In the process, found and fixed a couple of ↵Howard Hinnant2011-05-192-0/+19
| | | | | | bugs. C++11 only. llvm-svn: 131667
* Fix and beef up test bug for move_if_noexceptHoward Hinnant2011-05-171-3/+11
| | | | llvm-svn: 131483
* Clean up a bunch of warnings in the tests, 3 of which actually turned out to ↵Howard Hinnant2011-05-1726-1/+51
| | | | | | be test bugs. llvm-svn: 131479
* Redesign of result_of to handle reference-qualified member functionsHoward Hinnant2011-05-161-0/+4
| | | | llvm-svn: 131407
* A much improved type_traits for C++0x. Not yet done: ↵Howard Hinnant2011-05-1317-48/+79
| | | | | | is_trivially_constructible, is_trivially_assignable and underlying_type. llvm-svn: 131291
* Corrected some bugs in both memory and the tests. Preparing for being able ↵Howard Hinnant2011-05-112-5/+5
| | | | | | to turn on support for alias templates. llvm-svn: 131199
* minor corrections to test, and hook is_base_of up to clang intrinsicHoward Hinnant2011-01-282-5/+2
| | | | llvm-svn: 124502
* placeholder testHoward Hinnant2011-01-251-0/+19
| | | | llvm-svn: 124193
* Eliminate the C++0x-only is_convertible testing function that acceptsDouglas Gregor2011-01-251-0/+15
| | | | | | | | | | | | | | | | | | | | | | | a cv-qualifier rvalue reference to the type, e.g., template <class _Tp> char __test(const volatile typename remove_reference<_Tp>::type&&); The use of this function signature rather than the more straightforward one used in C++98/03 mode, e.g., template <class _Tp> char __test(_Tp); is broken in two ways: 1) An rvalue reference cannot bind to lvalues, so is_convertible<X&, X&>::value would be false. This breaks two of the unique_ptr tests on Clang and GCC >= 4.5. Prior GCC's seem to have allowed rvalue references to bind to lvalues, allowing this bug to slip in. 2) By adding cv-qualifiers to the type we're converting to, we get some incorrect "true" results for, e.g., is_convertible<const X&, X&>::value. llvm-svn: 124166
* LWG 1385 [FCD] tuple_cat should be a single variadic signature ↵Howard Hinnant2010-12-111-15/+90
| | | | | | (http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-active.html#1385). This issue is only in Ready status, meaning it is not official, but probably will be this March in Madrid. It was tentatively accepted in Batavia with the previso that Bill and I didn't have any problems implementing it. This is my part of that agreement. llvm-svn: 121619
* Test adjustment for recent changes in allocator_traitsHoward Hinnant2010-12-101-1/+1
| | | | llvm-svn: 121503
* This got accidentally removedHoward Hinnant2010-12-101-0/+20
| | | | llvm-svn: 121502
* cleaning up...Howard Hinnant2010-12-0821-634/+0
| | | | llvm-svn: 121275
* Update testsuite strucuture to latest draftHoward Hinnant2010-11-233-0/+64
| | | | llvm-svn: 120036
* Update testsuite strucuture to latest draftHoward Hinnant2010-11-234-12/+0
| | | | llvm-svn: 120029
* N3191: C++ Timeout SpecificationHoward Hinnant2010-11-205-8/+8
| | | | llvm-svn: 119909
* N3123Howard Hinnant2010-11-201-3/+3
| | | | llvm-svn: 119906
* N3142. Many of these traits are just placeholders with medium quality ↵Howard Hinnant2010-11-1938-723/+1235
| | | | | | emulation; waiting on compiler intrinsics to do it right. llvm-svn: 119854
* LWG 1339Howard Hinnant2010-11-181-2/+3
| | | | llvm-svn: 119699
OpenPOWER on IntegriCloud