summaryrefslogtreecommitdiffstats
path: root/libcxx/test/utilities
Commit message (Collapse)AuthorAgeFilesLines
* Move test into test/std subdirectory.Eric Fiselier2014-12-20832-43425/+0
| | | | llvm-svn: 224658
* Move the optional tests into test/experimental. They were put into ↵Marshall Clow2014-12-0968-4418/+6
| | | | | | test/utilities because optional was going to be part of C++14, and then was pulled and put into the Library Fundamentals TS instead. No funcitonality change here; just moving files around. llvm-svn: 223778
* Add all the relational operators to std::experimental::optional. Also update ↵Marshall Clow2014-12-0922-159/+742
| | | | | | bad_optional_access to match the Library Fundamentals draft standard. This is not all of the upcoming changes to optional, though. llvm-svn: 223775
* Flush out test cases for tuples constructor SFINAEEric Fiselier2014-11-182-23/+132
| | | | llvm-svn: 222278
* Add a test for LWG issue #2399. We already implement this, but now we have a ↵Marshall Clow2014-11-181-0/+9
| | | | | | test as well. llvm-svn: 222242
* Implement LWG2400 - 'shared_ptr's get_deleter() should use addressof()', and ↵Marshall Clow2014-11-171-0/+8
| | | | | | add tests. Mark LWG2400 and LWG2404 as complete llvm-svn: 222161
* Fix a warning in the test; no functionality changeMarshall Clow2014-11-171-1/+1
| | | | llvm-svn: 222143
* Implement void_t from N3911. Add a private version for use in the library ↵Marshall Clow2014-11-171-0/+69
| | | | | | before C++1z. Update the 1z status page, marking a bunch of issues that don't require library changes as complete (2129, 2212, 2230, 2233, 2325, 2365, 2376) llvm-svn: 222138
* Add tests to ensure that reference_wrapper<T> is trivially copyable. This ↵Marshall Clow2014-11-171-5/+36
| | | | | | was added to C++1z with the adoption of N4277, but libc++ already implemented it as a conforming extension. No code changes were needed, just more tests. llvm-svn: 222132
* Fix rvalue bug in __has_operator_addressofEric Fiselier2014-11-051-1/+14
| | | | llvm-svn: 221398
* Fix operator & detection trait to check for free function overloads as wellEric Fiselier2014-11-051-0/+5
| | | | llvm-svn: 221395
* Actually mark the tests an unsupported with MSAN (not just ASAN)Eric Fiselier2014-11-0417-17/+17
| | | | llvm-svn: 221240
* Mark tests that replace operator new/delete as UNSUPPORTED with ASAN and MSAN.Eric Fiselier2014-11-0417-0/+34
| | | | | | | tests that replace operator new/delete won't link when using ASAN and MSAN because these sanitizers also replace new/delete. llvm-svn: 221236
* Add test for type properties of std::reference_wrapperEric Fiselier2014-11-041-0/+27
| | | | llvm-svn: 221224
* [libcxx] Delay evaluation of __make_tuple_types to prevent blowing the max ↵Eric Fiselier2014-10-282-0/+66
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | template instantiation depth. Fixes Bug #18345 Summary: http://llvm.org/bugs/show_bug.cgi?id=18345 Tuple's constructor and assignment operators for "tuple-like" types evaluates __make_tuple_types unnecessarily. In the case of a large array this can blow the template instantiation depth. Ex: ``` #include <array> #include <tuple> #include <memory> typedef std::array<int, 1256> array_t; typedef std::tuple<array_t> tuple_t; int main() { array_t a; tuple_t t(a); // broken t = a; // broken // make_shared uses tuple behind the scenes. This bug breaks this code. std::make_shared<array_t>(a); } ``` To prevent this from happening we delay the instantiation of `__make_tuple_types` until after we perform the length check. Currently `__make_tuple_types` is instantiated at the same time that the length check . Test Plan: Two tests have been added. One for the "tuple-like" constructors and another for the "tuple-like" assignment operator. Reviewers: mclow.lists, EricWF Reviewed By: EricWF Subscribers: K-ballo, cfe-commits Differential Revision: http://reviews.llvm.org/D4467 llvm-svn: 220769
* Add support for "fancy" pointers to shared_ptr. Fixes PR20616Eric Fiselier2014-10-234-0/+212
| | | | | | | | | | | | | | | | | | | | | | | | Summary: This patch add support for "fancy pointers/allocators" as well as fixing support for shared_pointer and "minimal" allocators. Fancy pointers are class types that meet the NullablePointer requirements. In our case they are created by fancy allocators. `support/min_allocator.h` is an archetype for these types. There are three types of changes made in this patch: 1. `_Alloc::template rebind<T>::other` -> `__allocator_traits_rebind<_Alloc, T>::type`. This change was made because allocators don't need a rebind template. `__allocator_traits_rebind` is used instead of `allocator_traits::rebind` because use of `allocator_traits::rebind` requires a workaround for when template aliases are unavailable. 2. `a.deallocate(this, 1)` -> `a.deallocate(pointer_traits<self>::pointer_to(*this), 1)`. This change change is made because fancy pointers aren't always constructible from raw pointers. 3. `p.get()` -> `addressof(*p.get())`. Fancy pointers aren't actually a pointer. When we need a "real" pointer we take the address of dereferencing the fancy pointer. This should give us the actual raw pointer. Test Plan: Tests were added using `support/min_allocator.h` to each affected shared_ptr overload and creation function. These tests can only be executed in C++11 or greater since min_allocator is only available then. A extra test was added for the non-variadic versions of allocate_shared. Reviewers: danalbert, mclow.lists Reviewed By: mclow.lists Subscribers: cfe-commits Differential Revision: http://reviews.llvm.org/D4859 llvm-svn: 220469
* Fix a couple of failing tests for C++03 by checking for rvalue reference ↵Marshall Clow2014-10-232-3/+4
| | | | | | support first. llvm-svn: 220465
* LWG #2212 (not yet adopted) mandates that tuple_size/tuple_element are ↵Marshall Clow2014-10-212-0/+101
| | | | | | available if <array> or <utility> are included (not just <tuple>). We already do this. Add some tests to make sure that this remains true. llvm-svn: 220295
* Whitespace maintenance. Remove a bunch of tabs that snuck in. No ↵Marshall Clow2014-10-189-25/+25
| | | | | | functionality change llvm-svn: 220142
* Fixes PR21157 'tuple: non-default constructible tuple hard failure' Thanks ↵Marshall Clow2014-10-153-0/+56
| | | | | | to Louis Dionne for the bug report and the patch. llvm-svn: 219785
* Fix for PR 19616: 'tuple_cat of nested tuples fails in noexcept ↵Marshall Clow2014-10-072-1/+28
| | | | | | specification'. Thanks to Louis Dionne for the fix. llvm-svn: 219243
* Fix some type-traits (is_assignable, etc) dealing with classes that take ↵Marshall Clow2014-09-225-0/+32
| | | | | | non-const references as 'right hand side'. Add tests. Fixes PR# 20836 llvm-svn: 218286
* Allow libc++ to be built on systems without POSIX threadsJonathan Roelofs2014-09-0511-0/+22
| | | | | | | | | | If you're crazy enough to want this sort of thing, then add -D_LIBCPP_HAS_NO_THREADS to your CXXFLAGS and --param=additiona_features=libcpp-has-no-threads to your lit commnad line. http://reviews.llvm.org/D3969 llvm-svn: 217271
* Set -D_LIBCPP_HAS_NO_THREADS and -D_LIBCPP_HAS_NO_MONOTONIC_CLOCK based on ↵Jonathan Roelofs2014-09-052-2/+2
| | | | | | | | available_features http://reviews.llvm.org/D5214 llvm-svn: 217261
* test: Make it possible to opt in to use_clang_verify per testJustin Bogner2014-09-031-0/+2
| | | | | | | | | | | This modifies the use_clang_verify parameter I added in r217009 to only apply to tests that specifically ask for it via // USE_VERIFY. This allows us to incrementally convert tests, but start enjoying the benefits right away. Suggested by Eric Fiselier in code review. llvm-svn: 217017
* test: Allow using clang -verify for failures rather than exit 1Justin Bogner2014-09-031-2/+3
| | | | | | | | | | | | | | | | | Currently, failure tests work by checking that compilation exits 1. This can lead to tests that fail for the wrong reason, so it'd be preferable to convert them to check for specific errors. This adds use_clang_verify parameter that runs failure tests using clang's -verify flag. I'll convert some tests in subsequent commits, and once all of the tests are converted we should key this on whether cxx_under_test is clang. I've also converted one of the unique.ptr tests, since it's the one that motivated the idea of using clang -verify when possible in the review of r216317. llvm-svn: 217009
* Partially address a FIXME in steady_clock::now()Jonathan Roelofs2014-09-022-0/+3
| | | | | | http://reviews.llvm.org/D4045 llvm-svn: 216949
* Fix PR#20834 - 'is_trivially_destructible yeilds wrong answer for arrays of ↵Marshall Clow2014-09-0213-21/+20
| | | | | | unknown bound' Thanks to K-ballo for the bug report. Update a few of the other tests while we're here, and fix a typo in a test name. llvm-svn: 216909
* Fix assignments that should be comparisons x3Eric Fiselier2014-08-232-2/+2
| | | | llvm-svn: 216318
* Add return statement to a test class's assignment operator. Defect found by ↵Eric Fiselier2014-08-231-1/+1
| | | | | | Coverity Scan. llvm-svn: 216317
* Add extra test case for PR20345. Should have been commited with r215984Eric Fiselier2014-08-191-0/+76
| | | | llvm-svn: 215985
* Fix is_member_function_pointer does not account for ellipsis. PR20345. Patch ↵Eric Fiselier2014-08-191-0/+24
| | | | | | | | from Agustin Berge. I reviewed the patch and added the test cases. llvm-svn: 215984
* Tame a few enum size tests when using -fshort-enums on ARM.Jonathan Roelofs2014-08-152-2/+2
| | | | llvm-svn: 215769
* Fix a problem with reference_wrapper in C++03 that was causing counting ↵Marshall Clow2014-08-041-0/+18
| | | | | | predicates to fail. Add a test to make sure it works. However, most of the reference_wrapper tests still fail in C++03 mode, due to a lack of decltype. No change there. llvm-svn: 214760
* D4451: Fix copy/move issues casude by __tuple_leafs's converting constructorEric Fiselier2014-07-244-2/+73
| | | | llvm-svn: 213888
* Correctly implement LWG 2049; std::is_destructible.Marshall Clow2014-07-164-13/+75
| | | | llvm-svn: 213163
* Fix libc++ bug #20039: 'Constructing std::function from empty compatible ↵Marshall Clow2014-06-302-0/+36
| | | | | | std::function results in half-empty state' Thanks to Agustin Berge for the report, and for his and Eric Fiselier's work on a fix. llvm-svn: 212070
* Make meta.trans.other/aligned_storage.pass.cpp pass on arm.Nico Weber2014-06-041-3/+11
| | | | | | | The maximum alignment on arm is 8, not 16 like on x86. Use alignof(max_align_t) to make the test work in both cases. llvm-svn: 210195
* Fix a problem exposed by r208825, which caused bind (and other bits of ↵Marshall Clow2014-05-291-0/+23
| | | | | | libc++) to stop working. And tests llvm-svn: 209785
* Fix bug #18350. Add tests for tuples of all the smart pointers (except auto_ptr)Marshall Clow2014-04-261-0/+35
| | | | llvm-svn: 207307
* Default the copy and move constructors for __tuple_leaf. This fixes bugs ↵Marshall Clow2014-04-211-0/+35
| | | | | | 18853 and 19118. Add a test case for that. llvm-svn: 206829
* Bug #19473. If you pass an allocator to std::function, we should use that ↵Marshall Clow2014-04-181-0/+9
| | | | | | allocator, not construct one from scratch. Add a test to make sure llvm-svn: 206623
* Fixed a test that was attempting to use rvalue-references w/o checking to ↵Marshall Clow2014-04-171-1/+4
| | | | | | see if they were supported in the language. This resulted in a warning when testing using C++03. llvm-svn: 206482
* [libc++] Teach is_integral, is_[un]signed and make_[un]signed about ↵Stephan Tolksdorf2014-03-266-0/+46
| | | | | | | | | | __[u]int128_t This commit also adds tests for std::numeric_limits<__[u]int128_t>. Reviewed in http://llvm-reviews.chandlerc.com/D2917 llvm-svn: 204849
* Final bit for LWG #2263; test different allocator pointer types. Note that ↵Marshall Clow2014-03-112-0/+232
| | | | | | libc++ already does the right thing here; I've just added tests to ensure that it stays this way. llvm-svn: 203539
* Mark is_final as a C++14 feature.Marshall Clow2014-03-051-1/+1
| | | | llvm-svn: 202991
* Implement LWG #2212: std::is_final. This requires compiler support, which ↵Marshall Clow2014-03-051-0/+53
| | | | | | modern versions of clang provide. Also mark LWG #2230 as complete - no code changes needed. llvm-svn: 202934
* Update synposis in <memory> to show move semantics for weak_ptr; add tests ↵Marshall Clow2014-03-054-0/+65
| | | | | | for already existing move semantics. Mark LWG issues #2315 (no changes needed), 2316 (move semantics for weak_ptr), 2252 (previous commit) and 2271 (previous commit) as complete. llvm-svn: 202931
* Implement LWG Paper n3887: Consistent Metafunction Aliases. This adds ↵Marshall Clow2014-03-031-0/+7
| | | | | | std::tuple_element_t<> as an alias for tuple_element<>::type. Clean up the synopsis for tuple_element in <utility> as well. llvm-svn: 202673
* Implement LWG issue 2301: Mark std::tie as constexprMarshall Clow2014-02-251-0/+9
| | | | llvm-svn: 202158
OpenPOWER on IntegriCloud