summaryrefslogtreecommitdiffstats
path: root/libcxx/test/std/experimental
Commit message (Collapse)AuthorAgeFilesLines
...
* Move more _LIBCPP_VERSION tests to test/libcxx.Eric Fiselier2016-06-223-60/+0
| | | | llvm-svn: 273365
* 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-191-6/+6
| | | | | | | | | | | | | | | | | | | | | | | * 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
* 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
* Work around GCC bug in tests. The bug has been fixed in GCC 6.0Eric Fiselier2016-06-171-2/+2
| | | | llvm-svn: 273068
* Fix initialization of test case array in C++11Eric Fiselier2016-06-171-1/+3
| | | | llvm-svn: 273065
* Fix bugs in recursive_directory_iterator implementation and tests.Eric Fiselier2016-06-172-24/+45
| | | | | | | | | | | There are two fixes in this patch: * Fix bug where the constructor of recursive_directory_iterator did not reset the error code if no failure occurred. * Fix tests were dependent on the iteration order of the test directories. llvm-svn: 273060
* Get filesystem tests passing for single-threaded configurations.Eric Fiselier2016-06-176-14/+3
| | | | llvm-svn: 273054
* Update status of filesystem issues, and add tests for LWG issue 2683Eric Fiselier2016-06-171-13/+13
| | | | llvm-svn: 273051
* Reorder permissions test so they are not dependent on the processes umaskEric Fiselier2016-06-171-4/+4
| | | | llvm-svn: 273049
* Respect the processes umask in the create_directory testEric Fiselier2016-06-171-9/+11
| | | | llvm-svn: 273048
* Fix a couple of warnings present in the filesystem tests.Eric Fiselier2016-06-173-4/+16
| | | | llvm-svn: 273035
* Add Filesystem TS -- CompleteEric Fiselier2016-06-17123-0/+10116
| | | | | | | | | | | | | | Add the completed std::experimental::filesystem implementation and tests. The implementation supports C++11 or newer. The TS is built as part of 'libc++experimental.a'. Users of the TS need to manually link this library. Building and testing the TS can be disabled using the CMake option '-DLIBCXX_ENABLE_FILESYSTEM=OFF'. Currently 'libc++experimental.a' is not installed by default. To turn on the installation of the library use '-DLIBCXX_INSTALL_EXPERIMENTAL_LIBRARY=ON'. llvm-svn: 273034
* Replace __cplusplus comparisons and dialect __has_feature checks with ↵Eric Fiselier2016-06-1420-24/+56
| | | | | | | | | TEST_STD_VER. This is a huge cleanup that helps make the libc++ test suite more portable. Patch from STL@microsoft.com. Thanks STL! llvm-svn: 272716
* Found a couple bugs in the test suite. No functionality change.Marshall Clow2016-06-141-2/+2
| | | | llvm-svn: 272679
* Fix warnings in tests.Eric Fiselier2016-06-141-31/+25
| | | | llvm-svn: 272629
* Add `REQUIRES: c++experimental` where appropriate.Dan Albert2016-06-1027-0/+27
| | | | | | | | | | | | | | Summary: I haven't added it to all the tests, just those that fail without it (those that aren't header only). Reviewers: EricWF, mclow.lists Subscribers: cfe-commits Differential Revision: http://reviews.llvm.org/D21247 llvm-svn: 272443
* Remove trailing whitespace in test suite. Approved by Marshall Clow.Eric Fiselier2016-06-0172-147/+147
| | | | llvm-svn: 271435
* Make string_view work with -fno-exceptions and get tests passing.Eric Fiselier2016-05-308-57/+102
| | | | llvm-svn: 271237
* Fix bug in test allocator that incorrectly computed the allocation sizeEric Fiselier2016-05-301-1/+1
| | | | llvm-svn: 271195
* [libcxx] Improve tests to use the UNSUPPORTED lit directiveAsiri Rathnayake2016-05-2867-352/+76
| | | | | | | | | | | | | | | | | | | Quite a few libcxx tests seem to follow the format: #if _LIBCPP_STD_VER > X // Do test. #else // Empty test. #endif We should instead use the UNSUPPORTED lit directive to exclude the test on earlier C++ standards. This gives us a more accurate number of test passes for those standards and avoids unnecessary conflicts with other lit directives on the same tests. Reviewers: bcraig, ericwf, mclow.lists Differential revision: http://reviews.llvm.org/D20730 llvm-svn: 271108
* Add experimental container alias templates for PMRsEric Fiselier2016-05-0710-0/+576
| | | | llvm-svn: 268841
* Add <experimental/memory_resource>Eric Fiselier2016-05-0740-0/+2732
| | | | | | | | | | Reviewers: mclow.lists, EricWF Subscribers: cfe-commits Differential Revision: http://reviews.llvm.org/D20007 llvm-svn: 268829
* Add 'is_callable' and 'is_nothrow_callable' traits and cleanup INVOKE.Eric Fiselier2016-04-201-5/+0
| | | | | | | | | | | | 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
* Implement P0253R1: Fixing a design mistake in the searchers interface.Marshall Clow2016-03-0811-13/+16
| | | | llvm-svn: 262928
* implement ostream_joiner. Reviewed as http://reviews.llvm.org/D16605Marshall Clow2016-01-287-0/+381
| | | | llvm-svn: 259014
* Add a bunch of missing includes in the test suite to make it more portable. ↵Marshall Clow2016-01-121-0/+1
| | | | | | Fixes bugs #26120 and #26121. Thanks to Jonathan Wakely for the reports and the patches. llvm-svn: 257474
* Make it possible to build a no-exceptions variant of libcxx.Asiri Rathnayake2015-11-1021-0/+21
| | | | | | | | | | | | Fixes a small omission in libcxx that prevents libcxx being built when -DLIBCXX_ENABLE_EXCEPTIONS=0 is specified. This patch adds XFAILS to all those tests that are currently failing on the new -fno-exceptions library variant. Follow-up patches will update the tests (progressively) to cope with the new library variant. Change-Id: I4b801bd8d8e4fe7193df9e55f39f1f393a8ba81a llvm-svn: 252598
* Suppress array initialization warnings in std::experimental::apply testsEric Fiselier2015-10-013-0/+13
| | | | llvm-svn: 248987
* Implementation of Boyer-Moore and Boyer-Moore-Horspool searchers for the LFTS.Marshall Clow2015-09-089-0/+1035
| | | | llvm-svn: 247036
* Suppress clang warnings in some testsEric Fiselier2015-08-303-22/+9
| | | | llvm-svn: 246399
* Finally get the test suite passing in C++03!!Eric Fiselier2015-08-281-2/+2
| | | | | | | | | After months of work there are only 4 tests still failing in C++03. This patch fixes those tests. All of the libc++ builders should be green. llvm-svn: 246275
* [libcxx] Add <experimental/any> v2.Eric Fiselier2015-07-3120-0/+1802
| | | | | | | | | | | | | | | | Summary: This patch adds the second revision of <experimental/any>. I've been working from the LFTS draft found at this link. https://rawgit.com/cplusplus/fundamentals-ts/v1/fundamentals-ts.html#any Reviewers: danalbert, jroelofs, K-ballo, mclow.lists Subscribers: cfe-commits Differential Revision: http://reviews.llvm.org/D6762 llvm-svn: 243728
* Mark new tests as unsupported before C++11Marshall Clow2015-07-204-1/+9
| | | | llvm-svn: 242695
* Implement the default searcher for std::experimental::search.Marshall Clow2015-07-207-0/+405
| | | | llvm-svn: 242682
* Implement the plugin-based version of std::search. There are no searchers ↵Marshall Clow2015-07-201-0/+43
| | | | | | yet; those are coming soon. llvm-svn: 242679
* Implement std::experimental::sample.Evgeniy Stepanov2015-05-133-0/+235
| | | | | | | Following specification in "C++ Extensions for Library Fundamentals": http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2015/n4480.html#alg.random.sample llvm-svn: 237264
* Remove constexpr support for std::apply because it introduces regressions.Eric Fiselier2015-04-192-0/+8
| | | | llvm-svn: 235274
* [libcxx] Add <experimental/tuple> header for LFTS.Eric Fiselier2015-03-1712-0/+1561
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: This patch adds the `<experimental/tuple>` header (almost) as specified in the latest draft of the library fundamentals TS. The main changes in this patch are: 1. Added variable template `tuple_size_v` 2. Added function `apply(Func &&, Tuple &&)`. 3. Changed `__invoke` to be `_LIBCPP_CONSTEXPR_AFTER_CXX11`. The `apply(...)` implementation uses `__invoke` to invoke the given function. `__invoke` already provides the required functionality. Using `__invoke` also allows `apply` to be used on pointers to member function/objects as an extension. In order to facilitate this `__invoke` has to be marked `constexpr`. Test Plan: Each new feature was tested. The test cases for `tuple_size_v` are as follows: 1. tuple_size_v.pass.cpp - Check `tuple_size_v` on cv qualified tuples, pairs and arrays. 2. tuple_size_v.fail.cpp - Test on reference type. 3. tuple_size_v_2.fail.cpp - Test on non-tuple 4. tuple_size_v_3.fail.cpp - Test on pointer type. The test cases for tuple.apply are as follows: 1. arg_type.pass.cpp - Ensure that ref/pointer/cv qualified types are properly passed. 2. constexpr_types.pass.cpp - Ensure constexpr evaluation of apply is possible for `tuple` and `pair`. 3. extended_types.pass.cpp - Test apply on function types permitted by extension. 4. large_arity.pass.cpp - Test that apply can evaluated on tuples and arrays with large sizes. 5. ref_qualifiers.pass.cpp - Test that apply respects ref qualified functions. 6. return_type.pass.cpp - Test that apply returns the proper type. 7. types.pass.cpp - Test apply on function types as required by LFTS. Reviewers: mclow.lists Reviewed By: mclow.lists Subscribers: cfe-commits Differential Revision: http://reviews.llvm.org/D4512 llvm-svn: 232515
* Remove XFAIL on string view test for apples clang compiler. Thanks to ↵Eric Fiselier2015-02-241-1/+1
| | | | | | Marshall for the fix llvm-svn: 230322
* [libcxx] Add <experimental/ratio>Eric Fiselier2015-02-178-0/+360
| | | | | | | | | | | | | | | | | Summary: This patch is pretty simple. It just adds the _v traits from <ratio>. The draft can be found here. Reviewers: jroelofs, K-ballo, mclow.lists Reviewed By: mclow.lists Subscribers: cfe-commits Differential Revision: http://reviews.llvm.org/D7351 llvm-svn: 229509
* Remove undefined behavior from test; specifically, compare(NULL, XXX, 0)Marshall Clow2015-02-121-1/+1
| | | | llvm-svn: 228928
* Remove undefined behavior from test; specifically, compare(NULL, XXX, 0). ↵Marshall Clow2015-02-121-2/+1
| | | | | | Thanks to Eric for the catch llvm-svn: 228927
* Add pragma system header to some experimental headers and add newlines to files.Eric Fiselier2015-02-101-1/+1
| | | | llvm-svn: 228712
OpenPOWER on IntegriCloud