summaryrefslogtreecommitdiffstats
path: root/libcxx/test/std/numerics/numeric.ops
Commit message (Collapse)AuthorAgeFilesLines
* [NFC] Strip trailing whitespace from libc++Louis Dionne2019-10-232-5/+5
|
* [libc++][test] Miscellaneous MSVC cleanupsCasey Carter2019-10-091-3/+3
| | | | | | | | | | | | * Silence unused-local-typedef warnings: `map.cons/assign_initializer_list.pass.cpp` (and the `set.cons` variant) uses a local typedef only within `LIBCPP_ASSERT`s, so clang diagnoses it as unused when testing non-libc++. * Add missing include: `c.math/abs.pass.cpp` uses `std::numeric_limits` but failed to `#include <limits>`. * Don't test non-type: A "recent" change to `meta.trans.other/underlying_type.pass.cpp` unconditionally tests the type `F` which is conditionally defined. * Use `hash<long long>` instead of `hash<short>` with `int` in `unordered_meow` deduction guide tests to avoid truncation warnings. * Convert `3.14` explicitly in `midpoint.float.pass` since MSVC incorrectly diagnoses `float meow = 3.14;` as truncating. Differential Revision: https://reviews.llvm.org/D68681 llvm-svn: 374248
* Disable the 'nextafter' portions of these tests on PPC when using 128-bit ↵Marshall Clow2019-06-181-19/+27
| | | | | | doubles because the 'nextafter' call doesn't work right. Reviewed as https://reviews.llvm.org/D62384. Thanks to Xing Xue for the patch, and Hubert for the explanation. llvm-svn: 363740
* Fix the floating point version of midpoint. It wasn't constexpr, among other ↵Marshall Clow2019-06-181-5/+16
| | | | | | things. Add more tests. As a drive-by, the LCD implementation had a class named '__abs' which did a 'absolute value to a common-type' conversion. Rename that to be '__ct_abs'. llvm-svn: 363714
* Add include for 'test_macros.h' to all the tests that were missing them. ↵Marshall Clow2019-05-3122-0/+23
| | | | | | Thanks to Zoe for the (big, but simple) patch. NFC intended. llvm-svn: 362252
* Add additional constraints on midpoint(pointer, pointer). Fixes PR#42037.Marshall Clow2019-05-291-3/+12
| | | | llvm-svn: 361970
* [libc++] [test] Use std::nextafter() instead of std::nexttoward()Michal Gorny2019-05-141-2/+2
| | | | | | | | | | | | Use std::nextafter() instead of std::nexttoward() in midpoint tests. In the context of this test, this should not cause any difference. Since nexttowardl() is not implemented on NetBSD 8, the latter function combined with 'long double' type caused test failure. nextafterl() does not have this problem. Differential Revision: https://reviews.llvm.org/D61748 llvm-svn: 360673
* Implement midpoint for floating point types. Reviewed as ↵Marshall Clow2019-04-251-0/+113
| | | | | | https://reviews.llvm.org/D61014. llvm-svn: 359184
* [libc++] [test] Add missing required headers to midpoint.integer.pass.cppBilly Robert O'Neal III2019-04-181-0/+2
| | | | | | This change authored by Paolo Torres <t-pator@microsoft.com> llvm-svn: 358698
* Reorg the midpoint pointer test into runtime and constexpr tests; comment ↵Marshall Clow2019-03-141-10/+40
| | | | | | out the volatile constexpr tests for GCC because our experimental gcc bot barfs on them. llvm-svn: 356177
* Fix two of the three bot failures for midpoint; the ones regarding the lack ↵Marshall Clow2019-03-141-1/+4
| | | | | | of '__int128_t' llvm-svn: 356169
* Add std::midpoint for integral and poiner types. Described in P0811, ↵Marshall Clow2019-03-143-0/+224
| | | | | | reviewed as D59099. llvm-svn: 356162
* Support tests in freestandingJF Bastien2019-02-0437-37/+111
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: Freestanding is *weird*. The standard allows it to differ in a bunch of odd manners from regular C++, and the committee would like to improve that situation. I'd like to make libc++ behave better with what freestanding should be, so that it can be a tool we use in improving the standard. To do that we need to try stuff out, both with "freestanding the language mode" and "freestanding the library subset". Let's start with the super basic: run the libc++ tests in freestanding, using clang as the compiler, and see what works. The easiest hack to do this: In utils/libcxx/test/config.py add: self.cxx.compile_flags += ['-ffreestanding'] Run the tests and they all fail. Why? Because in freestanding `main` isn't special. This "not special" property has two effects: main doesn't get mangled, and main isn't allowed to omit its `return` statement. The first means main gets mangled and the linker can't create a valid executable for us to test. The second means we spew out warnings (ew) and the compiler doesn't insert the `return` we omitted, and main just falls of the end and does whatever undefined behavior (if you're luck, ud2 leading to non-zero return code). Let's start my work with the basics. This patch changes all libc++ tests to declare `main` as `int main(int, char**` so it mangles consistently (enabling us to declare another `extern "C"` main for freestanding which calls the mangled one), and adds `return 0;` to all places where it was missing. This touches 6124 files, and I apologize. The former was done with The Magic Of Sed. The later was done with a (not quite correct but decent) clang tool: https://gist.github.com/jfbastien/793819ff360baa845483dde81170feed This works for most tests, though I did have to adjust a few places when e.g. the test runs with `-x c`, macros are used for main (such as for the filesystem tests), etc. Once this is in we can create a freestanding bot which will prevent further regressions. After that, we can start the real work of supporting C++ freestanding fairly well in libc++. <rdar://problem/47754795> Reviewers: ldionne, mclow.lists, EricWF Subscribers: christof, jkorous, dexonsmith, arphaman, miyuki, libcxx-commits Differential Revision: https://reviews.llvm.org/D57624 llvm-svn: 353086
* Update more file headers across all of the LLVM projects in the monorepoChandler Carruth2019-01-1937-148/+111
| | | | | | | | | | | | | | | | | | to reflect the new license. These used slightly different spellings that defeated my regular expressions. We understand that people may be surprised that we're moving the header entirely to discuss the new license. We checked this carefully with the Foundation's lawyer and we believe this is the correct approach. Essentially, all code in the project is now made available by the LLVM project under our new license, so you will see that the license headers include that license only. Some of our contributors have contributed code under our old license, and accordingly, we have retained a copy of our old license notice in the top-level files in each project and repository. llvm-svn: 351648
* [libcxx] [test] Fix MSVC warnings and errors.Stephan T. Lavavej2018-02-268-74/+74
| | | | | | | | | | | | | | | | | | | | | | | | 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
* Change add_ten to add_one to avoid triggering ubsan integer overflow.Billy Robert O'Neal III2018-01-083-67/+67
| | | | llvm-svn: 322021
* Add casts to prevent narrowing warnings.Billy Robert O'Neal III2018-01-063-6/+6
| | | | llvm-svn: 321923
* [libcxx] [test] Remove nonstandard things and resolve warnings in Xxx_scan testsBilly Robert O'Neal III2018-01-068-101/+98
| | | | | | | | | | | Reviewed as https://reviews.llvm.org/D41748 * These tests use function objects from functional, back_inserter from iterator, and equal from algorithm, so add those headers. * The use of iota targeting vector<unsigned char> with an int parameter triggers warnings on MSVC++ assigning an into a unsigned char&; so change the parameter to unsigned char with a static_cast. * Avoid naming unary_function in identity here as that is removed in '17. (This also fixes naming _VSTD, _NOEXCEPT_, and other libcxx-isms) * Change the predicate in the transform tests to add_ten so that problems with multiple application are caught. llvm-svn: 321922
* Move + and * operators of MoveOnly into MoveOnly.h.Billy Robert O'Neal III2018-01-051-10/+0
| | | | llvm-svn: 321852
* Fix incorrect handling of move-only types in transform_reduce iter iter iter ↵Billy Robert O'Neal III2018-01-051-0/+22
| | | | | | init, and add test. llvm-svn: 321851
* Add move-only types test to transform_reduce iter iter iter init op op.Billy Robert O'Neal III2018-01-051-0/+14
| | | | llvm-svn: 321849
* Add move-only types test for transform_reduce bop/uop.Billy Robert O'Neal III2018-01-051-0/+13
| | | | llvm-svn: 321848
* Fix nonstandard bits in transform_reduce_iter_iter_init_bop_uop.Billy Robert O'Neal III2018-01-051-43/+27
| | | | | | | | * _VSTD should be std. * <utility> is needed for forward. * unary_function is no longer standard (and unnecessary for this, a C++17-only test) llvm-svn: 321847
* Change (void) casts to TEST_IGNORE_NODISCARD, as requested by Eric. Reviewed ↵Billy Robert O'Neal III2017-11-211-1/+2
| | | | | | as https://reviews.llvm.org/D40065 llvm-svn: 318804
* [libcxx] [test] Rename __x to x. NFCI.Stephan T. Lavavej2017-08-114-25/+26
| | | | | | | This improves readability and (theoretically) improves portability, as __ugly names are reserved. llvm-svn: 310760
* [libcxx] [test] Rename _Tp to T. NFCI.Stephan T. Lavavej2017-08-114-36/+36
| | | | | | | This improves readability and (theoretically) improves portability, as _Ugly names are reserved. llvm-svn: 310758
* [libcxx] [test] Untabify, NFC.Stephan T. Lavavej2017-07-294-8/+8
| | | | llvm-svn: 309464
* [libcxx] [test] Strip trailing whitespace, NFC.Stephan T. Lavavej2017-07-295-19/+17
| | | | llvm-svn: 309463
* Implement inclusive_scan/transform_inclusive_scan for C++17.Marshall Clow2017-06-235-0/+635
| | | | llvm-svn: 306083
* [libcxx] [test] Strip trailing whitespace. NFC.Stephan T. Lavavej2017-06-207-21/+20
| | | | llvm-svn: 305848
* Renamed some of the newly added tests. No functional changeMarshall Clow2017-06-156-0/+0
| | | | llvm-svn: 305453
* Implement the non-parallel versions of reduce and transform_reduce for C++17Marshall Clow2017-06-146-0/+520
| | | | llvm-svn: 305365
* Add a test with an empty input range - should do nothingMarshall Clow2017-06-131-0/+6
| | | | llvm-svn: 305268
* Implement the non-parallel versions of exclusive_scan and ↵Marshall Clow2017-06-103-0/+338
| | | | | | transform_exclusive_scan. Reviewed as https://reviews.llvm.org/D34038. llvm-svn: 305136
* Resolve integer overflow warnings in GCD and LCM testsBilly Robert O'Neal III2017-05-082-42/+52
| | | | | | | | | | | | | | | | | | | | | lcm.pass.cpp: 19: Update headers to that actually used in the test. 41: test0 was triggering narrowing warnings for all callers, because the inputs were always ints, but some of the explicit template arguments were smaller than that. Instead, have this function accept ints and static_cast explicitly to the types we want before calling std::lcm. 47: Replace unnecessary ternary. 55: Use foo_t instead of typename foo<>::type 111/116: intX_t were not std::qualified but only <cfoo> headers were included. 141: C1XX has a bug where it interprets 2147483648 as unsigned int. Then the negation trips "negation of unsigned value, result still unsigned" warnings. Perma-workaround this issue by saying INT_MIN, which better documents the intended behavior and avoids triggering warnings on C1XX. gcd.pass.cpp: Same changes as lcm.pass.cpp but for GCD. llvm-svn: 302472
* Clean up more usages of _LIBCPP_HAS_NO_RVALUE_REFERENCESEric Fiselier2017-03-032-4/+6
| | | | llvm-svn: 296854
* Make lcm/gcd work better in edge cases. Fixes a UBSAN failure.Marshall Clow2017-02-102-5/+4
| | | | llvm-svn: 294779
* Temporarily disable the LCM/GCD tests under UBSAN.Marshall Clow2017-02-082-0/+3
| | | | llvm-svn: 294417
* Add some tests to verify that we implement LWG#2837 correctly. No functional ↵Marshall Clow2017-02-062-0/+14
| | | | | | change. llvm-svn: 294194
* Fix unused parameters and variablesEric Fiselier2016-12-232-2/+2
| | | | llvm-svn: 290459
* [libcxx] [test] D27027: Strip trailing whitespace.Stephan T. Lavavej2016-11-2314-25/+25
| | | | llvm-svn: 287829
* Fixes for LWG 2598, 2686, 2739, 2742, 2747, and 2759, which were adopted ↵Marshall Clow2016-11-1412-4/+208
| | | | | | last week in Issaquah llvm-svn: 286858
* Implement LCM and GCD for C++17. Same code as for Library Fundamentals TS.Marshall Clow2016-07-266-0/+359
| | | | llvm-svn: 276751
* Move remaining _LIBCPP_VERSION tests into test/libcxxEric Fiselier2016-06-221-20/+0
| | | | llvm-svn: 273367
* Move test into test/std subdirectory.Eric Fiselier2014-12-2010-0/+708
llvm-svn: 224658
OpenPOWER on IntegriCloud