summaryrefslogtreecommitdiffstats
path: root/libcxx/test
Commit message (Collapse)AuthorAgeFilesLines
...
* Fix DYNLD_LIBRARY_PATH to include the ABI path if specifiedEric Fiselier2015-03-171-13/+20
| | | | llvm-svn: 232527
* Fix failed test command repro printing for *.pass.cpp testsJonathan Roelofs2015-03-172-4/+8
| | | | | | | | Before we were printing out the compile command twice, which isn't that useful. Thanks EricWF for the report! llvm-svn: 232526
* [libcxx] Add <experimental/tuple> header for LFTS.Eric Fiselier2015-03-1714-0/+1602
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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] Move tuple_size and tuple_element overloads for pair and array out ↵Eric Fiselier2015-03-174-25/+97
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | of !defined(_LIBCPP_HAS_NO_VARIADICS) block. Summary: There is no reason to guard `tuple_size`, `tuple_element` and `get<I>(...)` for pair and array inside of `<__tuple>` so that they are only available when we have variadic templates. This requires there be redundant declarations and definitions. It also makes it easy to get things wrong. For example the following code should compile (and does in c++11). ``` #define _LIBCPP_HAS_NO_VARIADICS #include <array> int main() { static_assert((std::tuple_size<std::array<int, 10> volatile>::value == 10), ""); } ``` This patch lifts the non-variadic parts of `tuple_size`, `tuple_types`, and `get<I>(...)` to the top of `<__tuple>` where they don't require variadic templates. This patch also removes `<__tuple_03>` because there is no longer a need for it. Reviewers: danalbert, K-ballo, mclow.lists Reviewed By: mclow.lists Subscribers: cfe-commits Differential Revision: http://reviews.llvm.org/D7774 llvm-svn: 232492
* Don't attempt to validate the output of %p.Ed Schouten2015-03-161-12/+21
| | | | | | | | | | | | | In one of the ostream tests we attempt to validate whether the output of %p is correct. This is actually outside the scope of libc++, for the %reason that the format of %p is implementation defined. Change the test %to validate that the output of %p is non-empty and is different when %given two unequal addresses. Differential Revision: http://reviews.llvm.org/D8354 Reviewed by: marshall llvm-svn: 232390
* 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
* Don't hardcode the Czech locale name.Ed Schouten2015-03-1611-30/+44
| | | | | | | | | | | | We already have a definition for the Czech locale name in platform_support.h. Use this one instead. While there, respect the common format of the tests. For most other tests it's the case that test_iterators.h is placed right underneath the other #includes (without an empty line). platform_support.h is included after an empty line. llvm-svn: 232383
* Don't hardcode the locale name string.Ed Schouten2015-03-161-1/+2
| | | | | | | | The rest of the test uses the #defines for the locale names properly. In this single spot we do hardcode the string. This causes this test to fail on CloudABI, where this locale is called en_US.UTF-8@UTC. llvm-svn: 232365
* Remove unneeded initialisation of fenv_t and fexcept_t.Ed Schouten2015-03-151-2/+2
| | | | | | | | Though common, there is no requirement that fenv_t and fexcept_t are structure and integer types, respectively. fexcept_t is a structure on CloudABI. llvm-svn: 232329
* Add option to disable access to the global filesystem namespace.Ed Schouten2015-03-1211-0/+60
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Systems like FreeBSD's Capsicum and Nuxi CloudABI apply the concept of capability-based security on the way processes can interact with the filesystem API. It is no longer possible to interact with the VFS through calls like open(), unlink(), rename(), etc. Instead, processes are only allowed to interact with files and directories to which they have been granted access. The *at() functions can be used for this purpose. This change adds a new config switch called _LIBCPP_HAS_NO_GLOBAL_FILESYSTEM_NAMESPACE. If set, all functionality that requires the global filesystem namespace will be disabled. More concretely: - fstream's open() function will be removed. - cstdio will no longer pull in fopen(), rename(), etc. - The test suite's get_temp_file_name() will be removed. This will cause all tests that use the global filesystem namespace to break, but will at least make all the other tests run (as get_temp_file_name will not build anyway). It is important to mention that this change will make fstream rather useless on those systems for now. Still, I'd rather not have fstream disabled entirely, as it is of course possible to come up with an extension for fstream that would allow access to local filesystem namespaces (e.g., by adding an openat() member function). Differential revision: http://reviews.llvm.org/D8194 Reviewed by: jroelofs (thanks!) llvm-svn: 232049
* Fix ctype_byname<wchar_t>::do_is() mask checking.... againJonathan Roelofs2015-03-111-0/+53
| | | | | | | | | This basically reverts the revert in r216508, and fixes a few more cases while I'm at it. Reading my commit message on that commit again, I think it's bupkis. http://reviews.llvm.org/D8237 llvm-svn: 231940
* Copy data files to the remote runner.Dan Albert2015-03-102-18/+30
| | | | | | | | | | | | | | | | | | | | | | | | | | Summary: The data files for any given test will be in the same directory as the source with a file name that matches *.dat. To make these available to tests running remotely (such as over adb or ssh), copy them into the test's remote working directory. Note that we will perform more copies than we actually need. The data files in the directory may only be used by one of the tests, but will be copied for all tests in the same directory. This patch also moves the remote test binary into the working directory (previously it was only invoked from the working directory rather than existing in it). Reviewers: EricWF, jroelofs Reviewed By: jroelofs Subscribers: cfe-commits Differential Revision: http://reviews.llvm.org/D8118 llvm-svn: 231864
* Use generic feature name for sanitizers that replace new and deleteEric Fiselier2015-03-1036-35/+39
| | | | llvm-svn: 231841
* Factor out RemoteExecutor from SSHExecutor.Dan Albert2015-03-101-35/+50
| | | | | | | | | | | | | | | | Summary: A lot of the pieces of SSHExecutor can be shared with my AdbExecutor (https://android-review.googlesource.com/#/c/138807/). Reviewers: EricWF, jroelofs Reviewed By: jroelofs Subscribers: cfe-commits Differential Revision: http://reviews.llvm.org/D8117 llvm-svn: 231815
* Add support for arc4random() to random_device.Ed Schouten2015-03-101-6/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | Nuxi CloudABI (https://github.com/NuxiNL/cloudlibc) does not allow processes to access the global filesystem namespace. This breaks random_device, as it attempts to use /dev/{u,}random. This change adds support for arc4random(), which is present on CloudABI. In my opinion it would also make sense to use arc4random() on other operating systems, such as *BSD and Mac OS X, but I'd rather leave that to the maintainers of the respective platforms. Switching to arc4random() does change the ABI. This change also attempts to make some cleanups to the code. It adds a single #define for every random interface, instead of testing against operating systems explicitly. As discussed, also validate the token argument to be equal to "/dev/urandom" on all systems that only provide pseudo-random numbers. This should cause little to no breakage, as "/dev/urandom" is also the default argument value. Reviewed by: jfb Differential Revision: http://reviews.llvm.org/D8134 llvm-svn: 231764
* [libcxx] Fix __RAII_IncreaseAnnotator for increases >= 1Eric Fiselier2015-03-101-0/+34
| | | | | | | | | | | | | | Summary: Fix suggested by @mclow.lists on D8109. Store the size of the un-poisoned vector upon construction instead of calculating it later. Reviewers: titus, mclow.lists, kcc, EricWF Reviewed By: EricWF Subscribers: mclow.lists, cfe-commits Differential Revision: http://reviews.llvm.org/D8172 llvm-svn: 231729
* Move test to use correct suffixEric Fiselier2015-03-091-0/+0
| | | | llvm-svn: 231704
* Add TrackedValue to test/support. Thanks to Louis DionneEric Fiselier2015-03-091-0/+50
| | | | llvm-svn: 231674
* Fix an exception-safety bug in <deque>. Reference: PR#22650. Not closing the ↵Marshall Clow2015-03-092-1/+41
| | | | | | bug because there's more work to do here llvm-svn: 231672
* Add CloudABI locale names to platform_support.h.Ed Schouten2015-03-091-0/+10
| | | | | | | | On CloudABI we should append the timezone name to the end of the locale (e.g., nl_NL.UTF-8@Europe/Amsterdam). By fixing the locale names we can already let a lot of locale related tests pass. llvm-svn: 231649
* Oops. This arg is passed, just ignored.Dan Albert2015-03-061-3/+0
| | | | | | | We should probably be using this argument to find the data files for the tests, but that isn't implemented yet. llvm-svn: 231498
* Fix the PrefixExecutor.Dan Albert2015-03-061-3/+6
| | | | | | | | | | The PrefixExecutor wasn't passing the exe_path down the chain, so the command was overriding that, the work_dir was being passed as the command, and so on. I've cleaned up a few pylint issues while I was here. llvm-svn: 231496
* Remove unneeded python importEric Fiselier2015-03-061-1/+0
| | | | llvm-svn: 231453
* Run ShTests when the executor is an instance of LocalExecutorEric Fiselier2015-03-051-1/+3
| | | | llvm-svn: 231404
* Move the <dynarray> tests out of the std/ hierarchy, since it's not really ↵Marshall Clow2015-03-0412-0/+0
| | | | | | part of the standard any more. llvm-svn: 231311
* Allow declaration of map and multimap iterator with incomplete mapped type. ↵Eric Fiselier2015-03-032-4/+33
| | | | | | Patch from eugenis llvm-svn: 231119
* Add better tests for ctype<char>::classic_tableMarshall Clow2015-03-031-0/+36
| | | | llvm-svn: 231077
* [libcxx] Add support for linking libc++ against a static ABI library.Eric Fiselier2015-03-031-0/+5
| | | | | | | | | | | | | | | | Summary: This patch add the CMake option `LIBCXX_ENABLE_STATIC_ABI_LIBRARY` which, when enabled, will link libc++ against the static version of the ABI library. Reviewers: mclow.lists, jroelofs, danalbert Reviewed By: danalbert Subscribers: compnerd, cfe-commits Differential Revision: http://reviews.llvm.org/D8017 llvm-svn: 231076
* Add remote testing support to the lit config.Jonathan Roelofs2015-02-266-21/+249
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Executors can be specified at configure time by using the -DLIBCXX_EXECUTOR="" option. Examples include: $ cmake <other_flags> -DLIBCXX_EXECUTOR="TimeoutExecutor(30,LocalExecutor())" This runs individual tests with a maximum duration $ cmake <other_flags> -DLIBCXX_EXECUTOR="SSHExecutor('hostname','username')" This runs tests on a remote target, using scp to shuttle binaries to the target, and ssh to invoke commands there. $ cmake <other_flags> -DLIBCXX_EXECUTOR="PrefixExecutor('/path/to/run/script',LocalExecutor())" This assumes the script knows how to copy run the executables passed to it, and allows for the ultimate control. This is useful for running things inside emulators like Valgrind & QEMU. TODO: This doesn't claim to support ShTest tests yet, that will take a bit more thought & finagling (I'm still not sure how to orchestrate copy-in for those cases. I've also punted on what to do about tests that read data files. The testsuite has several tests that need to read *.dat files placed next to them, and currently those aren't copied over when using, say, an SSHExecutor. The affected tests are: libc++ :: std/input.output/file.streams/fstreams/filebuf.virtuals/pbackfail.pass.cpp libc++ :: std/input.output/file.streams/fstreams/filebuf.virtuals/underflow.pass.cpp libc++ :: std/input.output/file.streams/fstreams/ifstream.assign/member_swap.pass.cpp libc++ :: std/input.output/file.streams/fstreams/ifstream.assign/move_assign.pass.cpp libc++ :: std/input.output/file.streams/fstreams/ifstream.assign/nonmember_swap.pass.cpp libc++ :: std/input.output/file.streams/fstreams/ifstream.cons/move.pass.cpp libc++ :: std/input.output/file.streams/fstreams/ifstream.cons/pointer.pass.cpp libc++ :: std/input.output/file.streams/fstreams/ifstream.cons/string.pass.cpp libc++ :: std/input.output/file.streams/fstreams/ifstream.members/close.pass.cpp libc++ :: std/input.output/file.streams/fstreams/ifstream.members/open_pointer.pass.cpp libc++ :: std/input.output/file.streams/fstreams/ifstream.members/open_string.pass.cpp libc++ :: std/input.output/file.streams/fstreams/ifstream.members/rdbuf.pass.cpp libc++ :: std/localization/locales/locale.convenience/conversions/conversions.buffer/pbackfail.pass.cpp libc++ :: std/localization/locales/locale.convenience/conversions/conversions.buffer/underflow.pass.cpp Note: One thing to watch out for when using the SSHExecutor for cross-testing is that you'll also want to specify a TargetInfo object (so that the host's features aren't used for available-features checks and flags setup). http://reviews.llvm.org/D7380 llvm-svn: 230592
* Remove XFAIL on string view test for apples clang compiler. Thanks to ↵Eric Fiselier2015-02-241-1/+1
| | | | | | Marshall for the fix llvm-svn: 230322
* [libc++] Try and prevent evaluation of `is_default_constructible` on tuples ↵Eric Fiselier2015-02-211-0/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | default constructor if it is not needed. Summary: Currently parts of the SFINAE on tuples default constructor always gets evaluated even when the default constructor is never called or instantiated. This can cause a hard compile error when a tuple is created with types that do not have a default constructor. Below is a self contained example using a pair like class. This code will not compile but probably should. ``` #include <type_traits> template <class T> struct IllFormedDefaultImp { IllFormedDefaultImp(T x) : value(x) {} constexpr IllFormedDefaultImp() {} T value; }; typedef IllFormedDefaultImp<int &> IllFormedDefault; template <class T, class U> struct pair { template <bool Dummy = true, class = typename std::enable_if< std::is_default_constructible<T>::value && std::is_default_constructible<U>::value && Dummy>::type > constexpr pair() : first(), second() {} pair(T const & t, U const & u) : first(t), second(u) {} T first; U second; }; int main() { int x = 1; IllFormedDefault v(x); pair<IllFormedDefault, IllFormedDefault> p(v, v); } ``` One way to fix this is to use `Dummy` in a more involved way in the constructor SFINAE. The following patch fixes these sorts of hard compile errors for tuple. Reviewers: mclow.lists, rsmith, K-ballo, EricWF Reviewed By: EricWF Subscribers: ldionne, cfe-commits Differential Revision: http://reviews.llvm.org/D7569 llvm-svn: 230120
* [libcxx] Move to using libc++abi2.exp as the default symbol list for libc++Eric Fiselier2015-02-211-1/+4
| | | | | | | | | | | | | | | | | | | | Summary: libc++abi2.exp should be used whenever `cxxabi.h` defines `_LIBCPPABI_VERSION`. This macro was added to libc++abi in 2012 in r149632. For this reason we should use libc++abi2.exp as default unless otherwise specified. Also when building against an in-tree libc++abi we definitely want to use libc++abi2.exp. I would love to know what OSX was the last to use libc++abi.exp but I can only test on 10.9. Reviewers: danalbert, mclow.lists, EricWF Reviewed By: EricWF Subscribers: meadori, cfe-commits Differential Revision: http://reviews.llvm.org/D7773 llvm-svn: 230119
* More on adding sized deallocation functions in libc++: Continuing from ↵Larisse Voufo2015-02-208-0/+736
| | | | | | r229281, this adds version guards and test cases. llvm-svn: 229968
* Fix incorrect locale mapping in config.py on OSXEric Fiselier2015-02-191-1/+1
| | | | llvm-svn: 229935
* Move to using -fdiagnostics-color=always on both GCC and ClangEric Fiselier2015-02-191-9/+1
| | | | llvm-svn: 229927
* Mark more tuple tests as unsupported in C++98 && C++03Eric Fiselier2015-02-192-0/+4
| | | | llvm-svn: 229810
* [libcxx] Mark most tuple tests UNSUPPORTED for c++03 and c++98.Eric Fiselier2015-02-1952-12/+103
| | | | | | | | | | | | | | Summary: No declaration for the type `tuple` is given in c++03 or c++98 modes. Mark all tests that use the actual `tuple` type as UNSUPPORTED. Reviewers: jroelofs, mclow.lists, danalbert Reviewed By: danalbert Subscribers: cfe-commits Differential Revision: http://reviews.llvm.org/D5956 llvm-svn: 229808
* [libcxx] Tired of colorless compile errors? Enable color diagnostics today!Eric Fiselier2015-02-181-0/+20
| | | | | | | | | | | | | | | | | | | Summary: This patch adds a lit option to enable color diagnostics when either `--param=color_diagnostics` is passed to LIT or `LIBCXX_COLOR_DIAGNOSTICS` is present in the environment. My only concern with this patch is that GCC and Clang take different flags and that only GCC 4.9 and greater support `-fdiagnostics-color=always` Does anybody have objections to this going in? Reviewers: jroelofs, danalbert Reviewed By: danalbert Subscribers: cfe-commits Differential Revision: http://reviews.llvm.org/D7729 llvm-svn: 229707
* Enable testing with _LIBCPP_DEBUG and fix bad assertions in string_view.Eric Fiselier2015-02-181-0/+10
| | | | llvm-svn: 229698
* [libc++] Fix PR20084 - std::is_function<void() const> failed.Eric Fiselier2015-02-181-13/+49
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: This patch introduces some black magic to detect const and volatile qualified function types such as `void () const`. The patch works in the following way: We first rule out any type that satisfies on of the following. These restrictions are important so that the test below works properly. * `is_class<_Tp>::value` * `is_union<_Tp>::value` * `is_void<_Tp>::value` * `is_reference<_Tp>::value` * `__is_nullptr_t<_Tp>::value` If none of the above is true we perform overload resolution on `__source<_Tp>(0)` to determine the return type. * If `_Tp&` is well-formed we select `_Tp& __source(int)`. `_Tp&` is only ill formed for cv void types and cv/ref qualified function types. * Otherwise we select `__dummy_type __source(...)`. Since we know `_Tp` cannot be void then it must be a function type. let `R` be the returned from `__source<_Tp>(0)`. We perform overload resolution on `__test<_Tp>(R)`. * If `R` is `__dummy_type` we call `true_type __test(__dummy_type)`. * if `R` is `_Tp&` and `_Tp&` decays to `_Tp*` we call `true_type __test(_Tp*)`. Only references to function types decay to a pointer of the same type. * In all other cases we call `false_type __test(...)`. `__source<_Tp>(0)` will try and form `_Tp&` in the return type. if `_Tp&` is not well formed the return type of `__source<_Tp>(0)` will be dummy type. `_Tp&` is only ill-formed for cv/ref qualified function types (and void which is dealt with elsewhere). This fixes PR20084 - http://llvm.org/bugs/show_bug.cgi?id=20084 Reviewers: rsmith, K-ballo, mclow.lists Reviewed By: mclow.lists Subscribers: cfe-commits Differential Revision: http://reviews.llvm.org/D7573 llvm-svn: 229696
* [libcxx] Add <experimental/ratio>Eric Fiselier2015-02-1710-0/+404
| | | | | | | | | | | | | | | | | 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
* Rooting out more undefined behavior in char_traits.Marshall Clow2015-02-1316-0/+24
| | | | llvm-svn: 229119
* Appease buildbotsJonathan Roelofs2015-02-131-2/+2
| | | | llvm-svn: 229114
* Modularize TargetInfo discovery in the lit configJonathan Roelofs2015-02-134-29/+98
| | | | | | | | | | When the remote execution patch lands, this will allow us to drop in a replacement TargetInfo object for locale support discovery, alleviating the assumption that host==target. http://reviews.llvm.org/D7601 llvm-svn: 229111
* Fix error checking in get_temp_file_name().Dan Albert2015-02-131-4/+7
| | | | | | | | | | Checking errno without first checking that the call failed means that if some other call prior to mkstemp failed with EINVAL prior to this, the assert would fire even if mkstemp succeeded. If something failed with EEXIST, it would go in to an infinite loop. Change-Id: I3f140a3e15fe08664a38a8c9a950c4ed547eb481 llvm-svn: 229035
* Move the test for zero-length into the char_traits (from string_view). Add ↵Marshall Clow2015-02-124-0/+4
| | | | | | tests to char_traits specializations llvm-svn: 228981
* Remove undefined behavior from test; specifically, compare(NULL, XXX, 0)Marshall Clow2015-02-121-1/+1
| | | | llvm-svn: 228928
* Remove undefined behavior from test; specifically, compare(NULL, XXX, 0). ↵Marshall Clow2015-02-121-2/+1
| | | | | | Thanks to Eric for the catch llvm-svn: 228927
* Need to wrap a bit in an ifdef, since there are no initializer_lists in C++03Marshall Clow2015-02-111-0/+2
| | | | llvm-svn: 228840
* Fix PR 22541: When values are equal, minmax should return the rightmost one ↵Marshall Clow2015-02-111-0/+35
| | | | | | in the initializer_list llvm-svn: 228839
OpenPOWER on IntegriCloud