summaryrefslogtreecommitdiffstats
path: root/libcxx/test
Commit message (Collapse)AuthorAgeFilesLines
...
* Fix embarrasing typo in uncaught_exceptions. Update tests to really test ↵Marshall Clow2018-05-291-21/+29
| | | | | | this. Thanks to Peter Klotz for calling my attention to this. llvm-svn: 333467
* LWG 2969 "polymorphic_allocator::construct() shouldn't pass resource()"Eric Fiselier2018-05-298-24/+307
| | | | | | | | | | | | | | | | | | | Patch from Arthur O'Dwyer. In the TS, `uses_allocator` construction for `pair` tried to use an allocator type of `memory_resource*`, which is incorrect because `memory_resource*` is not an allocator type. LWG 2969 fixed it to use `polymorphic_allocator` as the allocator type instead. https://wg21.link/lwg2969 (D47090 included this in `<memory_resource>`; at Eric's request, I've split this out into its own patch applied to the existing `<experimental/memory_resource>` instead.) Reviewed as https://reviews.llvm.org/D47109 llvm-svn: 333384
* Fix up the final bits of breakage due to clang v5 generating bad implicit ↵Marshall Clow2018-05-283-12/+17
| | | | | | template deduction guides - specifically for copy-ctors llvm-svn: 333381
* Mark the template deduction tests as UNSUPPORTED on clang 5, because it ↵Marshall Clow2018-05-282-1/+6
| | | | | | deduces the wrong type. llvm-svn: 333376
* Revert "Add nonnull; use it for atomics"JF Bastien2018-05-261-92/+0
| | | | | | | | | | | | | | That's r333325, as well as follow-up "Fix GCC handling of ATOMIC_VAR_INIT" r333327. Marshall asked to revert: Let's have a discussion about how to implement this so that it is more friendly to people with installed code bases. We've had *extremely* loud responses to unilaterally adding warnings - especially ones that can't be easily disabled - to the libc++ code base in the past. llvm-svn: 333351
* Fix GCC handling of ATOMIC_VAR_INITJF Bastien2018-05-261-2/+2
| | | | | | r333325 from D47225 added warning checks, and the test was written to be C++11 correct by using ATOMIC_VAR_INIT (note that the committee fixed that recently...). It seems like GCC can't handle ATOMIC_VAR_INIT well because it generates 'type 'std::atomic<int>' cannot be initialized with an initializer list' on bot libcxx-libcxxabi-x86_64-linux-ubuntu-cxx03. Drop the ATOMIC_VAR_INITs since they weren't required to test the diagnostics. llvm-svn: 333327
* Add nonnull; use it for atomicsJF Bastien2018-05-251-0/+92
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: The atomic non-member functions accept pointers to std::atomic / std::atomic_flag as well as to the non-atomic value. These are all dereferenced unconditionally when lowered, and therefore will fault if null. It's a tiny gotcha for new users, especially when they pass in NULL as expected value (instead of passing a pointer to a NULL value). We can therefore use the nonnull attribute to denote that: - A warning should be generated if the argument is null - It is undefined behavior if the argument is null (because a dereference will segfault) This patch adds support for this attribute for clang and GCC, and sticks to the subset of the syntax both supports. In particular, work around this GCC oddity: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=60625 The attributes are documented: - https://gcc.gnu.org/onlinedocs/gcc-4.0.0/gcc/Function-Attributes.html - https://clang.llvm.org/docs/AttributeReference.html#nullability-attributes I'm authoring a companion clang patch for the __c11_* and __atomic_* builtins, which currently only warn on a subset of the pointer parameters. In all cases the check needs to be explicit and not use the empty nonnull list, because some of the overloads are for atomic<T*> and the values themselves are allowed to be null. <rdar://problem/18473124> Reviewers: arphaman, EricWF Subscribers: aheejin, christof, cfe-commits Differential Revision: https://reviews.llvm.org/D47225 llvm-svn: 333325
* Fix optional<char> test breakageJF Bastien2018-05-251-0/+4
| | | | | | It seems GCC and clang disagree. Talked to mclow on IRC, disabling for now. llvm-svn: 333317
* Fix array deduction guide test breakageJF Bastien2018-05-251-0/+3
| | | | | | No matching constructor llvm-svn: 333315
* Fix optional deduction guide test breakageJF Bastien2018-05-252-2/+2
| | | | llvm-svn: 333308
* Add one more test for optionalMarshall Clow2018-05-251-5/+14
| | | | llvm-svn: 333252
* Add deduction guides for optionalMarshall Clow2018-05-252-0/+82
| | | | llvm-svn: 333251
* Do not define template specialization __libcpp_is_floating_point<__fp16>Akira Hatanaka2018-05-231-0/+2
| | | | | | | | if the compiler is not clang. gcc doesn't allow using __fp16 on non-ARM targets. llvm-svn: 333108
* Teach __libcpp_is_floating_point that __fp16 and _Float16 areAkira Hatanaka2018-05-231-0/+22
| | | | | | | | floating-point types. rdar://problem/40377353 llvm-svn: 333103
* Implement deduction guides for basic_regexMarshall Clow2018-05-232-0/+182
| | | | llvm-svn: 333050
* [libcxx] [test] Mark the test as unsupported by apple-clang-8.1.Volodymyr Sapsai2018-05-221-1/+1
| | | | llvm-svn: 333011
* Missed the tests for the deduction guides for prority_queueMarshall Clow2018-05-222-0/+181
| | | | llvm-svn: 332931
* Deduction guides for the container adaptors - queue, stack, and priority_queueMarshall Clow2018-05-224-0/+279
| | | | llvm-svn: 332927
* Implement deduction guides for vectorMarshall Clow2018-05-212-0/+156
| | | | llvm-svn: 332901
* Deduction guides for listMarshall Clow2018-05-202-0/+145
| | | | llvm-svn: 332818
* Implement deduction guides for forward_listMarshall Clow2018-05-192-0/+145
| | | | llvm-svn: 332811
* Remove expression '1L + INT_MAX', because it overflows on machines where ↵Marshall Clow2018-05-191-2/+2
| | | | | | int/long are the same size llvm-svn: 332797
* Implement deduction guides for <deque>Marshall Clow2018-05-182-0/+140
| | | | llvm-svn: 332785
* Disable 'missing-braces' warningMarshall Clow2018-05-182-0/+9
| | | | llvm-svn: 332779
* Implement deduction guides for <array>; Reviewed as ↵Marshall Clow2018-05-182-0/+90
| | | | | | https://reviews.llvm.org/D46964 llvm-svn: 332768
* [libcxx] [test] Remove unused local typedef in ↵Billy Robert O'Neal III2018-05-171-1/+0
| | | | | | test/std/numerics/rand/rand.eng/rand.eng.lcong/default.pass.cpp llvm-svn: 332571
* Add void casts to suppress nodiscard on linear_congruential_engine.Billy Robert O'Neal III2018-05-172-3/+3
| | | | llvm-svn: 332567
* Update XFAIL so apple-clang-9.0 is the last version not implementing Core 2094.Volodymyr Sapsai2018-05-141-1/+1
| | | | | | The test is passing with apple-clang-9.1. rdar://problem/40222003 llvm-svn: 332282
* [libcxx] [test] Update msvc_stdlib_force_include.hpp.Stephan T. Lavavej2018-05-111-4/+0
| | | | llvm-svn: 332159
* Fix failing test due to incorrect use of noexceptEric Fiselier2018-05-111-14/+0
| | | | llvm-svn: 332066
* Fix PR37407 - callable traits don't correctly check complete types.Eric Fiselier2018-05-102-1/+37
| | | | | | | | | | | | | Checking for complete types is really rather tricky when you consider the amount of specializations required to check a function type. This specifically caused PR37407 where we incorrectly diagnosed noexcept function types as incomplete (but there were plenty of other cases that would cause this). This patch removes the complete type checking for now. I'm going to look into adding a clang builtin to correctly do this for us. llvm-svn: 332040
* Revert "Emit an error when mixing <stdatomic.h> and <atomic>"Volodymyr Sapsai2018-05-081-28/+0
| | | | | | | It reverts commit r331379 because turned out `__ALLOW_STDC_ATOMICS_IN_CXX__` doesn't work well in practice. llvm-svn: 331818
* [libcxx] [test] Fix whitespace, NFC.Stephan T. Lavavej2018-05-051-8/+8
| | | | | | Strip trailing whitespace and untabify. llvm-svn: 331576
* [libcxx] [test] Fix MSVC x64 truncation warning.Stephan T. Lavavej2018-05-051-1/+1
| | | | | | | | warning C4267: 'argument': conversion from 'size_t' to 'int', possible loss of data Requesting post-commit review. llvm-svn: 331575
* Emit an error when mixing <stdatomic.h> and <atomic>Volodymyr Sapsai2018-05-021-0/+28
| | | | | | | | | | | | | | | | | | | | | Atomics in C and C++ are incompatible at the moment and mixing the headers can result in confusing error messages. Emit an error explicitly telling about the incompatibility. Introduce the macro `__ALLOW_STDC_ATOMICS_IN_CXX__` that allows to choose in C++ between C atomics and C++ atomics. rdar://problem/27435938 Reviewers: rsmith, EricWF, mclow.lists Reviewed By: mclow.lists Subscribers: jkorous-apple, christof, bumblebritches57, JonChesterfield, smeenai, cfe-commits Differential Revision: https://reviews.llvm.org/D45470 llvm-svn: 331379
* Fix return type of isinf(double) and isnan(double) where possible.Richard Smith2018-05-011-6/+8
| | | | | | | | | | | When using an old version of glibc, a ::isinf(double) and ::isnan(double) function is provided, rather than just the macro required by C and C++. Displace this function using _LIBCPP_PREFERRED_OVERLOAD where possible. The only remaining case where we should get the wrong return type is now glibc + libc++ + a non-clang compiler. llvm-svn: 331241
* [libcxx] [test] Remove non-portable assertions from filebuf testsBilly Robert O'Neal III2018-04-262-10/+18
| | | | | | | | | | | seekoff.pass.cpp: libc++'s tests are asserting things about the buffer passed to pubsetbuf. [filebuf.virtuals]/12 says that what the filebuf does with the buffer you give it is completely implementation defined. The MSVC++ implementation takes that buffer and hands it off to the CRT (by calling ::setvbuf) and the CRT doesn't necessarily follow the pattern this test wants. This change simply makes asserts against the buffer's contents use LIBCPP_ASSERT instead of assert. pbackfail.pass.cpp: libc++'s tests are asserting about what characters will and will not be available in the putback area. [filebuf.virtuals]/9 says "The function can alter the number of putback positions available as a result of any call." This change LIBCPP_ASSERTS libc++'s behavior, but checks invariants of the putback area independently. llvm-svn: 330999
* Move old test into test/libcxx, and implement new version of test for ↵Marshall Clow2018-04-262-2/+47
| | | | | | ostreambuf_iterator::failed. Fixes PR#37245. Thanks to Billy O'Neill for the bug report. llvm-svn: 330955
* [libcxx] func.wrap.func.con: Unset function before destroying anythingVolodymyr Sapsai2018-04-252-0/+92
| | | | | | | | | | | | | | | | | | | | Be defensive against a reentrant std::function::operator=(nullptr_t), in case the held function object has a non-trivial destructor. Destroying the function object in-place can lead to the destructor being called twice. Patch by Duncan P. N. Exon Smith. C++03 support by Volodymyr Sapsai. rdar://problem/32836603 Reviewers: EricWF, mclow.lists Reviewed By: mclow.lists Subscribers: cfe-commits, arphaman Differential Revision: https://reviews.llvm.org/D34331 llvm-svn: 330885
* Disable the test I just added when testing C++03.Marshall Clow2018-04-251-1/+7
| | | | llvm-svn: 330838
* Fix static initialization of std::atomic_flag; Fixes PR#37226. Thanks to ↵Marshall Clow2018-04-251-0/+7
| | | | | | Ricky Zhou for the report and test case. llvm-svn: 330828
* [libcxx] [test] Remove nonportable that errc::is_a_directory produces "Is a ↵Billy Robert O'Neal III2018-04-252-2/+6
| | | | | | | | | | directory" from ios_base::failure tests These io_error asserts that std::errc::is_a_directory has message "Is a directory". On MSVC++ it reports "is a directory" (with a lowercase I). That doesn't matter for the ios_failure component being tested, so just implement in terms of system_category().message(). Reviewed as https://reviews.llvm.org/D45715 llvm-svn: 330791
* Re-commit r330627 "[libcxx] implement <experimental/simd> declarations based ↵Tim Shen2018-04-2310-0/+649
| | | | | | | | | | | | on P0214R7." There are 3 changes: * Renamed genertor.pass.cpp to generator.pass.cpp * Removed nothing_to_do.pass.cpp * Mark GCC 4.9 as UNSUPPORTED for the test files that have negative narrowing conversion SFINAE test (see GCC PR63723). llvm-svn: 330655
* Revert "[libcxx] implement <experimental/simd> declarations based on P0214R7."Tim Shen2018-04-2311-655/+0
| | | | | | | | This reverts commit r330627. This causes several bots to freak out. llvm-svn: 330636
* [libcxx] implement <experimental/simd> declarations based on P0214R7.Tim Shen2018-04-2311-0/+655
| | | | | | | | | | | | | | | Summary: The patch includes all declarations, and also implements the following features: * ABI. * narrowing-conversion related SFIANE, including simd<> ctors and (static_)simd_cast. Reviewers: mclow.lists, EricWF Subscribers: lichray, sanjoy, MaskRay, cfe-commits Differential Revision: https://reviews.llvm.org/D41148 llvm-svn: 330627
* [libcxx] [test] Use TEST_IGNORE_NODISCARD.Stephan T. Lavavej2018-04-131-3/+3
| | | | | | Fixes D45595. llvm-svn: 329979
* [libcxx] [test] Fix whitespace, NFC.Stephan T. Lavavej2018-04-1214-71/+71
| | | | | | test/std almost always uses spaces; now it is entirely tab-free. llvm-svn: 329978
* [libcxx] [test] Use TEST_COMPILER_C1XX.Stephan T. Lavavej2018-04-124-9/+13
| | | | | | Also TEST_COMPILER_CLANG in one place. (More could be changed.) llvm-svn: 329977
* [libcxx] [test] Silence MSVC warning C4146.Stephan T. Lavavej2018-04-121-0/+4
| | | | | | | | | | | | | This test code triggers the MSVC warning: "unary minus operator applied to unsigned type, result still unsigned" Although it would be possible to change the test code to avoid this warning, I have chosen to simply silence it. Fixes D45594. llvm-svn: 329976
* [libcxx] [test] Fix nodiscard warnings.Stephan T. Lavavej2018-04-121-3/+3
| | | | | | | | MSVC's STL has marked to_bytes/from_bytes as nodiscard. Fixes D45595. llvm-svn: 329975
OpenPOWER on IntegriCloud