summaryrefslogtreecommitdiffstats
path: root/libcxx/test/std
Commit message (Collapse)AuthorAgeFilesLines
...
* Don't "LIBCPP_ONLY(stuff;)" at namespace scope.Casey Carter2016-11-231-3/+3
| | | | | | Differential review: https://reviews.llvm.org/D27029 llvm-svn: 287732
* [libcxx] Fix max_size() across all containersEric Fiselier2016-11-2312-100/+385
| | | | | | | | | | | | Summary: The `max_size()` method of containers should respect both the allocator's reported `max_size` and the range of the `difference_type`. This patch makes all containers choose the smallest of those two values. Reviewers: mclow.lists, EricWF Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D26885 llvm-svn: 287729
* Add <variant> tests but disable them for libc++Eric Fiselier2016-11-2339-0/+4985
| | | | llvm-svn: 287728
* Mark variadic lock guard tests as XFAIL with modules, since they have to ↵Eric Fiselier2016-11-217-1/+24
| | | | | | define macros to expose the new ABI llvm-svn: 287513
* [libcxx] [test] D26812: In random tests, use real static_asserts and silence ↵Stephan T. Lavavej2016-11-186-20/+84
| | | | | | | | | | | | | a warning. In C++11 mode and newer, use real static_asserts. In C++03 mode, min() and max() aren't constexpr, so use plain asserts. One test triggers MSVC's warning C4310 "cast truncates constant value". The code is valid, and yet the warning is valid, so I'm silencing it through push-disable-pop. llvm-svn: 287391
* [libcxx] [test] D26816: Fix non-Standard assumptions when testing sample().Stephan T. Lavavej2016-11-181-3/+14
| | | | | | | | | | | | | sample() isn't specified with a reproducible algorithm, so expecting exact output is non-Standard. Mark those tests with LIBCPP_ASSERT. In test_small_population(), we're guaranteed to get all of the elements, but not necessarily in their original order. When PopulationCategory is forward, we're guaranteed stability (and can therefore test equal()). Otherwise, we can only test is_permutation(). (As it happens, both libcxx and MSVC's STL provide stability in this scenario for input-only iterators.) llvm-svn: 287383
* [libcxx] [test] D26815: Fix an assumption about the state of moved-from ↵Stephan T. Lavavej2016-11-181-2/+2
| | | | | | | | | | | std::functions. The Standard doesn't provide any guarantees beyond "valid but unspecified" for moved-from std::functions. libcxx moves from small targets and leaves them there, while MSVC's STL empties out the source. Mark these assertions as libcxx-specific. llvm-svn: 287382
* [libcxx] [test] D26813: allocator<const T> is non-Standard.Stephan T. Lavavej2016-11-182-18/+18
| | | | | | | | | | N4582 17.6.3.5 [allocator.requirements] says that allocators are given cv-unqualified object types, and N4582 20.9.9 [default.allocator] implies that allocator<const T> is ill-formed (due to colliding address() overloads). Therefore, tests for allocator<const T> should be marked as libcxx-specific (if not removed outright). llvm-svn: 287381
* Test changes for P0504R0 "Revisiting in-place tag types for ↵Eric Fiselier2016-11-175-86/+54
| | | | | | any/optional/variant". Patch from Casey Carter llvm-svn: 287249
* Revert "P0503R0, adopted in Issaquah, rewords some requirements on nullptr_t ↵Vedant Kumar2016-11-153-43/+3
| | | | | | | | | | | | | and istream_iterator. No code changes were needed, but I updated a few tests. Also resolved P0509 and P0521, which required no changes to the library or tests." This reverts commit r286884, because it breaks the Xcode 7 builders: http://lab.llvm.org:8080/green/job/clang-stage1-cmake-RA-expensive/1583 Here is a PR that tracks the issue: https://llvm.org/bugs/show_bug.cgi?id=31016 llvm-svn: 287004
* [libcxx] [test] D26627: Fix ordering assumptions in unordered container tests.Stephan T. Lavavej2016-11-153-32/+17
| | | | llvm-svn: 286984
* [libcxx] [test] D26625: future_error::what() is implementation-defined.Stephan T. Lavavej2016-11-151-4/+6
| | | | llvm-svn: 286983
* [libcxx] [test] D26624: Fix bucket_count() assumptions.Stephan T. Lavavej2016-11-158-96/+96
| | | | | | | | | With a max_load_factor of 1.0, the only guarantee is that bucket_count() >= size(). (Note: setting max_load_factor without rehashing isn't supposed to affect this, because setting max_load_factor is currently specified to be constant time.) llvm-svn: 286982
* Missed one of the try blocks the first time :-(. Thanks to Renato for the ↵Marshall Clow2016-11-151-3/+13
| | | | | | heads up. llvm-svn: 286932
* P0503R0, adopted in Issaquah, rewords some requirements on nullptr_t and ↵Marshall Clow2016-11-143-3/+43
| | | | | | istream_iterator. No code changes were needed, but I updated a few tests. Also resolved P0509 and P0521, which required no changes to the library or tests. llvm-svn: 286884
* Missed a test with exceptions disabled earlier. Oops.Marshall Clow2016-11-141-4/+14
| | | | llvm-svn: 286883
* Implement P0516: 'Clarify That shared_future’s Copy Operations have Wide ↵Marshall Clow2016-11-142-0/+12
| | | | | | Contracts' which was adopted last week in Issaquah llvm-svn: 286877
* Make one of the new tests fail correctly on pre-C++17 systemsMarshall Clow2016-11-141-0/+6
| | | | llvm-svn: 286872
* Implement P0510 'Make future_error Constructible' adopted in IssaquahMarshall Clow2016-11-141-0/+14
| | | | llvm-svn: 286864
* Fixes for LWG 2598, 2686, 2739, 2742, 2747, and 2759, which were adopted ↵Marshall Clow2016-11-1416-4/+451
| | | | | | last week in Issaquah llvm-svn: 286858
* [libcxx] [test] D26314: Fix MSVC warning C4189 "local variable is ↵Stephan T. Lavavej2016-11-1431-270/+216
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | initialized but not referenced". test/std/depr/depr.c.headers/inttypes_h.pass.cpp test/std/input.output/file.streams/c.files/cinttypes.pass.cpp test/std/input.output/iostream.forward/iosfwd.pass.cpp Add test() to avoid a bunch of void-casts, although we still need a few. test/std/input.output/iostream.format/quoted.manip/quoted.pass.cpp skippingws was unused (it's unclear to me whether this was mistakenly copy-pasted from round_trip() below). test/std/localization/locale.categories/category.collate/locale.collate/types.pass.cpp test/std/localization/locale.categories/category.ctype/facet.ctype.special/types.pass.cpp test/std/localization/locale.categories/category.ctype/locale.codecvt/types_char.pass.cpp test/std/localization/locale.categories/category.ctype/locale.codecvt/types_wchar_t.pass.cpp test/std/localization/locale.categories/category.ctype/locale.ctype/types.pass.cpp test/std/localization/locale.categories/facet.numpunct/locale.numpunct/types.pass.cpp test/std/localization/locales/locale.global.templates/use_facet.pass.cpp When retrieving facets, the references are unused. test/std/localization/locale.categories/category.numeric/locale.nm.put/facet.num.put.members/put_long.pass.cpp test/std/localization/locale.categories/category.numeric/locale.nm.put/facet.num.put.members/put_unsigned_long.pass.cpp "std::ios_base::iostate err = ios.goodbit;" was completely unused here. test/std/localization/locale.categories/category.time/locale.time.get/time_base.pass.cpp test/std/numerics/c.math/ctgmath.pass.cpp test/std/numerics/rand/rand.device/entropy.pass.cpp test/std/numerics/rand/rand.device/eval.pass.cpp test/std/strings/basic.string/string.modifiers/string_copy/copy.pass.cpp test/std/strings/char.traits/char.traits.specializations/char.traits.specializations.char16_t/eof.pass.cpp test/std/strings/char.traits/char.traits.specializations/char.traits.specializations.char32_t/eof.pass.cpp test/std/thread/futures/futures.promise/dtor.pass.cpp test/std/thread/futures/futures.task/futures.task.members/dtor.pass.cpp test/std/thread/thread.condition/thread.condition.condvar/wait_for_pred.pass.cpp These variables are verifying types but are otherwise unused. test/std/strings/basic.string/string.capacity/reserve.pass.cpp old_cap was unused (it's unclear to me whether it was intended to be used). test/std/strings/char.traits/char.traits.specializations/char.traits.specializations.char/eq.pass.cpp test/std/strings/char.traits/char.traits.specializations/char.traits.specializations.char16_t/eq.pass.cpp test/std/strings/char.traits/char.traits.specializations/char.traits.specializations.char16_t/lt.pass.cpp test/std/strings/char.traits/char.traits.specializations/char.traits.specializations.char32_t/eq.pass.cpp test/std/strings/char.traits/char.traits.specializations/char.traits.specializations.char32_t/lt.pass.cpp test/std/strings/char.traits/char.traits.specializations/char.traits.specializations.wchar.t/eq.pass.cpp test/std/strings/char.traits/char.traits.specializations/char.traits.specializations.wchar.t/lt.pass.cpp These tests contained unused characters. llvm-svn: 286847
* Protect std::ios tests under libcpp-no-exceptionsRoger Ferrer Ibanez2016-11-145-5/+27
| | | | | | | | | Skip tests that expect an exception be thrown. Also add some missing asserts in the original test. Differential Revision: https://reviews.llvm.org/D26512 llvm-svn: 286823
* Protect nested-exceptions tests under no-exceptionsRoger Ferrer Ibanez2016-11-143-3/+12
| | | | | | Differential Revision: https://reviews.llvm.org/D26458 llvm-svn: 286813
* Update tests for strings conversions under libcpp-no-exceptionsRoger Ferrer Ibanez2016-11-148-8/+84
| | | | | | Differential Revision: https://reviews.llvm.org/D26139 llvm-svn: 286812
* Protect smart-pointer tests under no exceptionsRoger Ferrer Ibanez2016-11-142-2/+8
| | | | | | | | Skip tests that expect an exception be thrown under no-exceptions. Differential Revision: https://reviews.llvm.org/D26457 llvm-svn: 286809
* Implement LWG 2770 - Make tuple_size<T> defined for all TEric Fiselier2016-11-133-4/+30
| | | | llvm-svn: 286779
* Fix PR30979 - tuple<move_only> is constructible from move_only const&Eric Fiselier2016-11-131-0/+50
| | | | llvm-svn: 286774
* Protect bitset tests under libcpp-no-exceptionsRoger Ferrer Ibanez2016-11-104-44/+84
| | | | | | | | | | | | | Bitset tests feature a sequence of tests of increasing bitset sizes, but these tests rely on exceptions when the bitset size is less than 50 elements. This change adds a flag to tell whether a test should throw. If it must throw it will be skipped under no-exceptions. Differential Revision: https://reviews.llvm.org/D26140 llvm-svn: 286474
* Protect std::experimental::optional tests under libcpp-no-exceptionsRoger Ferrer Ibanez2016-11-0713-27/+77
| | | | | | | | | | In these tests there are some paths that explicitly throw, so use the TEST_THROW macro that was proposed for this and then skip the tests that may enter the throwing path. Differential Revision: https://reviews.llvm.org/D26142 llvm-svn: 286099
* [libcxx] [test] Replace _LIBCPP_STD_VER with TEST_STD_VER.Stephan T. Lavavej2016-11-04251-313/+603
| | | | | | | | | | | This replaces every occurrence of _LIBCPP_STD_VER in the tests with TEST_STD_VER. Additionally, for every affected file, #include "test_macros.h" is being added explicitly if it wasn't already there. https://reviews.llvm.org/D26294 llvm-svn: 286007
* Implement another part of P0031; adding constexpr to move_iteratorMarshall Clow2016-11-0224-0/+349
| | | | llvm-svn: 285818
* Remove spurious token from #endifRoger Ferrer Ibanez2016-11-021-1/+1
| | | | llvm-svn: 285792
* Protect tests for new/delete under libcpp-no-exceptionsRoger Ferrer Ibanez2016-11-024-5/+20
| | | | | | | | Skip the tests that expect an exception be thrown and protect unreachable catch blocks. Differential Revision: https://reviews.llvm.org/D26197 llvm-svn: 285791
* Fix __libcpp_is_constructible for source types with explicit conversion ↵Eric Fiselier2016-11-021-2/+118
| | | | | | | | | | | | | | | | | | | | | | operators. Previously __libcpp_is_constructible checked the validity of reference construction using 'eat<To>(declval<From>())' but this doesn't consider From's explicit conversion operators. This patch teaches __libcpp_is_constructible how to handle these cases. To do this we need to check the validity using 'static_cast<To>(declval<From>())'. Unfortunately static_cast allows additional base-to-derived and lvalue-to-rvalue conversions, which have to be checked for and manually rejected. While implementing these changes I discovered that Clang incorrectly rejects `static_cast<int&&>(declval<float&>())` even though `int &&X(declval<float&>())` is well formed. In order to tolerate this bug the `__eat<T>(...)` needs to be left in-place. Otherwise it could be replaced entirely with the new static_cast implementation. Thanks to Walter Brown for providing the test cases. llvm-svn: 285786
* Protect exceptional paths under libcpp-no-exceptionsRoger Ferrer Ibanez2016-11-0128-248/+598
| | | | | | | | | | | | | | | | | | | | | | These tests are of the form try { action-that-may-throw assert(!exceptional-condition) assert(some-other-facts) } catch (relevant-exception) { assert(exceptional-condition) } Under libcpp-no-exceptions there is still value in verifying some-other-facts while avoiding the exceptional case. So for these tests just conditionally check some-other-facts if exceptional-condition is false. When exception are supported make sure that a true exceptional-condition throws an exception Differential Revision: https://reviews.llvm.org/D26136 llvm-svn: 285697
* Protect lock tests under libcpp-no-exceptionsRoger Ferrer Ibanez2016-11-0113-18/+86
| | | | | | | | Skip tests that expect an exception to be thrown. Differential Revision: https://reviews.llvm.org/D26184 llvm-svn: 285695
* Protect tests that expect an exception for an unknown std::random_deviceRoger Ferrer Ibanez2016-11-012-2/+4
| | | | | | | | Skip these tests under libcpp-no-exceptions. Differential Revision: https://reviews.llvm.org/D26141 llvm-svn: 285677
* Change from "XFAIL: libcpp-no-exceptions" to "UNSUPPORTED: ↵Roger Ferrer Ibanez2016-10-3122-22/+22
| | | | | | | | | | | | | libcpp-no-exceptions" tests that only check exceptions and nothing else This is a follow up of D24562. These tests do not check anything but exceptions, so it makes sense to mark them as UNSUPPORTED under a library built without exceptions. Differential Revision: https://reviews.llvm.org/D26075 llvm-svn: 285550
* Fix _LIBCPP_EXTERN_TEMPLATE_INLINE_VISIBILITY to always have default visibility.Eric Fiselier2016-10-311-0/+5
| | | | | | | | | | | This prevent the symbols from being both externally available and hidden, which causes them to be linked incorrectly. This is only a problem when the address of the function is explicitly taken since it will always be inlined otherwise. This patch fixes the issues that caused r285456 to be reverted, and can now be reapplied. llvm-svn: 285531
* Add more tests for optional<const T>Eric Fiselier2016-10-286-0/+29
| | | | llvm-svn: 285384
* [libcxx] Make regex_match backtrack when search failsTim Shen2016-10-271-10/+52
| | | | | | | | | | | | | | | | Summary: Fixes PR19851. alg.re.match/ecma.pass.cpp still XFAILS on linux, but after commenting out locale-related tests, it passes. I don't have a freebsd machine to produce a full pass. Reviewers: mclow.lists Subscribers: cfe-commits, emaste Differential Revision: https://reviews.llvm.org/D26026 llvm-svn: 285352
* [PATCH] D25483: [libcxx] [test] Fix non-Standard assumptions about how many ↵Stephan T. Lavavej2016-10-2712-16/+31
| | | | | | elements are allocated llvm-svn: 285346
* Cleanup nonportable behavior in tests for std::anyCasey Carter2016-10-263-8/+4
| | | | | | | | | | | | | | | | | Fixes MS issues 63, 64, and 65. test/std/utilities/any/any.class/any.cons/move.pass.cpp: * "Moves are always destructive" is not a portable assumption; check with LIBCPP_ASSERT. test/std/utilities/any/any.class/any.cons/value.pass.cpp: * The standard does not forbid initializing std::any from any pointer-to-function type. Remove the non-conforming "DecayTag" test. test/std/utilities/any/any.class/any.modifiers/swap.pass.cpp: * Self-swap is not specified to perform no moves; check with LIBCPP_ASSERT. Differential Revision: https://reviews.llvm.org/D26007 llvm-svn: 285234
* Fix nullptr testsEric Fiselier2016-10-251-8/+17
| | | | llvm-svn: 285117
* Fix non-portable tests for temp_directory_path(...)Eric Fiselier2016-10-241-8/+11
| | | | llvm-svn: 285020
* Add missing include in string_view tests. Patch from Billy ONeil @ microsoftEric Fiselier2016-10-241-0/+1
| | | | llvm-svn: 285012
* Fix shadow warnings in string_view tests. Patch from STL@microsoft.comEric Fiselier2016-10-242-22/+20
| | | | llvm-svn: 285011
* Fix libc++ specific assertion in permissions(...) testsEric Fiselier2016-10-231-1/+2
| | | | llvm-svn: 284945
* Make make_from_tuple tests more portable. Patch from STL@microsoft.comEric Fiselier2016-10-231-4/+4
| | | | llvm-svn: 284943
* Fix unreferenced parameters. Patch from STL@microsoft.comEric Fiselier2016-10-233-3/+3
| | | | llvm-svn: 284942
OpenPOWER on IntegriCloud