summaryrefslogtreecommitdiffstats
path: root/libcxx/test
Commit message (Collapse)AuthorAgeFilesLines
...
* [libcxx] [test] Avoid unary_function.Stephan T. Lavavej2018-04-121-1/+3
| | | | | | | | | | | Replace unary_function inheritance (which was never required, even in C++98) with argument_type and result_type typedefs. This increases portability, as unary_function was removed in C++17 and MSVC has implemented that removal. Fixes D45596. llvm-svn: 329974
* [libcxx] [test] Avoid MSVC truncation warnings.Stephan T. Lavavej2018-04-123-4/+4
| | | | | | | | | | | | | | | | | | | MSVC emits "warning C4244: 'initializing': conversion from 'int' to 'short', possible loss of data" when it sees pair<Whatever, short> constructed from (whatever, 4), because int is being truncated to short within pair's constructor. (The compiler doesn't take into account the fact that 4 is a literal at the callsite; it generates this warning when the constructor is instantiated, because it might be called with a runtime-valued int that would actually truncate.) Instead of static_cast<short>, we can simply change short to int in these tests, without affecting the pair operations that they're trying to test: move assignment, convert copy construction, and convert move construction. Fixes D45016. llvm-svn: 329973
* [libcxx] [test] Use the correct type from strlen. Include correct header.Billy Robert O'Neal III2018-04-104-7/+10
| | | | llvm-svn: 329665
* [test] [NFC] cleanup aligned_storage testCasey Carter2018-04-091-106/+55
| | | | | | | * `s/"" )/"")/g` * Don't redundantly test triviality for `TEST_STD_VER > 17` llvm-svn: 329618
* [test] Fix Container::insert(value_type const&) testsEric Fiselier2018-04-0810-405/+293
| | | | | | | | | | | Patch from Joe Loser. Several unit tests meaning to test the behavior of lvalue insertion incorrectly pass rvalues. Fixes bug PR # 27394 Reviewed as https://reviews.llvm.org/D44411 llvm-svn: 329541
* [libcxx][test] Silence -Wself-assign diagnosticsRoman Lebedev2018-04-072-7/+7
| | | | | | | | | | | | | | | | | | | | Summary: D44883 extends -Wself-assign to also work on C++ classes. These new warnings pop up in the test suite, so they have to be silenced. Please refer to the D45082 for disscussion on whether this is the right way to solve this. Testing: `ninja check-libcxx check-libcxxabi` in stage-2 build. Reviewers: mclow.lists, EricWF Reviewed By: EricWF Subscribers: Quuxplusone, cfe-commits Differential Revision: https://reviews.llvm.org/D45128 llvm-svn: 329490
* Implement P0768r1: Library support for the Spaceship Operator.Eric Fiselier2018-04-069-0/+830
| | | | | | | | | | | | this patch adds the <compare> header and implements all of it except for [comp.alg]. As I understand it, the header is needed by the compiler in when implementing the semantics of operator<=>. For that reason I feel it's important to land this header early, despite all compilers lacking support. llvm-svn: 329460
* [coroutines] libcxx, noop_coroutine, make bots even more happyGor Nishanov2018-04-051-1/+0
| | | | llvm-svn: 329245
* [coroutines] libcxx noop_coroutine. Make bots happierGor Nishanov2018-04-041-0/+10
| | | | llvm-svn: 329240
* [coroutines] Add noop_coroutine to <experimental/coroutine>Gor Nishanov2018-04-041-0/+66
| | | | | | | | | | | | | | A recent addition to Coroutines TS (https://wg21.link/p0913) adds a pre-defined coroutine noop_coroutine that does nothing. This patch implements require library types in <experimental/coroutine> Related clang and llvm patches: https://reviews.llvm.org/D45114 https://reviews.llvm.org/D45120 llvm-svn: 329237
* [libcxx][test] Fix fs::proximate tests on platforms where /net exists.Jan Korous2018-04-041-1/+1
| | | | | | Following Eric's patch. llvm-svn: 329199
* [libcxx][test] Improve assert messageJan Korous2018-04-041-3/+11
| | | | llvm-svn: 329194
* Fix undefined macro issue in locale tests; Try 2Eric Fiselier2018-04-043-9/+15
| | | | llvm-svn: 329149
* Fix undefined macro issue in locale testsEric Fiselier2018-04-042-1/+7
| | | | llvm-svn: 329148
* Touch up tests for new <version> header; fix module.modulemap.Eric Fiselier2018-04-042-3/+1
| | | | | | | | | | | This patch does some housekeeping for the new <version> header. It adds it to the module.modulemap, and the double_include.sh.cpp test. Additionally it corrects the // UNSUPPORTED options for the libc++ specific test. The header needs to compile under C++03 to support modules, and it should compile under all available compilers. llvm-svn: 329144
* Fix locale test data for GLIBC 2.27 and newer.Eric Fiselier2018-04-045-38/+100
| | | | | | | | GLIBC 2.27 changed the locale data for fr_FR and ru_RU. In particular they change the decimal and thousands separators used. This patch makes the locale tests tolerate the updated locales. llvm-svn: 329143
* Implement P0754R2: The <version> header.Marshall Clow2018-04-032-0/+40
| | | | llvm-svn: 329075
* Fix fs::proximate tests on platforms where /net exists.Eric Fiselier2018-04-031-4/+4
| | | | | | | | | The proximate tests depended on `/net` not being a valid path, however, on OS X it is. Correct the tests to handle this. llvm-svn: 329038
* Implement P0430R2 - File system library on non-POSIX systems.Eric Fiselier2018-04-022-8/+54
| | | | | | | | | | | This patch implements P0430R2, who's largest change is adding the path::format enumeration for supporting path format conversions in path constructors. However, since libc++'s filesystem only really supports POSIX like systems, there are no real changes needed. This patch simply adds the format enum and then ignores it when it's passed to constructors. llvm-svn: 329031
* Implement filesystem NB comments, relative paths, and related issues.Eric Fiselier2018-04-0222-341/+978
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is a fairly large patch that implements all of the filesystem NB comments and the relative paths changes (ex. adding weakly_canonical). These issues and papers are all interrelated so their implementation couldn't be split up nicely. This patch upgrades <experimental/filesystem> to match the C++17 spec and not the published experimental TS spec. Some of the changes in this patch are both API and ABI breaking, however libc++ makes no guarantee about stability for experimental implementations. The major changes in this patch are: * Implement NB comments for filesystem (P0492R2), including: * Implement `perm_options` enum as part of NB comments, and update the `permissions` function to match. * Implement changes to `remove_filename` and `replace_filename` * Implement changes to `path::stem()` and `path::extension()` which support splitting examples like `.profile`. * Change path iteration to return an empty path instead of '.' for trailing separators. * Change `operator/=` to handle absolute paths on the RHS. * Change `absolute` to no longer accept a current path argument. * Implement relative paths according to NB comments (P0219r1) * Combine `path.cpp` and `operations.cpp` since some path functions require access to the operations internals, and some fs operations require access to the path parser. llvm-svn: 329028
* [libcxx] Disable testing with system lib for 2 tests verifying debug mode.Volodymyr Sapsai2018-04-022-0/+6
| | | | llvm-svn: 329023
* fix typo in align_const_pair_U_V.pass.cppEric Fiselier2018-03-291-1/+1
| | | | llvm-svn: 328760
* Move libc++ pair/tuple assign test to libcxx/ test directory.Eric Fiselier2018-03-293-44/+46
| | | | | | | | | | | Libc++ implements the pair& operator=(pair<U, V>) assignment operator using a single template that handles assignment from all tuple-like types. This patch moves the test for that to the libcxx test directory since it's non-standard. It also adds additional tests to the std/.../pair directory to test the standard behavior this template implements. llvm-svn: 328758
* Fix PR36914 - num_get::get(unsigned) incorrectly handles negative numbers.Eric Fiselier2018-03-292-10/+172
| | | | | | | | | This patch corrects num_get for unsigned types to support strings with a leading `-` character. According to the standard the number should be parsed as an unsigned integer and then negated. llvm-svn: 328751
* Fix test case initialization issues in permissions testEric Fiselier2018-03-261-1/+7
| | | | llvm-svn: 328477
* Implement filesystem::perm_options specified in NB comments.Eric Fiselier2018-03-264-41/+55
| | | | | | | | | | The NB comments for filesystem changed permissions and added a new enum `perm_options` which control how the permissions are applied. This implements than NB resolution llvm-svn: 328476
* Make filesystem tests generic between experimental and std versions.Eric Fiselier2018-03-26109-235/+192
| | | | | | | | | | | | | | | As I move towards implementing std::filesystem, there is a need to make the existing tests run against both the std and experimental versions. Additionally, it's helpful to allow running the tests against other implementations of filesystem. This patch converts the test to easily target either. First, it adds a filesystem_include.hpp header which is soley responsible for selecting and including the correct implementation. Second, it converts existing tests to use this header instead of including filesystem directly. llvm-svn: 328475
* avoid new/delete ellision in construct.pass.cppEric Fiselier2018-03-251-0/+4
| | | | llvm-svn: 328445
* Add temporary printouts to test to help debug failures.Eric Fiselier2018-03-222-0/+12
| | | | | | | | | | | Some debian libc++ bots started having failures in the locale tests due to what I assume is a change in the locale data for fr_FR in glibc. This change prints the actual value from the test to help debugging. It should be reverted once the bots cycle. llvm-svn: 328268
* Avoid Clang error about throwing _LIBCPP_ASSERT in noexcept function.Eric Fiselier2018-03-223-20/+25
| | | | | | | | | | | | | This fixes a couple of tests which produced a warning that a 'throw' occurred in a noexcept function (by way of _LIBCPP_ASSERT). It does so by hiding the 'throw' across an opaque function boundary. This fix isn't ideal, since we still have _LIBCPP_ASSERT's in functions marked noexcept -- and this problem should be addressed in the future. However, throwing _LIBCPP_ASSERT is really only meant to allow testing of the assertions, and is not yet ready for general use. llvm-svn: 328265
* [libcxx] [test] Strip trailing whitespace. NFC.Stephan T. Lavavej2018-03-223-4/+4
| | | | llvm-svn: 328264
* Workaround GCC bug PR78489 - SFINAE order is not respected.Eric Fiselier2018-03-221-0/+6
| | | | | | | | | | | This patch works around variant test failures which are new to GCC 8. GCC 8 either doesn't perform SFINAE in lexical order, or it doesn't halt after encountering the first failure. This causes hard error to occur instead of substitution failure. See gcc.gnu.org/PR78489 llvm-svn: 328261
* Use DoNotOptimize to prevent new/delete elision.Eric Fiselier2018-03-2217-47/+74
| | | | | | | | | | | The new/delete tests, in particular those which test replacement functions, often fail when the optimizer is enabled because the calls to new/delete may be optimized away, regardless of their side-effects. This patch converts the tests to use DoNotOptimize in order to prevent the elision. llvm-svn: 328245
* Un-XFAIL a test under new GCC version; the GCC bug has been fixedEric Fiselier2018-03-221-1/+1
| | | | llvm-svn: 328229
* Fix improperly failing test - and the code it was testing. Thanks to Stephan ↵Marshall Clow2018-03-221-3/+4
| | | | | | Lavavej for the catch. llvm-svn: 328225
* Correct TEST_HAS_NO_ALIGNED_ALLOCATION macro definitionEric Fiselier2018-03-221-2/+3
| | | | llvm-svn: 328185
* Fix PR22634 - std::allocator doesn't respect over-aligned types.Eric Fiselier2018-03-223-27/+246
| | | | | | | | | | | | | | | | | | | | This patch fixes std::allocator, and more specifically, all users of __libcpp_allocate and __libcpp_deallocate, to support over-aligned types. __libcpp_allocate/deallocate now take an alignment parameter, and when the specified alignment is greater than that supported by malloc/new, the aligned version of operator new is called (assuming it's available). When aligned new isn't available, the old behavior has been kept, and the alignment parameter is ignored. This patch depends on recent changes to __builtin_operator_new/delete which allow them to be used to call any regular new/delete operator. By using __builtin_operator_new/delete when possible, the new/delete erasure optimization is maintained. llvm-svn: 328180
* Implement LWG3034: P0767R1 breaks previously-standard-layout typesMarshall Clow2018-03-216-2/+179
| | | | llvm-svn: 328064
* Implement LWG3035: std::allocator's constructors should be constexpr.Marshall Clow2018-03-201-0/+50
| | | | llvm-svn: 328059
* [libcxx][test] Adding apple-clang-9 to UNSUPPORTED in ↵Mike Edwards2018-03-121-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | iter_alloc_deduction.fail.cpp. After two failed attempts last week to make this work I am going back to a known good method of making this test pass on macOS...adding the current apple-clang version to the UNSUPPORTED list. During a previous patch review (https://reviews.llvm.org/D44103) it was suggested to just XFAIL libcpp-no-deduction-guides as was done to iter_alloc_deduction.pass.cpp. However this caused a an unexpected pass on: http://lab.llvm.org:8011/builders/libcxx-libcxxabi-x86_64-linux-ubuntu-gcc-tot-latest-std/builds/214 I then attempted to just mark libcpp-no-deduction-guides as UNSUPPORTED, however this caused an additional bot failure. So I reverted everything (https://reviews.llvm.org/rCXX327191). To solve this and get work unblocked I am adding apple-clang-9 to the original UNSUPPORTED list. llvm-svn: 327304
* [libcxx][test] Reverting r327178 and r327190.Mike Edwards2018-03-101-1/+2
| | | | | | | Reverting changes made to iter_alloc_deduction.fail.cpp as my changes seem to be making several Linux bots angry. llvm-svn: 327191
* [libcxx][test] Marking libcpp-no-deduction-guides unsupported.Mike Edwards2018-03-101-1/+1
| | | | | | This fixes linux bot failures with r327178. llvm-svn: 327190
* XFAIL: libcpp-no-deduction-guides in ↵Mike Edwards2018-03-091-2/+1
| | | | | | | | | | | | | | | | libcxx/test/std/strings/basic.string/string.cons/iter_alloc_deduction.fail.cpp Summary: Refactor the previous version method of marking each apple-clang version as UNSUPPORTED and just XFAIL'ing the libcpp-no-deduction-guides instead. This brings this test inline with the same style as iter_alloc_deduction.pass.cpp Reviewers: EricWF, dexonsmith Reviewed By: EricWF Subscribers: EricWF, vsapsai, vsk, cfe-commits Differential Revision: https://reviews.llvm.org/D44103 llvm-svn: 327178
* Low-hanging fruit optimization in string::__move_assign().Vedant Kumar2018-03-081-0/+48
| | | | | | | | | | | | | | | shrink_to_fit() ends up doing a lot work to get information that we already know since we just called clear(). This change seems concise enough to be worth the couple extra lines and my benchmarks show that it is indeed a pretty decent win. It looks like the same thing is going on twice in __copy_assign_alloc(), but I didn't want to go overboard since this is my first contribution to llvm/libc++. Patch by Timothy VanSlyke! Differential Revision: https://reviews.llvm.org/D41976 llvm-svn: 327064
* Include <system_error> since we use it. Thanks to Andrey Maksimov for the catch.Marshall Clow2018-03-071-0/+1
| | | | llvm-svn: 326958
* One more test for P0767:Marshall Clow2018-03-061-0/+8
| | | | llvm-svn: 326802
* Implement P0767R1 - Deprecate PODMarshall Clow2018-03-063-1/+114
| | | | llvm-svn: 326801
* [libcxx] Fix last_write_time test for filesystems that don't support very ↵Volodymyr Sapsai2018-02-281-10/+32
| | | | | | | | | | | | | | | | | | | | | small times. APFS minimum supported file write time is -2^63 nanoseconds, which doesn't go as far as `file_time_type::min()` that is equal to -2^63 microseconds on macOS. This change doesn't affect filesystems that support `file_time_type` range only for in-memory file time representation but not for on-disk representation. Such filesystems are considered as `SupportsMinTime`. rdar://problem/35865151 Reviewers: EricWF, Hahnfeld Subscribers: jkorous-apple, mclow.lists, cfe-commits, christof Differential Revision: https://reviews.llvm.org/D42755 llvm-svn: 326383
* [libcxx] [test] Fix MSVC warnings and errors.Stephan T. Lavavej2018-02-2610-75/+76
| | | | | | | | | | | | | | | | | | | | | | | | test/std/numerics/numeric.ops/exclusive.scan/exclusive_scan.pass.cpp test/std/numerics/numeric.ops/exclusive.scan/exclusive_scan_init_op.pass.cpp test/std/numerics/numeric.ops/inclusive.scan/inclusive_scan.pass.cpp test/std/numerics/numeric.ops/inclusive.scan/inclusive_scan_op.pass.cpp test/std/numerics/numeric.ops/inclusive.scan/inclusive_scan_op_init.pass.cpp test/std/numerics/numeric.ops/transform.exclusive.scan/transform_exclusive_scan_init_bop_uop.pass.cpp test/std/numerics/numeric.ops/transform.inclusive.scan/transform_inclusive_scan_bop_uop.pass.cpp test/std/numerics/numeric.ops/transform.inclusive.scan/transform_inclusive_scan_bop_uop_init.pass.cpp Fix MSVC x64 truncation warnings. warning C4267: conversion from 'size_t' to 'int', possible loss of data test/std/strings/basic.string/string.modifiers/string_append/push_back.pass.cpp Fix MSVC uninitialized memory warning. warning C6001: Using uninitialized memory 'vl'. test/std/utilities/tuple/tuple.tuple/tuple.cnstr/PR20855_tuple_ref_binding_diagnostics.pass.cpp Include <cassert> for the assert() macro. Fixes D43273. llvm-svn: 326120
* Allow passing additional compiler/linker flags for the testsAlexander Richardson2018-02-232-0/+8
| | | | | | | | | | | | | | | | | | | Summary: These flags can be specified using the CMake variables LIBCXX_TEST_LINKER_FLAGS and LIBCXX_TEST_COMPILER_FLAGS. When building the tests for CHERI I need to pass additional flags (such as -mabi=n64 or -mabi=purecap) to the compiler for our test configurations Reviewers: EricWF Reviewed By: EricWF Subscribers: christof, mgorny, cfe-commits Differential Revision: https://reviews.llvm.org/D42139 llvm-svn: 325914
OpenPOWER on IntegriCloud