summaryrefslogtreecommitdiffstats
path: root/libcxx/test/std
Commit message (Collapse)AuthorAgeFilesLines
...
* [libc++] Implement exception_ptr on WindowsEric Fiselier2017-05-0810-27/+17
| | | | | | | | | | | | | | | | | | | | | | Summary: This patch implements exception_ptr on Windows using the `__ExceptionPtrFoo` functions provided by MSVC. The `__ExceptionPtrFoo` functions are defined inside the C++ standard library, `msvcprt`, which is unfortunate because it requires libc++ to link to the MSVC STL. However this doesn't seem to cause any immediate problems. However to be safe I kept all usages within the libc++ dylib so that user programs wouldn't have to link to MSVCPRT as well. Note there are still 2 outstanding exception_ptr/nested_exception test failures. * `current_exception.pass.cpp` needs to be rewritten for the Windows exception_ptr semantics which copy the exception every time. * `rethrow_if_nested.pass.cpp` need investigation. It hits a stack overflow, likely from recursion. This patch also gets most of the `<future>` tests passing as well. Reviewers: mclow.lists, compnerd, bcraig, rmaprath, majnemer, BillyONeal, STL_MSFT Subscribers: mgorny, cfe-commits Differential Revision: https://reviews.llvm.org/D32927 llvm-svn: 302393
* Temporarly XFAIL aligned new/delete tests on Windows.Eric Fiselier2017-05-078-2/+43
| | | | | | | | | | | | | Libc++ doesn't provide its own definitions of new/delete on Windows, instead using the versions provided by VCRuntime. However VCRuntime does not yet implement aligned new/delete so these tests fail. It might be possible for libc++ to provide its own definitions only for aligned new/delete as long as MSVC doesn't provide it. However before this can be done libc++ needs to figure out how to implement std::get_new_handler. llvm-svn: 302384
* Fix Windows test failures caused by identical temp file names.Eric Fiselier2017-05-074-8/+89
| | | | | | | | | | | | This patch fixes test failures that occur on Windows because the tests attempt to generate two distinct temp file names but get the same name both time. The fix for this is to create the first temp file before requesting a second temporary file name. This ensures that the second name will be unique. llvm-svn: 302382
* Accept Windows specific output in system error testsEric Fiselier2017-05-072-2/+2
| | | | llvm-svn: 302381
* Fix two test failures caused by Windows mangling of function types.Eric Fiselier2017-05-072-15/+21
| | | | | | | | | | | | On Windows the function template `template <class T> void test()` has the same mangled name when instantiated with the distinct types `void()` and `void() noexcept`. When this occurs Clang emits an error. This error was causing two type-traits tests to fail. However this can be worked around by using class templates instead of function templates, which is what this patch does to fix the errors. llvm-svn: 302380
* Ensure showbase does not overflow do_put buffersDimitry Andric2017-05-061-0/+97
| | | | | | | | | | | | | | | | | | | | | Summary: In https://bugs.freebsd.org/207918, Daniel McRobb describes how using std::showbase with ostreams can cause truncation of unsigned long long when output format is octal. In fact, this can even happen with unsigned int and unsigned long. To ensure this does not happen, add one additional character to the do_put buffers if std::showbase is on. Also add a test case. Reviewers: EricWF, mclow.lists Reviewed By: EricWF Subscribers: cfe-commits, emaste Differential Revision: https://reviews.llvm.org/D32670 llvm-svn: 302362
* [libcxx] [test] Suppress MSVC's /analyze warning C6294 in a more ↵Stephan T. Lavavej2017-05-0525-19/+119
| | | | | | | | fine-grained manner. Fixes D32926. llvm-svn: 302325
* [libcxx] [test] Fix MSVC "warning C6326: Potential comparison of a constant ↵Stephan T. Lavavej2017-05-051-2/+2
| | | | | | | | | | with another constant". The expressions `1 == 1` and `true` have the same type, value category, and value. Fixes D32924. llvm-svn: 302322
* [libcxx] [test] Be compatible with LWG 2438 "std::iterator inheritance ↵Stephan T. Lavavej2017-05-053-0/+54
| | | | | | | | | | | shouldn't be mandated". In C++17, these iterators are allowed but not required to inherit from the deprecated std::iterator base class. Fixes D32727. llvm-svn: 302318
* Mark test using <sys/time.h> as UNSUPPORTED on WindowsEric Fiselier2017-05-051-0/+3
| | | | llvm-svn: 302298
* Document XFAIL's with the relevent bug numberEric Fiselier2017-05-052-0/+4
| | | | llvm-svn: 302213
* Add markup for libc++ dylib availabilityMehdi Amini2017-05-04121-80/+646
| | | | | | | | | | | | | | | Libc++ is used as a system library on macOS and iOS (amongst others). In order for users to be able to compile a binary that is intended to be deployed to an older version of the platform, clang provides the availability attribute <https://clang.llvm.org/docs/AttributeReference.html#availability>_ that can be placed on declarations to describe the lifecycle of a symbol in the library. See docs/DesignDocs/AvailabilityMarkup.rst for more information. Differential Revision: https://reviews.llvm.org/D31739 llvm-svn: 302172
* [test] variant: enable constexpr construction tests on MSVC STLCasey Carter2017-05-042-4/+21
| | | | | | | * Add a new macro _MSVC_STL_VER to detect when the MSVC STL is being tested * Workaround C1XX __is_trivially_copyable bug llvm-svn: 302158
* [libcxx] [test] Strip trailing whitespace. NFC.Stephan T. Lavavej2017-05-0423-31/+31
| | | | llvm-svn: 302105
* cmath: Skip Libc for integral types in isinf, etc.Duncan P. N. Exon Smith2017-04-211-0/+33
| | | | | | | | | | | | | | | | | | | | | | | | For std::isinf, the standard requires effectively calling isinf as double from Libc for integral types. But integral types are never infinite; we don't need to call Libc to return false. Also short-circuit other functions where Libc won't have interesting answers: signbit, fpclassify, isfinite, isnan, and isnormal. I added correctness tests for integral types since we're no longer deferring to Libc. In review it was pointed out that in future revisions of the C++ standard we may add more types to std::is_arithmetic (e.g., std::is_fixed_point). I'll leave it to a future commit to hack this to allow using math functions on those. We'll need to change things like __libcpp_fpclassify anyway, so I'm not sure anything here would really be future-proof. https://reviews.llvm.org/D31561 rdar://problem/31361223 llvm-svn: 301060
* Expand test coverage for LWG2857Casey Carter2017-04-213-17/+31
| | | | | | | | | | * Cover optional's emplace-from-initializer_list overload * Verify that any::emplace and optional::emplace return a reference to the correct type even for throwing cases. Differential Revision: https://reviews.llvm.org/D32106 llvm-svn: 301055
* Mark exception_ptr tests as XFAIL on Windows for nowEric Fiselier2017-04-2110-1/+31
| | | | llvm-svn: 300942
* Resolve unused local typedef warning in test.Billy Robert O'Neal III2017-04-211-1/+0
| | | | llvm-svn: 300937
* Fix tests for extended noexcept in the container adaptors testsEric Fiselier2017-04-196-9/+12
| | | | llvm-svn: 300652
* Cleanup _LIBCPP_HAS_NO_<c++11-feature> in the utilities libraryEric Fiselier2017-04-1929-35/+69
| | | | llvm-svn: 300635
* Cleanup _LIBCPP_HAS_NO_<c++11-feature> in the string library.Eric Fiselier2017-04-199-243/+236
| | | | llvm-svn: 300633
* Cleanup _LIBCPP_HAS_NO_<c++11-feature> macros in the numeric tests and headersEric Fiselier2017-04-1930-34/+70
| | | | llvm-svn: 300632
* Cleanup _LIBCPP_HAS_NO_<c++11-features> macro usage in regexEric Fiselier2017-04-184-10/+8
| | | | llvm-svn: 300627
* Cleanup _LIBCPP_HAS_NO_<c++11-feature> in the input.output libraryEric Fiselier2017-04-1821-54/+42
| | | | llvm-svn: 300626
* Cleanup _LIBCPP_HAS_NO_<c++11-feature> in algorithmEric Fiselier2017-04-1815-101/+63
| | | | llvm-svn: 300625
* Cleanup _LIBCPP_HAS_NO_<c++11-feature> macros for std::initializer_listEric Fiselier2017-04-185-15/+27
| | | | llvm-svn: 300623
* Cleanup _LIBCPP_HAS_NO_<c++11-feature> macros in thread.Eric Fiselier2017-04-184-15/+13
| | | | llvm-svn: 300622
* Cleanup _LIBCPP_HAS_NO_<c++11-feature> in std::unordered_map and ↵Eric Fiselier2017-04-1823-149/+51
| | | | | | | | std::unordered_multimap This completes the cleanup of the containers, at least within the tests. llvm-svn: 300620
* Cleanup _LIBCPP_HAS_NO_<c++11-feature> macros in std::unordered_set and ↵Eric Fiselier2017-04-1826-196/+58
| | | | | | std::unordered_multiset llvm-svn: 300619
* Cleanup _LIBCPP_HAS_NO_<c++11-feature> for std::queue and std::priority_queue.Eric Fiselier2017-04-1820-58/+44
| | | | llvm-svn: 300604
* Cleanup _LIBCPP_HAS_NO_<c++11-feature> macro uses in std::stack.Eric Fiselier2017-04-1810-30/+22
| | | | llvm-svn: 300602
* Cleanup _LIBCPP_HAS_NO_<c++11-feature> macros in std::map and std::multimapEric Fiselier2017-04-1821-88/+42
| | | | llvm-svn: 300600
* Cleanup _LIBCPP_HAS_NO_<c++11-feature> for std::set and std::multisetEric Fiselier2017-04-1824-88/+48
| | | | llvm-svn: 300595
* [test] Silence another unused-typedef warningCasey Carter2017-04-181-1/+0
| | | | llvm-svn: 300581
* [test] Silence unused parameter/typedef warningsCasey Carter2017-04-183-4/+2
| | | | llvm-svn: 300575
* Allow a standard library to implement conditional noexcept for optional and ↵Billy Robert O'Neal III2017-04-182-6/+14
| | | | | | | | | | unique_ptr hash functions. These tests were unconditionally asserting that optional and unique_ptr declare throwing hashes, but MSVC++ implements conditional noexcept forwarding that of the underlying hash function. As a result we were failing these tests but there's nothing forbidding strengthening noexcept in that way. Changed the ASSERT_NOT_NOEXCEPT asserts to use types which themselves have non-noexcept hash functions. llvm-svn: 300516
* Fix passing incorrectly value-category when constructing unique_ptr's deleterEric Fiselier2017-04-171-4/+99
| | | | llvm-svn: 300489
* [optional] Update synopsis for LWG2934Casey Carter2017-04-1712-18/+18
| | | | | | (comment-only change) llvm-svn: 300488
* Sigh. Once again forgot about the 'no exceptions' bots.Marshall Clow2017-04-172-0/+8
| | | | llvm-svn: 300451
* Mark LWG#2853 as complete. No code changes required, but added a couple of ↵Marshall Clow2017-04-172-0/+48
| | | | | | extra tests llvm-svn: 300449
* Cleanup one more <forward_list> testEric Fiselier2017-04-162-35/+5
| | | | llvm-svn: 300417
* Replace _LIBCPP_HAS_NO_<C++03 feature> with _LIBCPP_CXX03_LANG in <forward_list>Eric Fiselier2017-04-1611-45/+21
| | | | llvm-svn: 300415
* Replace _LIBCPP_HAS_NO_<C++03 feature> with _LIBCPP_CXX03_LANG in <list>Eric Fiselier2017-04-169-36/+18
| | | | llvm-svn: 300414
* Replace _LIBCPP_HAS_NO_<C++03 feature> with _LIBCPP_CXX03_LANG in dequeEric Fiselier2017-04-1610-42/+20
| | | | llvm-svn: 300413
* Replace _LIBCPP_HAS_NO_<C++03 feature> with _LIBCPP_CXX03_LANG in <array>Eric Fiselier2017-04-161-1/+3
| | | | llvm-svn: 300412
* Workaround Clang bug regarding template template parametersEric Fiselier2017-04-161-5/+11
| | | | llvm-svn: 300411
* Replace _LIBCPP_HAS_NO_<C++03 feature> with _LIBCPP_CXX03_LANG in vector.Eric Fiselier2017-04-1619-81/+43
| | | | | | | | | | | | | This patch cleans up all usages of the following feature test macros inside <vector> and its tests: * _LIBCPP_HAS_NO_RVALUE_REFERENCES * _LIBCPP_HAS_NO_VARIADICS * _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS Where needed the above guards were replaced with _LIBCPP_CXX03_LANG. llvm-svn: 300410
* Overhaul unique_ptr - Implement LWG 2801, 2905, 2520.Eric Fiselier2017-04-1615-67/+746
| | | | | | | | | | | | | | | | | | | | | This patch overhauls both specializations of unique_ptr while implementing the following LWG issues: * LWG 2801 - This issue constrains unique_ptr's constructors when the deleter type is not default constructible. Additionally it adds SFINAE conditions to unique_ptr<T[]>::unique_ptr(Up). * LWG 2905 - This issue reworks the unique_ptr(pointer, /* see below */ deleter) constructors so that they correctly SFINAE when the deleter argument cannot be used to construct the stored deleter. * LWG 2520 - This issue fixes initializing unique_ptr<T[]> from nullptr. Libc++ had previously implemented this issue, but the suggested resolution still broke initialization from NULL. This patch re-works the unique_ptr<T[]>(Up, deleter) overloads so that they accept NULL as well as nullptr. llvm-svn: 300406
* Implement LWG 2857 for variant. Tests from Casey Carter @ Microsoft.Eric Fiselier2017-04-154-30/+83
| | | | | | | Also mark LWG 2857 as complete, since the changes to optional and any were completed by Marshall earlier. llvm-svn: 300403
* Fix PR32642 - string::insert and string::append don't work with move_iterator.Eric Fiselier2017-04-152-4/+45
| | | | llvm-svn: 300397
OpenPOWER on IntegriCloud