summaryrefslogtreecommitdiffstats
path: root/libcxx/test
Commit message (Collapse)AuthorAgeFilesLines
* Fix get_temp_file_name() to compile on Windows. Patch from STL@microsoft.comEric Fiselier2016-04-291-6/+8
| | | | llvm-svn: 267963
* Remove more names of unreferenced parameters. Patch from STL@microsoft.comEric Fiselier2016-04-292-10/+10
| | | | llvm-svn: 267962
* Add a return value for nasty_mutex::operator&. Patch from STL@microsoft.comEric Fiselier2016-04-291-1/+1
| | | | llvm-svn: 267961
* Add <string> include for streaming operators. Patch from STL@microsoft.comEric Fiselier2016-04-298-0/+8
| | | | llvm-svn: 267959
* Add proper include for unique_ptr. Patch from STL@microsoft.comEric Fiselier2016-04-291-0/+1
| | | | llvm-svn: 267958
* Guard libc++ specific c.__invariants() tests in LIBCPP_ASSERT macrosEric Fiselier2016-04-28101-342/+390
| | | | llvm-svn: 267947
* Remove names of unreferenced parameters. Patch from STL@microsoft.comEric Fiselier2016-04-2816-20/+20
| | | | llvm-svn: 267852
* Add braces, move braces, and rename variables to avoid shadowing. Patch from ↵Eric Fiselier2016-04-285-4/+10
| | | | | | STL@microsoft.com llvm-svn: 267844
* Provide member function definitions to avoid warnings. Patch from ↵Eric Fiselier2016-04-281-1/+1
| | | | | | STL@microsoft.com llvm-svn: 267843
* Rename function parameters to avoid shadowing. Patch from STL@microsoft.comEric Fiselier2016-04-281-4/+4
| | | | llvm-svn: 267838
* Guard Clang and GCC specific pragmas. Patch from STL@microsoft.comEric Fiselier2016-04-2830-0/+62
| | | | llvm-svn: 267836
* Fix = that should have been == in test. Thanks to STL@microsoft for the catchMarshall Clow2016-04-271-1/+1
| | | | llvm-svn: 267654
* Apparently XFAIL tests that are supposed to fail to compile can be ↵Marshall Clow2016-04-267-14/+28
| | | | | | problematic. They still get compiled, and if the compile succeeds, the buildbots complain. Replace the XFAIL with #error. llvm-svn: 267591
* #include <test_macros.h> in all the regex tests, and remove all mentions of ↵Marshall Clow2016-04-26140-31/+149
| | | | | | __cpluplus (use TEST_STD_VERS and/or XFAIL instead). No functional change llvm-svn: 267567
* Rename a few tests that had typos in their names. No functional change. ↵Marshall Clow2016-04-234-0/+0
| | | | | | Thanks to STL for the catch llvm-svn: 267287
* Fix some non-standard parts of our test suite. Reported by STLEric Fiselier2016-04-2222-31/+45
| | | | llvm-svn: 267131
* Add missing include of <algorithm>Marshall Clow2016-04-222-0/+2
| | | | llvm-svn: 267119
* Fix LWG issue #2106: move_iterators returning prvaluesEric Fiselier2016-04-221-1/+40
| | | | llvm-svn: 267091
* Fix C++03 build breakageEric Fiselier2016-04-221-2/+9
| | | | llvm-svn: 267090
* Complete LWG issue #2016. Allocators must be nothrow swappableEric Fiselier2016-04-2213-34/+39
| | | | llvm-svn: 267085
* Add is_swappable/is_nothrow_swappable traitsEric Fiselier2016-04-2110-61/+584
| | | | llvm-svn: 267079
* Add cxx_runtime_root options for testing against a different libc++ at runtimeEric Fiselier2016-04-202-5/+10
| | | | llvm-svn: 266855
* [libcxx] Fix PR15638 - Only allocate in parent when starting a thread to ↵Eric Fiselier2016-04-201-15/+51
| | | | | | | | | | | | | | | | | | | | | prevent calling terminate. Summary: Hi, When creating a new thread libc++ performs at least 2 allocations. The first allocates a tuple of args and the functor that will be passed to the new thread. The second allocation is for the thread local storage needed internally by libc++. Currently the second allocation happens in the child thread, meaning that if it throws the program will terminate with an uncaught bad alloc. The solution to this is to allocate ALL memory in the parent thread and then pass it to the child. See https://llvm.org/bugs/show_bug.cgi?id=15638 Reviewers: mclow.lists, danalbert, jroelofs, EricWF Subscribers: cfe-commits Differential Revision: http://reviews.llvm.org/D13748 llvm-svn: 266851
* Add 'is_callable' and 'is_nothrow_callable' traits and cleanup INVOKE.Eric Fiselier2016-04-2011-63/+488
| | | | | | | | | | | | The primary purpose of this patch is to add the 'is_callable' traits. Since 'is_nothrow_callable' required making 'INVOKE' conditionally noexcept I also took this oppertunity to implement a constexpr version of INVOKE. This fixes 'std::experimental::apply' which required constexpr 'INVOKE support'. This patch will be followed up with some cleanup. Primarly removing most of "__member_function_traits" since it's no longer used by INVOKE (in C++11 at least). llvm-svn: 266836
* XFAILing new test on C++03Ben Craig2016-04-191-0/+1
| | | | | | initializer_list doesn't exist in C++03. llvm-svn: 266820
* Include initializer_list from utilityBen Craig2016-04-191-0/+20
| | | | | | | The C++11 and C++14 standards both say in the header <utility> synopsis that <utility> shall include <initializer_list>. llvm-svn: 266808
* Framework to allow testing of static libc++abiBen Craig2016-04-194-23/+41
| | | | | | | | | | | | | | | | | | | | | | | These changes make linking against static libraries more explicit. Instead of using -lc++ and -lc++abi in the tests, an absolute path to the library is provided instead. The choices of shared vs. static, and the choices of library paths for both libcxx and libcxxabi needed to be exchanged for this to work. In other words, libcxx tests need to know the library path of libcxxabi, and whether libcxxabi is a static or shared library. Some Mac specific logic for testing against libc++abi had to be moved from libcxxabi's config.py, as it was overriding choices made in libcxx's config.py. That logic is now in libcxx's target_info.py. Testing a static libcxx on Linux will now automatically link in librt most of the time. Previously, lots of pthread tests would fail because of an unresolved clock_gettime. http://reviews.llvm.org/D16544 llvm-svn: 266730
* Make tuples constructors conditionally EXPLICIT. See N4387Eric Fiselier2016-04-1911-3/+285
| | | | llvm-svn: 266703
* Implement LWG issue 2219 - support reference_wrapper in INVOKEEric Fiselier2016-04-187-45/+336
| | | | llvm-svn: 266590
* Add hash specializations for __int128_t. Fixes LWG issue 2119Eric Fiselier2016-04-181-3/+8
| | | | llvm-svn: 266587
* Add tests for LWG issue 2361Eric Fiselier2016-04-1815-8/+262
| | | | llvm-svn: 266586
* Fix LWG issue 2345 - Add insert(value_type&&)Eric Fiselier2016-04-1818-533/+672
| | | | llvm-svn: 266585
* Teach map/unordered_map how to optimize 'emplace(Key, T)'.Eric Fiselier2016-04-164-4/+137
| | | | | | | | | In cases where emplace is called with two arguments and the first one matches the key_type we can Key to check for duplicates before allocating. This patch expands on work done by dexonsmith@apple.com. llvm-svn: 266498
* Extract key to avoid preemptive mallocs in insert/emplace in associative ↵Eric Fiselier2016-04-1513-996/+911
| | | | | | | | | | | | | | containers Summary: This patch applies Duncan's work on __hash_table to __tree. Reviewers: mclow.lists, dexonsmith Subscribers: dexonsmith, cfe-commits Differential Revision: http://reviews.llvm.org/D18637 llvm-svn: 266491
* Cleanup and guard tuple's constructor SFINAE. Fixes PR22806 and PR23256.Eric Fiselier2016-04-153-2/+278
| | | | | | | | | | | | | | | | | | | | | There are two main fixes in this patch. First the constructor SFINAE was changed so that it's evaluated in two stages where the first stage evaluates the "safe" SFINAE conditions and the second evaluates the "dangerous" ones. The key is that the second stage is lazily evaluated only if the first stage passes. This helps fix PR23256 (https://llvm.org/bugs/show_bug.cgi?id=23256). The second fix is for PR22806 and LWG issue 2549. This fix applies the suggested resolution to the LWG issue in order to prevent the construction of dangling references. The SFINAE for this check is contained within the _PreferTupleLikeConstructor alias template. The tuple-like constructors are disabled whenever that trait returns false. (https://llvm.org/bugs/show_bug.cgi?id=22806) (http://cplusplus.github.io/LWG/lwg-active.html#2549) llvm-svn: 266461
* [libcxx] Remove the "reduced-arity-initialization" extension from the ↵Eric Fiselier2016-04-152-55/+98
| | | | | | | | | | | | | | | | | uses-allocator constructors Summary: A default uses-allocator constructor has been added since that overload was previously provided by the extended constructor. Since Clang does implicit conversion checking after substitution this constructor has to deduce the allocator_arg_t parameter so that it can prevent the evaluation of "is_default_constructible" if the first argument doesn't match. See http://www.open-std.org/jtc1/sc22/wg21/docs/cwg_defects.html#1391 for more information. This patch fixes PR24779 (https://llvm.org/bugs/show_bug.cgi?id=24779) Subscribers: cfe-commits Differential Revision: http://reviews.llvm.org/D19006 llvm-svn: 266409
* Implement LWG#680, which was missed lo these many moons ago, and was ↵Marshall Clow2016-04-111-2/+2
| | | | | | reported as bug #27259. As a drive-by fix, replace the hand-rolled equivalent to addressof in __wrap_iter with the real thing. llvm-svn: 265914
* Recommit r263036 with additional inlining, so that it will continue to work ↵Marshall Clow2016-04-071-2/+25
| | | | | | with existing system dylibs. Implements LWG#2583 llvm-svn: 265706
* Added a noexcept testMarshall Clow2016-04-071-0/+6
| | | | llvm-svn: 265674
* Fix bug #27260 - add missing swap(reference, reference) to vector<bool>.Marshall Clow2016-04-071-0/+31
| | | | llvm-svn: 265672
* Fix LWG issue 2469 - Use piecewise construction in map::operator[].Eric Fiselier2016-03-312-4/+68
| | | | | | | | | | | | | | | map's allocator may only be used to construct objects of 'value_type', or in this case 'pair<const Key, Value>'. In order to respect this requirement in operator[], which requires default constructing the 'mapped_type', we have to use pair's piecewise constructor with '(tuple<Kep>, tuple<>)'. Unfortunately we still need to provide a fallback implementation for C++03 since we don't have <tuple>. Even worse this fallback is the last remaining user of '__hash_map_node_destructor' and '__construct_node_with_key'. This patch also switches try_emplace over to __tree.__emplace_unique_key_args. llvm-svn: 264989
* Teach __tree how to handle map's __value_typeEric Fiselier2016-03-314-0/+479
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch is fairly large and contains a number of changes. The changes all work towards allowing __tree to properly handle __value_type esspecially when inserting into the __tree. I chose not to break this change into smaller patches because it wouldn't be possible to write meaningful standard-compliant tests for each patch. It is very similar to r260513 "[libcxx] Teach __hash_table how to handle unordered_map's __hash_value_type". Changes in <map> * Remove __value_type's constructors because it should never be constructed directly. * Make map::emplace and multimap::emplace forward to __tree and remove the old definitions * Remove "__construct_node" map and multimap member functions. Almost all of the construction is done within __tree. * Fix map's move constructor to access "__value_type.__nc" directly and pass this object to __tree::insert. Changes in <__tree> * Add traits to detect, handle, and unwrap, map's "__value_type". * Convert methods taking "value_type" to take "__container_value_type" instead. Previously these methods caused unwanted implicit conversions from "std::pair<Key, Value>" to "__value_type<Key, Value>". * Delete __tree_node and __tree_node_base's constructors and assignment operators. The node types should never be constructed because the "__value_" member of __tree_node must be constructed directly by the allocator. * Make the __tree_node_destructor class and "__construct_node" methods unwrap "__node_value_type" into "__container_value_type" before invoking the allocator. The user's allocator can only be used to construct and destroy the container's value_type. Passing it map's "__value_type" was incorrect. * Cleanup the "__insert" and "__emplace" methods. Have __insert forward to an __emplace function wherever possible to reduce code duplication. __insert_unique(value_type const&) and __insert_unique(value_type&&) forward to __emplace_unique_key_args. These functions will not allocate a new node if the value is already in the tree. * Change the __find* functions to take the "key_type" directly instead of passing in "value_type" and unwrapping the key later. This change allows the find functions to be used without having to construct a "value_type" first. This allows for a number of optimizations. * Teach __move_assign and __assign_multi methods to unwrap map's __value_type. llvm-svn: 264986
* Update container_test_types.h and cleanup the related testsEric Fiselier2016-03-317-142/+91
| | | | llvm-svn: 264985
* Implement is_always_lock_freeJF Bastien2016-03-251-0/+101
| | | | | | | | | | | | | | | | | | Summary: This was voted into C++17 at the Jacksonville meeting. The final P0152R1 paper will be in the upcoming post-Jacksonville mailing, and is also available here: http://jfbastien.github.io/papers/P0152R1.html Reviewers: mclow.lists, rsmith Subscribers: cfe-commits Differential Revision: http://reviews.llvm.org/D17951 llvm-svn: 264413
* Guard a number of tests relying on threads support when built inRichard Barton2016-03-2315-4/+24
| | | | | | | | single-threaded mode. Differential Revision: http://reviews.llvm.org/D14731 llvm-svn: 264191
* Missing ATOMIC_*_LOCK_FREE testsJF Bastien2016-03-181-0/+8
| | | | | | Forked from D17951, these tests should have been there but weren't. llvm-svn: 263798
* unord: Extract key to avoid preemptive mallocs in insert/emplaceDuncan P. N. Exon Smith2016-03-173-48/+184
| | | | | | | | | | | | | | | | | | | | | | | | | | unordered_set::emplace and unordered_map::emplace construct a node, then try to insert it. If insertion fails, the node gets deleted. To avoid this unnecessary malloc traffic, check to see if the argument to emplace has the appropriate key_type. If so, we can use that key directly and delay the malloc until we're sure we're inserting something new. Test updates by Eric Fiselier, who rewrote the old allocation tests to include the new cases. There are two orthogonal future directions: 1. Apply the same optimization to set and map. 2. Extend the optimization to when the argument is not key_type, but can be converted to it without side effects. Ideally, we could do this whenever key_type is trivially destructible and the argument is trivially convertible to key_type, but in practise the relevant type traits "blow up sometimes". At least, we should catch a few simple cases (such as when both are primitive types). llvm-svn: 263746
* Make std::addressof constexpr in C++17 (Clang only).Eric Fiselier2016-03-171-0/+42
| | | | llvm-svn: 263688
* Add clang thread safety annotations to mutex and lock_guard. Patch by ↵Eric Fiselier2016-03-166-0/+133
| | | | | | | | | | | | | | | jamesr@google.com. This adds clang thread safety annotations to std::mutex and std::lock_guard so code using these types can use these types directly instead of having to wrap the types to provide annotations. These checks when enabled by -Wthread-safety provide simple but useful static checking to detect potential race conditions. See http://clang.llvm.org/docs/ThreadSafetyAnalysis.html for details. This patch was reviewed in http://reviews.llvm.org/D14731. llvm-svn: 263611
* [libcxx] Remove localization tests for Russian month namesJonas Hahnfeld2016-03-152-34/+0
| | | | | | | | | | | | | | Commit f49839299a085505eb673544744b61d2d9cdd1db in glibc-2.14 changed the locales to the currently required format. However, they were again changed in commit 55bdd2866f23b28422d969060b3518909a12b100 which has been released in 2.17. That leads to the current situation where Debian and e.g. CentOS 6 have the pre-2.14 locales, for example Ubuntu 14.04 has pre-2.17 and CentOS 7 on the other hand has the newest locales in glibc-2.17. Differential Revision: http://reviews.llvm.org/D18187 llvm-svn: 263554
OpenPOWER on IntegriCloud