summaryrefslogtreecommitdiffstats
path: root/libcxx/test/std/utilities/function.objects/func.not_fn
Commit message (Collapse)AuthorAgeFilesLines
* Support tests in freestandingJF Bastien2019-02-041-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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-191-4/+3
| | | | | | | | | | | | | | | | | | 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] Improve MSVC portability.Stephan T. Lavavej2018-01-101-4/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | test/support/msvc_stdlib_force_include.hpp When testing MSVC's STL with C1XX, simulate a couple more compiler feature-test macros. When testing MSVC's STL, simulate a few library feature-test macros. test/std/atomics/atomics.lockfree/isalwayslockfree.pass.cpp The vector_size attribute is a non-Standard extension that's supported by Clang and GCC, but not C1XX. Therefore, guard this with `__has_attribute(vector_size)`. Additionally, while these tests pass when MSVC's STL is compiled with Clang, I don't consider this to be a supported scenario for our library, so also guard this with defined(_LIBCPP_VERSION). test/std/utilities/function.objects/func.not_fn/not_fn.pass.cpp N4713 23.14.10 [func.not_fn]/1 depicts only `call_wrapper(call_wrapper&&) = default;` and `call_wrapper(const call_wrapper&) = default;`. According to 15.8.2 [class.copy.assign]/2 and /4, this makes call_wrapper non-assignable. Therefore, guard the assignability tests as libc++ specific. Add a (void) cast to tolerate not_fn() being marked as nodiscard. Fixes D41213. llvm-svn: 322144
* [libcxx] P0604, invoke_result and is_invocableZhihao Yuan2017-12-121-8/+8
| | | | | | | | | | | | | | | | | | | | Summary: Introduce a new form of `result_of` without function type encoding. Rename and split `is_callable/is_nothrow_callable` into `is_invocable/is_nothrow_invocable/is_invocable_r/is_nothrow_invocable_r` (and associated types accordingly) Change function type encoding of previous `is_callable/is_nothrow_callable` traits to conventional template type parameter lists. Reviewers: EricWF, mclow.lists, bebuch Reviewed By: EricWF, bebuch Subscribers: lichray, bebuch, cfe-commits Differential Revision: https://reviews.llvm.org/D38831 llvm-svn: 320509
* [libcxx] [test] Fix URLs in comments and make them HTTPS. NFC.Stephan T. Lavavej2017-08-051-1/+1
| | | | llvm-svn: 310156
* Remove usages of _LIBCPP_MSVC which is never definedEric Fiselier2017-05-101-1/+1
| | | | llvm-svn: 302736
* test: squelch -Wreturn-type errorSaleem Abdulrasool2017-02-121-1/+8
| | | | | | | Add an unreachable marker to avoid a -Wreturn-type error when building on Windows. llvm-svn: 294901
* Fix unused parameters and variablesEric Fiselier2016-12-231-5/+4
| | | | llvm-svn: 290459
* Update LWG 2767 and add test caseEric Fiselier2016-10-161-0/+14
| | | | llvm-svn: 284324
* Remove use of _VSTD::__invoke in the not_fn testsEric Fiselier2016-10-121-1/+4
| | | | llvm-svn: 283991
* Implement P0358r1. Fixes for not_fn.Eric Fiselier2016-06-271-28/+69
| | | | llvm-svn: 273837
* Don't use C++17 terse static assert. Patch from STL@microsoft.comEric Fiselier2016-06-221-29/+29
| | | | llvm-svn: 273353
* Add not_fn test for throwing operator!Eric Fiselier2016-06-021-0/+8
| | | | llvm-svn: 271502
* Add C++17 std::not_fn negator.Eric Fiselier2016-06-021-0/+540
Summary: Exactly what it sounds like. I plan to commit this in a couple of days assuming no objections. Reviewers: mclow.lists, EricWF Subscribers: cfe-commits Differential Revision: http://reviews.llvm.org/D20799 llvm-svn: 271464
OpenPOWER on IntegriCloud