Commit Graph

2694 Commits

Author SHA1 Message Date
Eric Fiselier e32264a4c0 Fix bugs in recursive_directory_iterator implementation and tests.
There are two fixes in this patch:

* Fix bug where the constructor of recursive_directory_iterator did not reset
  the error code if no failure occurred.

* Fix tests were dependent on the iteration order of the test directories.

llvm-svn: 273060
2016-06-17 22:22:37 +00:00
Eric Fiselier 93e3212c7c Get filesystem tests passing for single-threaded configurations.
llvm-svn: 273054
2016-06-17 21:44:26 +00:00
Eric Fiselier 5e1787a9ea Update status of filesystem issues, and add tests for LWG issue 2683
llvm-svn: 273051
2016-06-17 21:24:11 +00:00
Eric Fiselier 6aa4c100ad Reorder permissions test so they are not dependent on the processes umask
llvm-svn: 273049
2016-06-17 21:00:27 +00:00
Eric Fiselier 34ecebcb23 Respect the processes umask in the create_directory test
llvm-svn: 273048
2016-06-17 20:54:25 +00:00
Eric Fiselier d6f2355f25 Add missing space between >> in template declaration. Fixes C++03 build.
llvm-svn: 273037
2016-06-17 20:16:46 +00:00
Eric Fiselier 7b677ee0de Fix a couple of warnings present in the filesystem tests.
llvm-svn: 273035
2016-06-17 19:57:54 +00:00
Eric Fiselier c79795874a Add Filesystem TS -- Complete
Add the completed std::experimental::filesystem implementation and tests.
The implementation supports C++11 or newer.

The TS is built as part of 'libc++experimental.a'. Users of the TS need to
manually link this library. Building and testing the TS can be disabled using
the CMake option '-DLIBCXX_ENABLE_FILESYSTEM=OFF'.

Currently 'libc++experimental.a' is not installed by default. To turn on the
installation of the library use '-DLIBCXX_INSTALL_EXPERIMENTAL_LIBRARY=ON'.

llvm-svn: 273034
2016-06-17 19:46:40 +00:00
Ed Schouten 04848f9511 Remove CloudABI specific workaround.
CloudABI has gained the mblen_l() function in the meantime that does
properly return whether the character set has shift-states (read:
never).

llvm-svn: 272886
2016-06-16 11:53:11 +00:00
Dan Albert 953d7d4475 Add an Android version check for GNU strerror_r.
Summary:
Android didn't gain GNU's strerror_r until Marshmallow. If we're
building libc++ against something older (we build the NDK library
against the oldest release we support, currently Gingerbread), fall
back to the POSIX version.

Reviewers: mclow.lists, EricWF

Subscribers: tberghammer, danalbert, srhines, cfe-commits

Differential Revision: http://reviews.llvm.org/D21402

llvm-svn: 272827
2016-06-15 20:20:32 +00:00
Eric Fiselier 1ff954f752 Fix warning in tuple tests. The test suite should now run clean with most warnings enabled
llvm-svn: 272822
2016-06-15 19:41:52 +00:00
Eric Fiselier 4e7ab67c0b Add -Wno-unused-command-line-argument when running the test suite to prevent errors
llvm-svn: 272809
2016-06-15 17:25:05 +00:00
Eric Fiselier 1c549d6ba8 Fix const default initialization of lock_guard<>
llvm-svn: 272804
2016-06-15 17:04:40 +00:00
Eric Fiselier 4fae50267a [libcxx] [test] In test/support/test_allocator.h, fix construct() to avoid moving immovable types.
Summary:
In test/support/test_allocator.h, fix construct() to avoid moving immovable types.

This improves the allocator's conformance, and fixes compiler errors with MSVC's STL. The scenario is when the allocator is asked to construct an object of type X that's immovable (deleted copy/move ctors), but implicitly constructible from an argument type A. When perfectly forwarded, X can be (explicitly) constructed from A, and everything is fine. That's std::allocator's behavior, and the Standard's default when a user allocator's construct() doesn't exist. The previous implementation of construct() here mishandled this scenario. Passing A to this construct() would implicitly construct an X temporary, bound to (non-templated) T&&. Then construct() would attempt to move-construct X from that X temporary, but X is immovable, boom.

Reviewers: mclow.lists, EricWF

Subscribers: cfe-commits

Differential Revision: http://reviews.llvm.org/D21094

