summaryrefslogtreecommitdiffstats
path: root/libcxx/test/std/experimental/language.support
Commit message (Collapse)AuthorAgeFilesLines
* Add include for 'test_macros.h' to all the tests that were missing them. ↵Marshall Clow2019-05-3114-0/+26
| | | | | | Thanks to Zoe for the (big, but simple) patch. NFC intended. llvm-svn: 362252
* Support tests in freestandingJF Bastien2019-02-0427-28/+81
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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-1927-108/+81
| | | | | | | | | | | | | | | | | | 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
* [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] Change comments to say C++ instead of c++. NFC.Stephan T. Lavavej2017-07-291-1/+1
| | | | | | | | This makes them consistent (many comments already used uppercase). The special REQUIRES, UNSUPPORTED, and XFAIL comments are excluded from this change. llvm-svn: 309468
* Allow coroutine_handle<const T> to support creation from const references to ↵Eric Fiselier2017-06-161-0/+35
| | | | | | | | | | | | | | | the promise_type It seems conceivable that a user would need to get a coroutine handle having only a const reference to the promise_type, for example from within a const member function of the promise. This patch allows that use case. A coroutine_handle<const T> can be used in essentially the same way a coroutine_handle<T>, ie to start and destroy the coroutine. The constness of the promise doesn't/shouldn't propagate to the handle. llvm-svn: 305536
* Mark two coroutine tests as unsupported under ubsan, againVedant Kumar2017-06-022-0/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | This reverts commit r304580, making bool_await_suspend.pass.cpp and generator.pass.cpp unsupported on ubsan again. The host compiler is based on r304329, which has the change from PR33271 (r304277). However, this was not enough to address the issue. Bot Failure: http://lab.llvm.org:8011/builders/libcxx-libcxxabi-x86_64-linux-ubuntu-ubsan/builds/628 Unknown type! UNREACHABLE executed at /home/eric/full-llvm/llvm/lib/IR/ValueTypes.cpp:287! llvm::EVT::getEVT(llvm::Type*, bool) (/usr/local/bin/clang-5.0+0x17e7a07) llvm::TargetLoweringBase::getValueType(llvm::DataLayout const&, llvm::Type*, bool) const (/usr/local/bin/clang-5.0+0x852c4a) llvm::ComputeValueVTs(llvm::TargetLowering const&, llvm::DataLayout const&, llvm::Type*, llvm::SmallVectorImpl<llvm::EVT>&, llvm::SmallVectorImpl<unsigned long>*, unsigned long) (/usr/local/bin/clang-5.0+0x141b6e9) llvm::SelectionDAGBuilder::visitTargetIntrinsic(llvm::CallInst const&, unsigned int) (/usr/local/bin/clang-5.0+0x237b1ca) clang-5.0: /home/eric/full-llvm/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp:1236: virtual void llvm::DwarfDebug::endFunctionImpl(const llvm::MachineFunction *): Assertion `LScopes.getAbstractScopesList().size() == NumAbstractScopes && "ensureAbstractVariableIsCreated inserted abstract scopes"' failed. __assert_fail_base /build/glibc-9tT8Do/glibc-2.23/assert/assert.c:92:0 (/lib/x86_64-linux-gnu/libc.so.6+0x2dc82) llvm::DwarfDebug::endFunctionImpl(llvm::MachineFunction const*) (/usr/local/bin/clang-5.0+0x223f86b) llvm::DebugHandlerBase::endFunction(llvm::MachineFunction const*) (/usr/local/bin/clang-5.0+0x227a5a1) llvm::AsmPrinter::EmitFunctionBody() (/usr/local/bin/clang-5.0+0x222522f) llvm-svn: 304591
* Revert "Mark two coroutine tests as unsupported under ubsan"Vedant Kumar2017-06-022-6/+0
| | | | | | | This reverts commit r304462, thereby re-enabling two tests under ubsan. We expect these tests to pass now that PR33271 is fixed. llvm-svn: 304580
* [test] Allow non-libc++ coroutine_handle::done to strengthen noexceptCasey Carter2017-06-014-6/+6
| | | | llvm-svn: 304487
* Mark two coroutine tests as unsupported under ubsanVedant Kumar2017-06-012-0/+6
| | | | | | | | | They appear to crash inside of SelectionDAG on some Linux bots, when ubsan is enabled. https://bugs.llvm.org/show_bug.cgi?id=33271 llvm-svn: 304462
* Remove ubsan XFAILS in two testsVedant Kumar2017-06-012-6/+0
| | | | | | | These two tests are ubsan-clean now: http://lab.llvm.org:8080/green/job/clang-stage2-cmake-RgSan_check/3553/ llvm-svn: 304450
* Fix silly mistakes in recent changes made to coroutine testEric Fiselier2017-05-311-4/+2
| | | | llvm-svn: 304364
* Transform the libc++ coroutine shell tests into normal .pass.cpp tests.Eric Fiselier2017-05-3125-107/+15
| | | | | | | | | The shell test versions didn't get all of the flags normal tests do, specifically warning flags. This patch makes them .pass.cpp tests, and uses a lit.local.cfg to add -fcoroutines-ts and to make them UNSUPPORTED when that flag isn't available. llvm-svn: 304351
* [coroutines] Make coroutine_handle<T>::from_address ill-formed for ↵Eric Fiselier2017-05-292-0/+55
| | | | | | | | | | | | | everything but void*. from_address requires that the provided pointer refer to the suspended coroutine, which doesn't have a type, or at least not one knowable by the user. Therefore every use of `from_address` with a typed pointer is almost certainly a bug. This behavior is a part of the TS specification, but hopefully it will be in the future. llvm-svn: 304172
* Fix coroutine test failures caused by API misusages.Eric Fiselier2017-05-293-6/+6
| | | | | | | | More tests to come. I think that from_address overload should be deleted or ill-formed, except for the 'void*' one; The user cannot possibly have a typed pointer to the coroutine state. llvm-svn: 304131
* Correct XFAIL's in coroutine tests to only list ubsanEric Fiselier2017-05-282-9/+10
| | | | llvm-svn: 304106
* Fix use of uninitialized memoryEric Fiselier2017-05-281-1/+1
| | | | llvm-svn: 304105
* XFAIL tests which trigger coroutine debug info crash in ClangEric Fiselier2017-05-282-0/+8
| | | | llvm-svn: 304104
* Add hack to allow test to run w/o C++17 copy elisionEric Fiselier2017-05-281-2/+9
| | | | llvm-svn: 304103
* [coroutines] Add end-to-end tests within libc++Eric Fiselier2017-05-288-0/+809
| | | | | | | | | | | | | This patch adds end-to-end/breathing tests for coroutines into libc++. The tests aren't specifically to test libc++ requirements but instead are intented to ensure coroutines are working fine in general. Although libc++ isn't exactly the most correct place for these tests to live, there is one major advantage. The libc++ test suite is also used by MSVC and by adding the tests here it ensures they will be run against all currently available coroutine implementations. llvm-svn: 304101
* Update more coroutine_handle signatures to reflect N4663.Eric Fiselier2017-05-253-10/+59
| | | | | | | Thanks to Casey Carter for pointing out the out-of-date tests and implementation. llvm-svn: 303900
* Update coroutine_handle<P>::promise to reflect N4663.Eric Fiselier2017-05-251-3/+3
| | | | | | | | | | | This patch updates the promise() member to match the current spec. Specifically it removes the non-const overload and make the return type of the const overload non-const. This patch also makes the ASSERT_NOT_NOEXCEPT tests libc++ specific, since other implementations may be free to strengthen the specification. llvm-svn: 303895
* Add <experimental/coroutine>Eric Fiselier2017-05-2517-0/+1002
This patch adds the library portions of the coroutines PDTS, which should now be supported by Clang. llvm-svn: 303836
OpenPOWER on IntegriCloud