summaryrefslogtreecommitdiffstats
path: root/libcxx/test/std/utilities/any/any.class
Commit message (Collapse)AuthorAgeFilesLines
* libcxx: Rename .hpp files in libcxx/test/support to .hNico Weber2019-08-218-9/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | LLVM uses .h as its extension for header files. Files renamed using: for f in libcxx/test/support/*.hpp; do git mv $f ${f%.hpp}.h; done References to the files updated using: for f in $(git diff master | grep 'rename from' | cut -f 3 -d ' '); do a=$(basename $f); echo $a; rg -l $a libcxx | xargs sed -i '' "s/$a/${a%.hpp}.h/"; done HPP include guards updated manually using: for f in $(git diff master | grep 'rename from' | cut -f 3 -d ' '); do echo ${f%.hpp}.h ; done | xargs mvim Differential Revision: https://reviews.llvm.org/D66104 llvm-svn: 369481
* Add include for 'test_macros.h' to all the tests that were missing them. ↵Marshall Clow2019-05-314-0/+5
| | | | | | Thanks to Zoe for the (big, but simple) patch. NFC intended. llvm-svn: 362252
* Add an any_cast test for array types. Thanks to Jonathan Wakely for the ↵Marshall Clow2019-04-241-2/+8
| | | | | | suggestion. llvm-svn: 359085
* [libc++] Fix XFAILs on macOS when exceptions are disabledLouis Dionne2019-02-0510-10/+10
| | | | | | | | Some tests are marked as failing on platforms where the dylib does not provide the required exception classes. However, when testing with exceptions disabled, those tests shouldn't be marked as failing. llvm-svn: 353210
* [libcxx] Start defining lit features for tests depending on availabilityLouis Dionne2019-02-0510-70/+10
| | | | | | | | | | | | | | | | | This patch removes some vendor-specific availability XFAILs from the test suite. In the future, when a new feature is introduced in the dylib, an availability macro should be created and a matching lit feature should be created. That way, the test suite can XFAIL whenever the implementation lacks the necessary feature instead of being cluttered by vendor-specific annotations. Right now, those vendor-specific annotations are still somewhat cluttering the test suite by being in `config.py`, but at least they are localized. In the future, we could design a way to define those less intrusively or even automatically based on the availability macros that already exist in <__config>. llvm-svn: 353201
* Support tests in freestandingJF Bastien2019-02-0414-14/+42
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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-1914-56/+42
| | | | | | | | | | | | | | | | | | 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] Add availability markup for bad_optional_access, bad_variant_access ↵Louis Dionne2018-11-1910-60/+70
| | | | | | | | | | | | and bad_any_cast Reviewers: dexonsmith, EricWF Subscribers: christof, arphaman, libcxx-commits Differential Revision: https://reviews.llvm.org/D53256 llvm-svn: 347219
* Work around gcc.gnu.org/PR87766Eric Fiselier2018-10-261-1/+1
| | | | llvm-svn: 345425
* [libcxx][test] Silence -Wself-assign diagnosticsRoman Lebedev2018-04-071-3/+3
| | | | | | | | | | | | | | | | | | | | 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
* Add markup for libc++ dylib availabilityMehdi Amini2017-05-0410-1/+71
| | | | | | | | | | | | | | | Libc++ is used as a system library on macOS and iOS (amongst others). In order for users to be able to compile a binary that is intended to be deployed to an older version of the platform, clang provides the availability attribute <https://clang.llvm.org/docs/AttributeReference.html#availability>_ that can be placed on declarations to describe the lifecycle of a symbol in the library. See docs/DesignDocs/AvailabilityMarkup.rst for more information. Differential Revision: https://reviews.llvm.org/D31739 llvm-svn: 302172
* Expand test coverage for LWG2857Casey Carter2017-04-211-11/+15
| | | | | | | | | | * Cover optional's emplace-from-initializer_list overload * Verify that any::emplace and optional::emplace return a reference to the correct type even for throwing cases. Differential Revision: https://reviews.llvm.org/D32106 llvm-svn: 301055
* Implement part of LWG#2857 - any/optional. Still to do - variant. Reviewed ↵Marshall Clow2017-04-121-9/+27
| | | | | | as https://reviews.llvm.org/D31956 llvm-svn: 300123
* Test changes for P0504R0 "Revisiting in-place tag types for ↵Eric Fiselier2016-11-173-27/+21
| | | | | | any/optional/variant". Patch from Casey Carter llvm-svn: 287249
* 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
* Update issue status for LWG 2744Eric Fiselier2016-10-164-17/+25
| | | | llvm-svn: 284322
* Fix various issues in std::any and the related tests.Eric Fiselier2016-10-078-46/+111
| | | | | | | | | | | | | | | | | | | | * Fix self-swap. Patch from Casey Carter. * Remove workarounds and tests for types with deleted move constructors. This was originally added as part of a LWG proposed resolution that has since changed. * Re-apply most recent PR for LWG 2769. * Re-apply most recent PR for LWG 2754. Specifically fix the SFINAE checks to use the decayed type. * Fix tests to allow moved-from std::any's to have a non-empty state. This is the behavior of MSVC's std::any. * Various whitespace and test fixes. llvm-svn: 283606
* Improve constexpr tests for std::anyEric Fiselier2016-09-071-9/+9
| | | | llvm-svn: 280777
* [libcxx] Add std::anyEric Fiselier2016-08-1114-0/+1634
Summary: This patch adds std::any by moving/adapting <experimental/any>. This patch also implements the std::any parts of p0032r3 (http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2016/p0032r3.pdf) and LWG 2509 (http://cplusplus.github.io/LWG/lwg-defects.html#2509). I plan to push it in a day or two if there are no comments. Reviewers: mclow.lists, EricWF Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D22733 llvm-svn: 278310
OpenPOWER on IntegriCloud