llvm-svn: 272747
2016-06-15 01:53:32 +00:00
Eric Fiselier 0a707553a5 Improve portability of random_device tests. Patch from STL@microsoft.com
llvm-svn: 272746
2016-06-15 01:50:31 +00:00
Eric Fiselier 5d3e09ecc1 Improve portability of vector tests. Patch from STL@microsoft.com
llvm-svn: 272745
2016-06-15 01:44:22 +00:00
Eric Fiselier 78f8ce484f Improve portability of hash tests. Patch from STL@microsoft.com
llvm-svn: 272744
2016-06-15 01:42:35 +00:00
Eric Fiselier a0dd66423d Automatically detect export lists for OS X.
Summary:
Libc++ reexports symbols from the system libc++abi using -reexport_symbols_list. This can cause a linker failure if the list contains symbols not defined in the system libc++abi.
This patch attempts to detect the OS X version and use it to determine the correct symbol list. 

It's my understanding that `lib/libc++abi2.exp` should be used on 10.9 and greater. Otherwise 'lib/libc++abi.exp' should be used

This fixes PR25666 (https://llvm.org/bugs/show_bug.cgi?id=25666)

Reviewers: mclow.lists, bcraig, dexonsmith, EricWF

Subscribers: cfe-commits

Differential Revision: http://reviews.llvm.org/D20772

llvm-svn: 272723
2016-06-14 21:55:14 +00:00
Eric Fiselier 1317a251c5 Fix bad test that was previously getting ifdef-ed away
llvm-svn: 272722
2016-06-14 21:50:30 +00:00
Eric Fiselier f2f2a6395f Replace __cplusplus comparisons and dialect __has_feature checks with TEST_STD_VER.
This is a huge cleanup that helps make the libc++ test suite more portable.
Patch from STL@microsoft.com. Thanks STL!

llvm-svn: 272716
2016-06-14 21:31:42 +00:00
Marshall Clow 9df8f6c472 Found a couple bugs in the test suite. No functionality change.
llvm-svn: 272679
2016-06-14 15:25:46 +00:00
Eric Fiselier 3d30c32f02 Partially Revert r272613. FreeBSD needs the non-trivial constructors in pair.
llvm-svn: 272671
2016-06-14 14:34:19 +00:00
Eric Fiselier db72c625e2 Update errcat.objects tests so they test the bug fixed in r272640.
llvm-svn: 272642
2016-06-14 06:37:36 +00:00
Eric Fiselier 61df7909ab Fix syntax error in r272640.
llvm-svn: 272641
2016-06-14 06:08:10 +00:00
Eric Fiselier 79e0574db0 Fix error checking for strerror_r implementations that return the error code.
llvm-svn: 272640
2016-06-14 06:03:20 +00:00
Eric Fiselier d046d5422a Avoid octal escape sequence warning with MSVC. Patch from STL@microsoft.com
llvm-svn: 272639
2016-06-14 05:47:46 +00:00
Eric Fiselier 9275b21947 Add missing include
llvm-svn: 272638
2016-06-14 04:58:19 +00:00
Eric Fiselier 596d408718 Temporarily XFAIL variadic lock_guard mangling test for GCC 4.9
llvm-svn: 272637
2016-06-14 04:45:26 +00:00
Eric Fiselier 48f35e074e Implement variadic lock_guard.
Summary:
This patch implements the variadic `lock_guard` paper. 

Making `lock_guard` variadic is a ABI breaking change because the specialization `lock_guard<_Mutex>` mangles differently then when it was the primary template. This change only provides variadic `lock_guard` in ABI V2 or when `_LIBCPP_ABI_VARIADIC_LOCK_GUARD` is defined.

Note that in ABI V2 `lock_guard` must always be declared as a variadic template, even in C++03, in order to keep the ABI consistent. For this reason `lock_guard` is forward declared as a variadic template in all standard dialects and therefore depends on variadic templates being provided as an extension in C++03. All supported versions of Clang and GCC provide this extension.




Reviewers: mclow.lists

Subscribers: K-ballo, mclow.lists, cfe-commits

Differential Revision: http://reviews.llvm.org/D21260

llvm-svn: 272634
2016-06-14 03:48:09 +00:00
Eric Fiselier 9778a6d811 Make system_error::message() thread safe. Fixes PR25598.
Summary:
system_error::message() uses `strerror` for the generic and system categories. This function is not thread safe.

The fix is to use `strerror_r`. It has been available since 2001 for GNU libc and since BSD 4.4 on FreeBSD/OS X.
On platforms with GNU libc the extended version is used which always returns a valid string, even if an error occurs.

In single-threaded builds `strerror` is still used.

See https://llvm.org/bugs/show_bug.cgi?id=25598

Reviewers: majnemer, mclow.lists

Subscribers: erik65536, cfe-commits, emaste

Differential Revision: http://reviews.llvm.org/D20903

llvm-svn: 272633
2016-06-14 03:45:31 +00:00
Eric Fiselier 10e3d1764a Ignore depricated warnings from <ext/hash_map> and <ext/hash_set>
llvm-svn: 272632
2016-06-14 03:26:11 +00:00
Eric Fiselier 3245e1f34b Fix warnings in tests.
llvm-svn: 272629
2016-06-14 03:21:49 +00:00
Eric Fiselier 84685fc831 Remove unused local var. Patch from STL@microsoft.com
llvm-svn: 272622
2016-06-14 02:55:21 +00:00
Eric Fiselier b03da3b65e Prevent truncation warning. Patch from STL@microsoft.com
llvm-svn: 272621
2016-06-14 02:54:15 +00:00
Eric Fiselier f81cfbab12 Fix vector<bool> tests that were using ints. Patch from STL@microsoft.com
llvm-svn: 272620
2016-06-14 02:53:04 +00:00
Eric Fiselier f4755f5b15 Rename variables to prevent shadowing. Patch from STL@microsoft.com
llvm-svn: 272619
2016-06-14 02:51:13 +00:00
Eric Fiselier b2cdce480a Avoid name shadowing in test. Patch from STL@microsoft.com
llvm-svn: 272618
2016-06-14 02:47:46 +00:00
Eric Fiselier 06d14341c5 Silence more unused variable warnings. Patch from STL@microsoft.com
llvm-svn: 272617
2016-06-14 02:46:39 +00:00
Eric Fiselier fbe79c9d25 Remove _LIBCPP_TRIVIAL_PAIR_COPY_CTOR option.
llvm-svn: 272613
2016-06-14 01:36:15 +00:00
Dan Albert ff2addf703 Add `REQUIRES: c++experimental` where appropriate.
Summary:
I haven't added it to all the tests, just those that fail without it
(those that aren't header only).

Reviewers: EricWF, mclow.lists

Subscribers: cfe-commits

Differential Revision: http://reviews.llvm.org/D21247

llvm-svn: 272443
2016-06-10 22:45:11 +00:00
Evandro Menezes 72d6a934cc [streambuf] Added call to traits_type::copy to common case in xsgetn()
Patch by Laman Sole <laxman.g@partner.samsung.com>, Sebastian Pop
<s.pop@samsung.com>, Aditya Kumar <aditya.k7@samsung.com>

Differential Revision: http://reviews.llvm.org/D21103

llvm-svn: 272401
2016-06-10 16:00:29 +00:00
Marshall Clow 54238fd381 Make the comparison objects that we pass in for various tests look more like actual comparison objects. No functional change.
llvm-svn: 272288
2016-06-09 18:34:38 +00:00
Marshall Clow cbfb1487e1 Two more issues w/patches
llvm-svn: 272263
2016-06-09 14:50:38 +00:00
Marshall Clow 79e7c2c9b4 Add notes for 2688
llvm-svn: 272216
2016-06-08 22:33:25 +00:00
Chris Bieneman 687f4df95e [CMake] Cleanup uses of USES_TERMINAL
Now that we are on CMake 3.4.3 we no longer need a version check around this.

This is the libcxx side of r272211.

llvm-svn: 272212
2016-06-08 22:20:28 +00:00
Marshall Clow 96c63abad8 Mark 2441 as ready
llvm-svn: 272202
2016-06-08 21:25:38 +00:00
Marshall Clow 1fe50f3be5 Patch ready for #2436
llvm-svn: 272150
2016-06-08 14:54:35 +00:00
Marshall Clow a11d578b4b Added notes for a bunch of the issues
llvm-svn: 272050
2016-06-07 20:05:57 +00:00
Marshall Clow 13bfcb0b03 Added notes about the issues for Oulu
llvm-svn: 272029
2016-06-07 17:54:38 +00:00
Marshall Clow 6a23af0f33 Avoid Shadowing warnings in the associative containers tests. Thanks to STL for the patch.
llvm-svn: 272018
2016-06-07 15:49:39 +00:00