summaryrefslogtreecommitdiffstats
path: root/libcxx
Commit message (Collapse)AuthorAgeFilesLines
...
* Don't let time_put test use implementation dependent constructs.Ed Schouten2015-03-261-49/+11
| | | | | | | | | | | | | | | | | | | | | | | | | The time_put test doesn't seem to work on Linux and CloudABI. For Linux we already have an XFAIL. Closer inspection seems to reveal that this test does not pass for a couple of reasons. First of all, the tm_yday field is set to an invalid value. The strftime() function doesn't behave consistently across platforms in case the values in the tm structure are incoherent. Fix up this field to have the value 121, which corresponds with tm_mday, tm_mon and tm_year. This of course affects the output of time_put for some modifiers, so update the tests accordingly. Second, some of the tests actually use modifiers that are only present on BSD derived systems. They are not part of the C standard/POSIX. Simply remove them. Finally, some of the tests actually use invalid modifiers, causing a malformed format string to be passed to strftime(). Remove these tests as well. Differential Revision: http://reviews.llvm.org/D8349 llvm-svn: 233262
* Fix incorrect error handling of call to mbrtowc. This is PR#13759. Leaving ↵Marshall Clow2015-03-231-1/+1
| | | | | | the bug open because (1) I'm not sure that we're correct here, only better than before, and (2) no tests llvm-svn: 233012
* Remove unneeded redeclaration of reference_wrapper.Eric Fiselier2015-03-211-2/+0
| | | | llvm-svn: 232887
* Improve automatic detection of filetype for sym_checkEric Fiselier2015-03-201-1/+27
| | | | llvm-svn: 232858
* Fix use of incorrect package name in sym_checkEric Fiselier2015-03-201-1/+1
| | | | llvm-svn: 232856
* Add symbol checking script to libc++ to help manage exported symbols.Eric Fiselier2015-03-2010-0/+492
| | | | | | | | | | | | | | | | | Summary: Add symbol checking scripts for extracting a list of symbols from shared libraries and for comparing symbol lists for differences. Reviewers: mclow.lists, danalbert, EricWF Reviewed By: EricWF Subscribers: majnemer, emaste, cfe-commits Differential Revision: http://reviews.llvm.org/D4946 llvm-svn: 232855
* Create macro to allow testing of is_convertible without the compiler builtin.Eric Fiselier2015-03-191-1/+2
| | | | | | | | | | | | | | Summary: This patch also fixes one test case that failed in the library version of is_convertible. Reviewers: mclow.lists, EricWF Reviewed By: EricWF Subscribers: cfe-commits Differential Revision: http://reviews.llvm.org/D8456 llvm-svn: 232764
* [libcxx] Unify LIBCXX_<ABI-Name>_INCLUDE_PATHS to be ↵Eric Fiselier2015-03-193-11/+32
| | | | | | | | | | | | | | | | | | | | | | LIBCXX_CXX_ABI_INCLUDE_PATHS Summary: Clean up all the different possible CMake options for specifying the ABI include paths into one CMake option named `LIBCXX_CXX_ABI_INCLUDE_PATHS`. The documentation has been updated to reflect this change. For the next week I have added explicit errors if any of the old flags is used. These errors inform users of the change and the new option to use. Before committing the change I will announce this change on cfe-dev. Reviewers: danalbert, mclow.lists Reviewed By: danalbert, mclow.lists Subscribers: jroelofs, cbergstrom, cfe-commits Differential Revision: http://reviews.llvm.org/D5039 llvm-svn: 232762
* Add code to honor the match_not_bol and match_not_eol regex flats. Fixes ↵Marshall Clow2015-03-193-2/+104
| | | | | | PR#22651. Thanks to Jim Porter for the report and suggested fix. llvm-svn: 232733
* Add support for kfreebsd. Thanks to Jan HenkeSylvestre Ledru2015-03-191-1/+1
| | | | | | | Reported on the Debian BTS: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=780106 llvm-svn: 232714
* Fix use after free and calls to operator comma in debug modeEric Fiselier2015-03-192-2/+2
| | | | llvm-svn: 232703
* [libc++] Fix PR22922 - Allocator support for std::function does not know how ↵Eric Fiselier2015-03-186-17/+34
| | | | | | | | | | | | | | | | | | | to rebind. Summary: This patch changes std::function to use allocator_traits to rebind the allocator instead of allocator itself. It also changes most of the tests to use `bare_allocator` where possible instead of `test_allocator`. Reviewers: mclow.lists Reviewed By: mclow.lists Subscribers: cfe-commits Differential Revision: http://reviews.llvm.org/D8391 llvm-svn: 232686
* Provide std::abs(<floating-point>) in <cmath> on Solaris.Eric Fiselier2015-03-181-0/+4
| | | | | | | | | | | | | | | | 1) <cstdlib> header should define std::abs([int|long|long long]) functions. They use "using ::abs" to import these functions (which are declared in <stdlib.h>) into std namespace. 2) <cmath> header should define std::abs([float|double|long double]) function. If we try define new functions in std namespace, then it will cause compile error in <cstdlib> because "using ::abs" will try import not only [int|long|long long] functions, but also [float|double|long double] which are defined in <math.h> header on solaris. Patch by C Bergstrom. llvm-svn: 232641
* 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
* Clean up iostream creation in preparation for conditionalizing streams.Ed Schouten2015-03-171-18/+20
| | | | | | | | | | | | Interleave the code for narrow and wide character streams. This makes it more obvious that the two pieces of code are identical. Furthermore, it makes it easier to conditionally compile support for certain streams, as less #ifdef blocks are needed. Differential Revision: http://reviews.llvm.org/D8342 Reviewed by: marshall llvm-svn: 232516
* [libcxx] Add <experimental/tuple> header for LFTS.Eric Fiselier2015-03-1718-11/+1694
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* Define a new macro: _LIBCPP_HAS_NO_VARIABLE_TEMPLATES and use it. No ↵Marshall Clow2015-03-175-8/+16
| | | | | | functionality change. llvm-svn: 232493
* [libcxx] Move tuple_size and tuple_element overloads for pair and array out ↵Eric Fiselier2015-03-178-120/+148
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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-162-0/+22
| | | | | | 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
* Make *abs() and *div() work on CloudABI.Ed Schouten2015-03-162-0/+8
| | | | | | | | According to POSIX, *abs() and *div() are allowed to be macros (in addition to being functions). Make sure we undefine these, so that std::*abs() and std::*div() work as expected. llvm-svn: 232379
* 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
* Fix build break on Solaris introduced by r231940Jonathan Roelofs2015-03-131-0/+2
| | | | | | | | | Solaris apparently doesn't have iswblank_l. Thanks to C Bergstrom for the report! llvm-svn: 232172
* Update copyright year to 2015.Renato Golin2015-03-121-1/+1
| | | | llvm-svn: 232094
* Also enable the default rune table on CloudABI.Ed Schouten2015-03-121-1/+1
| | | | | | CloudABI does not expose a table on its own. llvm-svn: 232050
* Add option to disable access to the global filesystem namespace.Ed Schouten2015-03-1215-0/+104
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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-113-30/+95
| | | | | | | | | 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
* Disable cat*() on CloudABI. Also make tiny cleanups.Ed Schouten2015-03-112-11/+17
| | | | | | | | | | | | | | | | On a new platform that I am working on (https://github.com/NuxiNL/cloudlibc) I am not implementing the cat{open,close,gets}() API, just like Android, Newlib, etc. Instead of adding yet another operating system name to the #ifs, introduce _LIBCPP_HAS_CATOPEN in include/__config. Also adjust the code to only pull in nl_types.h when _LIBCPP_HAS_CATOPEN is set. We only needed this header for the cat*() API. Differential Revision: http://reviews.llvm.org/D8163 Reviewed by: marshall llvm-svn: 231937
* Move Android to the builtin rune table.Dan Albert2015-03-113-9/+5
| | | | llvm-svn: 231897
* 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
* Also use LC_C_LOCALE on CloudABI.Ed Schouten2015-03-101-1/+1
| | | | | | | | | Before I discovered that NetBSD provides a permanent handle to the C locale called LC_C_LOCALE, I also added support for this to CloudABI under the name LC_POSIX_LOCALE. I've renamed it to LC_C_LOCALE to improve compatibility. llvm-svn: 231780
* Enable _LIBCPP_LOCALE__L_EXTENSIONS on CloudABI.Ed Schouten2015-03-101-1/+2
| | | | | | | | CloudABI provides the _l() functions that are part of POSIX.1-2008, but also the extensions that are available on systems like OS X and *BSD (scanf_l, printf_l, etc). llvm-svn: 231777
* Don't include <sys/sysctl.h> on CloudABI.Ed Schouten2015-03-101-2/+2
| | | | | | | As CloudABI does not provide sysctl(), this header is not present. Make thread.cpp build correctly (and pass all tests) by not including the header. llvm-svn: 231768
* Print log/error messages on stderr, not stdoutEd Schouten2015-03-103-10/+10
| | | | | | | | | | | | There are a couple of places where libc++ prints log/error messages to stdout on its own. This may of course interfere with the output generated with applications. Log/error messages should be directed to stderr instead. Differential Revision: http://reviews.llvm.org/D8135 Reviewed by: marshall llvm-svn: 231767
* Add support for arc4random() to random_device.Ed Schouten2015-03-104-45/+78
| | | | | | | | | | | | | | | | | | | | | | | | | | 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-102-3/+37
| | | | | | | | | | | | | | 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
* Fix another -Wunused-local-typedef warning in include/__tree.Dimitry Andric2015-03-091-1/+0
| | | | | | | | | The _Pp typedef in __tree<_Tp, _Compare, _Allocator>::__count_multi() isn't used anywhere, so adding _LIBCPP_UNUSED is unecessary. Differential Revision: http://reviews.llvm.org/D8140 llvm-svn: 231705
* 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-093-27/+57
| | | | | | 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
OpenPOWER on IntegriCloud