summaryrefslogtreecommitdiffstats
path: root/libcxx/test/std/language.support/support.exception
Commit message (Collapse)AuthorAgeFilesLines
* Add include for 'test_macros.h' to all the tests that were missing them. ↵Marshall Clow2019-05-3113-0/+26
| | | | | | Thanks to Zoe for the (big, but simple) patch. NFC intended. llvm-svn: 362252
* Support tests in freestandingJF Bastien2019-02-0419-19/+57
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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-1919-76/+57
| | | | | | | | | | | | | | | | | | 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
* Update the failure annotations for the uncaught_exceptions test. The ↵Marshall Clow2018-09-121-5/+5
| | | | | | underlying abi library on some Mac OS versions does not support the plural uncaught_exceptions, so libc++ emulates it from the singlar; this means it will only return 0 or 1. llvm-svn: 342063
* [libcxx] [test] Strip trailing whitespace. NFC.Stephan T. Lavavej2018-06-141-2/+2
| | | | llvm-svn: 334676
* 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
* [libcxx] [test] Untabify, NFC.Stephan T. Lavavej2017-07-291-2/+2
| | | | llvm-svn: 309464
* [libc++] Implement exception_ptr on WindowsEric Fiselier2017-05-0810-27/+17
| | | | | | | | | | | | | | | | | | | | | | Summary: This patch implements exception_ptr on Windows using the `__ExceptionPtrFoo` functions provided by MSVC. The `__ExceptionPtrFoo` functions are defined inside the C++ standard library, `msvcprt`, which is unfortunate because it requires libc++ to link to the MSVC STL. However this doesn't seem to cause any immediate problems. However to be safe I kept all usages within the libc++ dylib so that user programs wouldn't have to link to MSVCPRT as well. Note there are still 2 outstanding exception_ptr/nested_exception test failures. * `current_exception.pass.cpp` needs to be rewritten for the Windows exception_ptr semantics which copy the exception every time. * `rethrow_if_nested.pass.cpp` need investigation. It hits a stack overflow, likely from recursion. This patch also gets most of the `<future>` tests passing as well. Reviewers: mclow.lists, compnerd, bcraig, rmaprath, majnemer, BillyONeal, STL_MSFT Subscribers: mgorny, cfe-commits Differential Revision: https://reviews.llvm.org/D32927 llvm-svn: 302393
* Add markup for libc++ dylib availabilityMehdi Amini2017-05-041-0/+8
| | | | | | | | | | | | | | | 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
* Mark exception_ptr tests as XFAIL on Windows for nowEric Fiselier2017-04-2110-1/+31
| | | | llvm-svn: 300942
* [test] Silence unused parameter/typedef warningsCasey Carter2017-04-181-1/+1
| | | | llvm-svn: 300575
* Implement LWG#2855 - made easy by previous refactoringMarshall Clow2017-04-131-0/+10
| | | | llvm-svn: 300218
* Implement LWG2784, and mark 2786, 2795, 2804, 2812, 2826, 2834, 2837 and ↵Marshall Clow2017-03-141-1/+32
| | | | | | 2838 as complete - since we do them already llvm-svn: 297752
* Protect nested-exceptions tests under no-exceptionsRoger Ferrer Ibanez2016-11-143-3/+12
| | | | | | Differential Revision: https://reviews.llvm.org/D26458 llvm-svn: 286813
* Change from "XFAIL: libcpp-no-exceptions" to "UNSUPPORTED: ↵Roger Ferrer Ibanez2016-10-318-8/+8
| | | | | | | | | | | | | 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
* Remove usages of _ALIGNAS_TYPEEric Fiselier2016-10-121-1/+3
| | | | llvm-svn: 283999
* Move all tests for _LIBCPP_VERSION in language.support to ↵Eric Fiselier2016-06-221-20/+0
| | | | | | test/libcxx/language.support. llvm-svn: 273364
* Replace __cplusplus comparisons and dialect __has_feature checks with ↵Eric Fiselier2016-06-141-2/+4
| | | | | | | | | TEST_STD_VER. This is a huge cleanup that helps make the libc++ test suite more portable. Patch from STL@microsoft.com. Thanks STL! llvm-svn: 272716
* Avoid name shadowing in test. Patch from STL@microsoft.comEric Fiselier2016-06-141-2/+2
| | | | llvm-svn: 272618
* Void cast runtime-unused variables. Patch from STL@microsoft.comEric Fiselier2016-05-022-3/+3
| | | | llvm-svn: 268284
* Fix a corner case that involved calling rethrow_if_nested with a type that ↵Marshall Clow2015-12-141-1/+9
| | | | | | had a deleted operator&. Added a test to catch this as well. Thanks to Ville for the heads-up. llvm-svn: 255517
* Make it possible to build a no-exceptions variant of libcxx.Asiri Rathnayake2015-11-1011-0/+11
| | | | | | | | | | | | Fixes a small omission in libcxx that prevents libcxx being built when -DLIBCXX_ENABLE_EXCEPTIONS=0 is specified. This patch adds XFAILS to all those tests that are currently failing on the new -fno-exceptions library variant. Follow-up patches will update the tests (progressively) to cope with the new library variant. Change-Id: I4b801bd8d8e4fe7193df9e55f39f1f393a8ba81a llvm-svn: 252598
* Fix a handful of tests that fail in C++03Eric Fiselier2015-07-281-1/+1
| | | | llvm-svn: 243392
* Fix warnings in test/std/language.supportEric Fiselier2015-07-181-0/+4
| | | | llvm-svn: 242624
* Implement uncaught_exceptions() using the newly added hooks in libc++abi, ↵Marshall Clow2015-06-021-0/+45
| | | | | | when available llvm-svn: 238846
* Fix a problem when calling throw_with_nested with a class marked 'final'. ↵Marshall Clow2015-03-161-0/+16
| | | | | | Thanks to STL @ Microsoft for the bug report. llvm-svn: 232384
* Move test into test/std subdirectory.Eric Fiselier2014-12-2019-0/+1064
llvm-svn: 224658
OpenPOWER on IntegriCloud