summaryrefslogtreecommitdiffstats
path: root/libcxx/test/std/experimental/utilities
Commit message (Collapse)AuthorAgeFilesLines
* [NFC] Strip trailing whitespace from libc++Louis Dionne2019-10-238-9/+9
|
* [libc++][NFC] Remove excess trailing newlines from most filesCasey Carter2019-10-236-6/+0
| | | | Testing git commit access.
* Add include for 'test_macros.h' to all the tests that were missing them. ↵Marshall Clow2019-05-3143-0/+45
| | | | | | Thanks to Zoe for the (big, but simple) patch. NFC intended. llvm-svn: 362252
* Implement LWG 2960: nonesuch is insufficiently uselessMarshall Clow2019-04-302-0/+61
| | | | llvm-svn: 359526
* Support tests in freestandingJF Bastien2019-02-0449-49/+147
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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-1949-196/+147
| | | | | | | | | | | | | | | | | | 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
* Remove more of the std::experimental bits that are now in std::. All the _v ↵Marshall Clow2018-02-0634-3188/+0
| | | | | | type aliases, conjunction/disjunction, apply, etc. See https://libcxx.llvm.org/TS_deprecation.html llvm-svn: 324423
* Placate unused variable warnings uncovered by improvements to clang's ↵Benjamin Kramer2017-10-141-0/+1
| | | | | | -Wunused-variable llvm-svn: 315809
* Fix XFAIL to reflect recent fixes in GCCEric Fiselier2017-05-111-1/+2
| | | | llvm-svn: 302841
* Fix GCC 7 test failures.Eric Fiselier2017-05-091-0/+5
| | | | | | | | | | | This patch fixes the test failures and unexpected passes that occur when testing against GCC 7. Specifically: * don't mark __gcd as always inline because it's a recursive function. GCC diagnoses this. * don't XFAIL the aligned allocation tests. GCC 7 supports them but not the -faligned-allocation option. * Work around gcc.gnu.org/PR78489 in variants constructors. llvm-svn: 302488
* [libcxx] [test] Fix comment typos, strip trailing whitespace.Stephan T. Lavavej2017-01-181-1/+1
| | | | | | No functional change, no code review. llvm-svn: 292434
* [libcxx] [test] Strip trailing whitespace.Stephan T. Lavavej2017-01-045-5/+5
| | | | | | Fixes D27786. llvm-svn: 290922
* Fix unused parameters and variablesEric Fiselier2016-12-234-2/+5
| | | | llvm-svn: 290459
* Adjust libc++ test infastructure to fully support modulesEric Fiselier2016-12-051-16/+16
| | | | | | | | | | | | This patch overhalls the libc++ test format/configuration in order to fully support modules. By "fully support" I mean get almost all of the tests passing. The main hurdle for doing this is handling tests that `#define _LIBCPP_FOO` macros to test a different configuration. This patch deals with these tests in the following ways: 1. For tests that define single `_LIBCPP_ABI_FOO` macros have been annotated with `// MODULES_DEFINES: _LIBCPP_ABI_FOO`. This allows the test suite to define the macro on the command line so it uses a different set of modules. 2. Tests for libc++'s debug mode (which define custom `_LIBCPP_ASSERT`) are automatically detected by the test suite and are compiled and run with modules disabled. This patch also cleans up how the `CXXCompiler` helper class handles enabling/disabling language features. NOTE: This patch uses `LIT` features which were only committed to LLVM today. If this patch breaks running the libc++ tests you probably need to update LLVM. llvm-svn: 288728
* Implement conjuntion/disjuntion/negation for LFTS v2. Same code and tests ↵Marshall Clow2016-11-263-0/+177
| | | | | | for the ones in std:: llvm-svn: 287988
* Implement the 'detection idiom' from LFTS v2Marshall Clow2016-11-265-0/+224
| | | | llvm-svn: 287981
* Move more _LIBCPP_VERSION tests to test/libcxx.Eric Fiselier2016-06-222-40/+0
| | | | llvm-svn: 273365
* Implement std::experimental::propagate_const from LFTS v2Jonathan Coe2016-06-1941-0/+1436
| | | | | | | | | | | | | Summary: An implementation of std::experimental::propagate_const from Library Fundamentals Technical Specification v2. No tests are provided for disallowed types like fancy pointers or function pointers as no code was written to handle these. Reviewers: EricWF, mclow.lists Differential Revision: http://reviews.llvm.org/D12486 llvm-svn: 273122
* Fix warnings in tests.Eric Fiselier2016-06-141-31/+25
| | | | llvm-svn: 272629
* [libcxx] Improve tests to use the UNSUPPORTED lit directiveAsiri Rathnayake2016-05-286-29/+12
| | | | | | | | | | | | | | | | | | | Quite a few libcxx tests seem to follow the format: #if _LIBCPP_STD_VER > X // Do test. #else // Empty test. #endif We should instead use the UNSUPPORTED lit directive to exclude the test on earlier C++ standards. This gives us a more accurate number of test passes for those standards and avoids unnecessary conflicts with other lit directives on the same tests. Reviewers: bcraig, ericwf, mclow.lists Differential revision: http://reviews.llvm.org/D20730 llvm-svn: 271108
* Add 'is_callable' and 'is_nothrow_callable' traits and cleanup INVOKE.Eric Fiselier2016-04-201-5/+0
| | | | | | | | | | | | The primary purpose of this patch is to add the 'is_callable' traits. Since 'is_nothrow_callable' required making 'INVOKE' conditionally noexcept I also took this oppertunity to implement a constexpr version of INVOKE. This fixes 'std::experimental::apply' which required constexpr 'INVOKE support'. This patch will be followed up with some cleanup. Primarly removing most of "__member_function_traits" since it's no longer used by INVOKE (in C++11 at least). llvm-svn: 266836
* Suppress array initialization warnings in std::experimental::apply testsEric Fiselier2015-10-013-0/+13
| | | | llvm-svn: 248987
* Remove constexpr support for std::apply because it introduces regressions.Eric Fiselier2015-04-192-0/+8
| | | | llvm-svn: 235274
* [libcxx] Add <experimental/tuple> header for LFTS.Eric Fiselier2015-03-1712-0/+1561
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: This patch adds the `<experimental/tuple>` header (almost) as specified in the latest draft of the library fundamentals TS. The main changes in this patch are: 1. Added variable template `tuple_size_v` 2. Added function `apply(Func &&, Tuple &&)`. 3. Changed `__invoke` to be `_LIBCPP_CONSTEXPR_AFTER_CXX11`. The `apply(...)` implementation uses `__invoke` to invoke the given function. `__invoke` already provides the required functionality. Using `__invoke` also allows `apply` to be used on pointers to member function/objects as an extension. In order to facilitate this `__invoke` has to be marked `constexpr`. Test Plan: Each new feature was tested. The test cases for `tuple_size_v` are as follows: 1. tuple_size_v.pass.cpp - Check `tuple_size_v` on cv qualified tuples, pairs and arrays. 2. tuple_size_v.fail.cpp - Test on reference type. 3. tuple_size_v_2.fail.cpp - Test on non-tuple 4. tuple_size_v_3.fail.cpp - Test on pointer type. The test cases for tuple.apply are as follows: 1. arg_type.pass.cpp - Ensure that ref/pointer/cv qualified types are properly passed. 2. constexpr_types.pass.cpp - Ensure constexpr evaluation of apply is possible for `tuple` and `pair`. 3. extended_types.pass.cpp - Test apply on function types permitted by extension. 4. large_arity.pass.cpp - Test that apply can evaluated on tuples and arrays with large sizes. 5. ref_qualifiers.pass.cpp - Test that apply respects ref qualified functions. 6. return_type.pass.cpp - Test that apply returns the proper type. 7. types.pass.cpp - Test apply on function types as required by LFTS. Reviewers: mclow.lists Reviewed By: mclow.lists Subscribers: cfe-commits Differential Revision: http://reviews.llvm.org/D4512 llvm-svn: 232515
* [libcxx] Add <experimental/ratio>Eric Fiselier2015-02-178-0/+360
| | | | | | | | | | | | | | | | | Summary: This patch is pretty simple. It just adds the _v traits from <ratio>. The draft can be found here. Reviewers: jroelofs, K-ballo, mclow.lists Reviewed By: mclow.lists Subscribers: cfe-commits Differential Revision: http://reviews.llvm.org/D7351 llvm-svn: 229509
* Fix alignment in tests for readability.Eric Fiselier2015-02-032-4/+4
| | | | llvm-svn: 228028
* [libcxx] Add <experimental/system_error>Eric Fiselier2015-02-033-0/+96
| | | | | | | | | | | | | | | | | | Summary: This patch just adds the variable templates in <experimental/system_error>. see: https://rawgit.com/cplusplus/fundamentals-ts/v1/fundamentals-ts.html#syserror Reviewers: jroelofs, danalbert, K-ballo, mclow.lists Reviewed By: mclow.lists Subscribers: chandlerc, cfe-commits Differential Revision: http://reviews.llvm.org/D7353 llvm-svn: 227973
* [libcxx] Add <experimental/chrono>Eric Fiselier2015-02-022-0/+68
| | | | | | | | | | | | | | | | | Summary: This patch adds <experimental/chrono> which only contains a single variable template. See: https://rawgit.com/cplusplus/fundamentals-ts/v1/fundamentals-ts.html#time Reviewers: jroelofs, danalbert, K-ballo, mclow.lists Reviewed By: mclow.lists Subscribers: cfe-commits Differential Revision: http://reviews.llvm.org/D7352 llvm-svn: 227860
* Fix vexing parse in test.Eric Fiselier2015-01-121-1/+1
| | | | llvm-svn: 225633
* Move test into test/std subdirectory.Eric Fiselier2014-12-2011-0/+1015
llvm-svn: 224658
OpenPOWER on IntegriCloud