Commit Graph

2895 Commits

Author SHA1 Message Date
Eric Fiselier 0e9272bee2 Placate MSVC's unchecked malloc warning in thread tests.
llvm-svn: 273385
2016-06-22 05:44:08 +00:00
Eric Fiselier 19d44836d7 Use correct Clang feature names. I got them wrong in the previous commit
llvm-svn: 273384
2016-06-22 05:40:17 +00:00
Eric Fiselier 94713d1671 Support old GCC exception and rtti detection macros
llvm-svn: 273383
2016-06-22 05:33:52 +00:00
Eric Fiselier 88d38802e2 Add tests for RTTI/exceptions test macros.
llvm-svn: 273382
2016-06-22 05:29:15 +00:00
Eric Fiselier eb067d4ebd Fix exception/rtti detection in tests.
So the macros TEST_HAS_NO_EXCEPTIONS and TEST_HAS_NO_RTTI were always
getting defined because I spelt __cpp_exceptions and __cpp_rtti as
__cxx_exceptions and __cxx_rtti.

Tests incoming after this patch.

llvm-svn: 273381
2016-06-22 05:03:10 +00:00
Eric Fiselier 74480010dc Make shared_ptr constructor tests use count_new.hpp
llvm-svn: 273379
2016-06-22 04:51:07 +00:00
Eric Fiselier 739cc95471 Make locale constructors tests use count_new.hpp
llvm-svn: 273375
2016-06-22 04:34:24 +00:00
Eric Fiselier cc4162293f Placate MSVC's unchecked malloc warnings.
llvm-svn: 273374
2016-06-22 04:23:54 +00:00
Eric Fiselier 32853ad707 UBSan doesn't globally replace new/delete but it still makes some tests fail. Investigation needed.
llvm-svn: 273372
2016-06-22 04:00:45 +00:00
Eric Fiselier 8ff7432534 Cleanup [list.modifiers] tests.
llvm-svn: 273371
2016-06-22 03:46:32 +00:00
Eric Fiselier a97d34a982 Don't use non-conforming pointer_traits specialization it tests.
llvm-svn: 273368
2016-06-22 02:31:32 +00:00
Eric Fiselier 56f23a3f7f Move remaining _LIBCPP_VERSION tests into test/libcxx
llvm-svn: 273367
2016-06-22 02:23:22 +00:00
Eric Fiselier 189d6a8834 Move more _LIBCPP_VERSION tests to test/libcxx.
llvm-svn: 273365
2016-06-22 02:07:26 +00:00
Eric Fiselier 0202dec266 Move all tests for _LIBCPP_VERSION in language.support to test/libcxx/language.support.
llvm-svn: 273364
2016-06-22 01:55:59 +00:00
Eric Fiselier 505ceacd3b Move typoed dir meta.hel to meta.help
llvm-svn: 273362
2016-06-22 01:42:39 +00:00
Eric Fiselier 77d2d95973 Use static_assert instead of runtime assert in std::money_base tests.
llvm-svn: 273360
2016-06-22 01:40:46 +00:00
Eric Fiselier bae51d36aa Remove locale tests that depend on LC_ALL. These are non-portable.
llvm-svn: 273359
2016-06-22 01:33:38 +00:00
Eric Fiselier 46fb2b903e Fix comment typos, strip trailing whitespace. Patch from STL@microsoft.com
llvm-svn: 273357
2016-06-22 01:23:51 +00:00
Eric Fiselier 8d0d842e7b Avoid huge main() functions and huge arrays. Patch from STL@microsoft.com
llvm-svn: 273354
2016-06-22 01:13:44 +00:00
Eric Fiselier 7a580d0a72 Don't use C++17 terse static assert. Patch from STL@microsoft.com
llvm-svn: 273353
2016-06-22 01:10:14 +00:00
Eric Fiselier 060ecaf672 Fix operator precedence mistake in valarray/not.pass.cpp. Patch from STL@microsoft.com
llvm-svn: 273352
2016-06-22 01:04:09 +00:00
Eric Fiselier 408d6ebd2d Suppress stupid and incorrect MSVC warning. patch from STL@microsoft.com
llvm-svn: 273350
2016-06-22 01:02:08 +00:00
Eric Fiselier df839e04b4 Avoid assignment in return. Patch from STL@microsoft.com
llvm-svn: 273349
2016-06-22 01:00:32 +00:00
Eric Fiselier c1d08ff069 Suppress unused warnings in std::invoke tests.
llvm-svn: 273348
2016-06-22 00:58:06 +00:00
Eric Fiselier 5f15481f87 Guard libc++ assumption about identity hashing in test. Patch from STL@microsoft.com
llvm-svn: 273345
2016-06-22 00:53:35 +00:00
Eric Fiselier c36f0331df Guard use of non-standard macros in denorm_min() tests.
llvm-svn: 273344
2016-06-22 00:50:09 +00:00
Eric Fiselier 0df0296974 Allow placement new array test to consume extra bytes as specified by the standard.
llvm-svn: 273342
2016-06-22 00:32:28 +00:00
Eric Fiselier 97e0ba02fd Move native_handle thread tests to test/libcxx
llvm-svn: 273341
2016-06-22 00:21:50 +00:00
Eric Fiselier 092386771d Fix PR27684 - std::tuple no longer accepts reference to incomplete type in some cases.
Libc++ has to deduce the 'allocator_arg_t' parameter as 'AllocArgT' for the
following constructor:

  template <class Alloc> tuple(allocator_arg_t, Alloc const&)

Previously libc++ has tried to support tags derived from 'allocator_arg_t' by
using 'is_base_of<AllocArgT, allocator_arg_t>'. However this breaks whenever a
2-tuple contains a reference to an incomplete type as its first parameter.

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

llvm-svn: 273334
2016-06-21 23:19:13 +00:00
Eric Fiselier 44e2ebadb2 Implement LWG issue 2720. Replace perms::resolve_symlinks with perms::symlink_nofollow.
This changes how filesystem::permissions(p, perms) handles symlinks. Previously
symlinks were not resolved by default instead only getting resolved when
"perms::resolve_symlinks" was used. After this change symlinks are resolved
by default and perms::symlink_nofollow must be given to change this.

This issue has not yet been moved to Ready status, and I will revert if it
doesn't get moved at the current meeting. However I feel confident that it
will and it's nice to have implementations when moving issues.

llvm-svn: 273328
2016-06-21 22:42:42 +00:00
Eric Fiselier 310d3b975f Implement LWG issue 2725. The issue should move this meeting
llvm-svn: 273325
2016-06-21 22:11:16 +00:00
Eric Fiselier 48bc850917 Allow the libc++ build/source paths to contain symlinks.
The filesystem tests were expecting the paths to the build/source directories
did not contain any symlinks. This patch resolves those symlinks before running
the test suite.

llvm-svn: 273323
2016-06-21 21:54:23 +00:00
Jonathan Coe 4fc9221616 Add entry to CREDITS.TXT for propagate_const
llvm-svn: 273123
2016-06-19 19:36:28 +00:00
Jonathan Coe 945cacc842 Implement std::experimental::propagate_const from LFTS v2
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
2016-06-19 19:34:13 +00:00
Marshall Clow 92c9fef95f Test commit; remove some spaces at EOL. No functional change.
llvm-svn: 273121
2016-06-19 19:29:52 +00:00
Eric Fiselier 990952b664 Fix various undefined behavior found by UBSan.
* Fix non-null violation in strstream.cpp
  Overflow was calling memcpy with a null parameter and a size of 0.

* Fix std/atomics/atomics.flag/ tests:
  a.test_and_set() was reading from an uninitialized atomic, but wasn't
  using the value. The tests now clear the flag before performing the
  first test_and_set. This allows UBSAN to test that clear doesn't read
  an invalid value.

* Fix std/experimental/algorithms/alg.random.sample/sample.pass.cpp
  The tests were dereferencing a past-the-end pointer to an array so that
  they could do pointer arithmetic with it. Instead of dereference the iterator
  I changed the tests to use the special 'base()' test iterator method.

* Add -fno-sanitize=float-divide-by-zero to suppress division by zero UBSAN diagnostics.
  The tests that cause float division by zero are explicitly aware that they
  are doing that. Since this is well defined for IEEE floats suppress the warnings
  for now.

llvm-svn: 273107
2016-06-19 07:08:27 +00:00
Eric Fiselier be13be47ba Implement LWG issue 1169. num_get not fully compatible with strto*
Use strtof and strtod for floats and doubles respectively instead of
always using strtold. The other parts of the change are already implemented
in libc++.

This patch also has a drive by fix to wbuffer_convert::underflow() which
prevents it from calling memmove(buff, null, 0).

llvm-svn: 273106
2016-06-19 06:58:22 +00:00
Eric Fiselier 37ba54e5d7 Add UBSan blacklist for <__tree> and <__hash_table>
We all know <__tree> and <__hash_table> have plenty of UB that UBSan faithfully
finds. I am working on fixing this. However the noisy output from these failures
prevent automatically detecting regressions elsewhere.

This patch adds a blacklist file for these failures so I can later set up a
UBSAN buildbot.

llvm-svn: 273104
2016-06-19 02:25:22 +00:00
Eric Fiselier 629645d83d Fix bugs in last_write_time implementation.
* Fix passing a negative number as either tv_usec or tv_nsec. When file_time_type
  is negative and has a non-zero sub-second value we subtract 1 from tv_sec
  and make the sub-second duration positive.

* Detect and report when 'file_time_type' cannot be represented by time_t. This
  happens when using large/small file_time_type values with a 32 bit time_t.

There is more work to be done in the implementation. It should start to use
stat's st_mtim or st_mtimeval if it's provided as an extension. That way
we can provide a better resolution.

llvm-svn: 273103
2016-06-19 02:04:49 +00:00
Eric Fiselier d7ae63da67 Remove Apple specific guard for utimensat. Use !defined(UTIME_OMIT) instead.
As pointed out by @majnemer this is a better way to detect utimensat on all
platforms. The Apple specific guard is unneeded.

llvm-svn: 273093
2016-06-18 19:11:40 +00:00
Eric Fiselier b88d8f6346 Add -Wno-covered-switch-default while compiling libc++
fstream has a switch over ios_base::seekdir which provides a defensive default
case. This seems like the right thing for fstream to do, but we need to disable
clangs warning during the build to allow this.

llvm-svn: 273092
2016-06-18 18:55:18 +00:00
Eric Fiselier 824ed8c03e Fix SleepFor(...) helper when a monotonic clock is not available.
Single threaded builds often don't provide a monotonic clock, so we can't
always provide a monotonic SleepFor(...) implementation. Hopefully this
won't cause the builds to hang.

llvm-svn: 273091
2016-06-18 18:32:26 +00:00
Eric Fiselier 97d72df6b0 Use monotonic clock in synthetic SleepFor test helper
llvm-svn: 273089
2016-06-18 17:51:11 +00:00
Eric Fiselier d9ed9c462b Use utimes instead of utimensat when !defined(UTIME_OMIT). Fixes build for older GLIBC versions
llvm-svn: 273088
2016-06-18 17:37:04 +00:00
Eric Fiselier dc62be1915 Fix 3 bugs in filesystem tests and implementation.
This patch fixes the following bugs, all of which were discovered while
testing a 32 bit build on a 64 bit machine.

* path.itr/iterator.pass.cpp has undefined behavior.
  'path::iterator' stashes the value of the element inside the iterator.
  This violates the BiDirIterator requirements but is allowed for path::iterator.
  However this means that using reverse_iterator<path::iterator> has undefined
  behavior because it assumes that 'Iter tmp = it; return *tmp' will not create
  a dangling reference. However it does, and this caused this particular test
  to fail.

* path.native.obs/string_alloc.pass.cpp tested the SSO with a long string.
  On 32 bit builds std::wstring only has the SSO for strings of size 2. The
  test was using a string of size 4.

* fs.op.space/space.pass.cpp had overflows while calculating the expected values.
  The fix here is to convert the statvfs data members to std::uintmax_t before
  multiplying them. The internal implementation already does this but the tests
  needed to do it as well.

llvm-svn: 273078
2016-06-18 04:10:23 +00:00
Eric Fiselier df93bad1fe Enable building and using atomic shared_ptr for GCC.
Summary:
Currently the  implementation of [util.smartptr.shared.atomic] is provided only when using Clang, and not with GCC. This is a relic of not having a GCC implementation of <atomic>, even though <atomic> isn't actually used in the implementation. This patch enables support for atomic shared_ptr functions when using GCC.

Note that this is not a header only change. Previously only Clang builds of libc++.so would provide the required symbols. There is no reason  for this restriction.
After this change both Clang and GCC builds should be binary compatible with each other WRT these symbols.


Reviewers: mclow.lists, rmaprath, EricWF

Subscribers: cfe-commits

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

llvm-svn: 273076
2016-06-18 02:12:53 +00:00
Eric Fiselier ccc9826f56 Add additional tests in an attempt to diagnose ARM test failures.
Currently 4 tests are failing on the ARM buildbot. To try and diagnose each
of the failures this patch does the following:

1) path.itr/iterator.pass.cpp
   * Temporarily print iteration sequence to see where its failing.

2) path.native.obs/string_alloc.pass.cpp
   * Remove test that ::new is not called when constructing a short string
     that requires a conversion. Since during the conversion global locale
     objects might be constructed.

3) fs.op.funcs/space.pass.cpp
   * Explicitly use uintmax_t in the implementation of space, hopefully
     preventing possible overflows.
   * Add additional tests that check for overflow is the calculation of the
     space_info values.
   * Add additional tests for the values returned from statfvs.

4) fs.op.funcs/last_write_time.pass.cpp
   * No changes made yet.

llvm-svn: 273075
2016-06-18 02:11:48 +00:00
Eric Fiselier ed4035059f Add checkpoints to string allocation test to help with debugging arm failures.
llvm-svn: 273072
2016-06-18 00:23:13 +00:00
Eric Fiselier 25255013ba Fix bugs in recursive_directory_iterator::increment(ec) implementation and tests.
r273060 didn't completely fix the issues in recursive_directory_iterator and
the tests. This patch follows up with more fixes

* Fix bug where recursive_directory_iterator::increment(ec) did not reset
  the error code if no failure occurred.

* Fix bad assertion in the recursive_directory_iterator::increment(ec) test
  that would only fire for certain iteration orders.

llvm-svn: 273070
2016-06-17 23:57:16 +00:00
Eric Fiselier 5b58d0dffb Work around GCC bug in tests. The bug has been fixed in GCC 6.0
llvm-svn: 273068
2016-06-17 23:30:40 +00:00
Eric Fiselier 1544e657b2 Fix initialization of test case array in C++11
llvm-svn: 273065
2016-06-17 22:36:47 +00:00
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
Marshall Clow 217cf69b92 Rename some test data (and make it const) to rid us of some shadowing warnings in the test suite. No functional change. Thanks to STL@microsoft for the report and patch.
llvm-svn: 271919
2016-06-06 18:24:08 +00:00
Marshall Clow 3a407a096c Remove arithmetic +/-127 on chars; results in UB when dealing with signed chars. Thanks to STL@microsoft for the report.
llvm-svn: 271897
2016-06-06 14:35:22 +00:00
Marshall Clow e499d086aa Don't call memmove when there's nothing to move. Fixes PR#27978.
llvm-svn: 271794
2016-06-04 16:16:59 +00:00
Asiri Rathnayake 981986cdfc [libcxx] Fix c++98 test failures.
Adds XFAIL/UNSUPPORTED lit tags as appropriate. Gets a clean test run
for -std=c++98 on Fedora 20.

NFC.

llvm-svn: 271741
2016-06-03 21:40:03 +00:00
Asiri Rathnayake 1f077f6b2b [libcxx] Fix thread join.pass.cpp segfault after r271475
Some pthread implementations do not like being called pthead_join()
with the pthread_t argument set to 0, and causes a segfault. This
patch fixes this issue by validating the pthread_t argument before
invoking pthread_join().

NFC.

Differential revision: http://reviews.llvm.org/D20929

Change-Id: Ief817c57bd0e1f43cbaa03061e02417d6a180c38
Reviewers: EricWF
llvm-svn: 271634
2016-06-03 08:45:26 +00:00
Eric Fiselier 881334e76b Add not_fn test for throwing operator!
llvm-svn: 271502
2016-06-02 08:37:00 +00:00
Eric Fiselier eb066bc29d Fix TEST_HAS_NO_EXCEPTIONS misspelling in the test suite.
llvm-svn: 271501
2016-06-02 08:19:02 +00:00
Eric Fiselier 58ff77c2e0 Mark LWG issue 2545 as complete. Add extra tests
llvm-svn: 271489
2016-06-02 05:44:14 +00:00
Eric Fiselier 7cf29e3468 Fix leak in __enable_weak_this(). Thanks to Arthur O'Dwyer for finding it.
llvm-svn: 271487
2016-06-02 04:57:00 +00:00
Eric Fiselier 9b903af3e9 Mark LWG issue 2218 as complete.
LWG issue 2218 relaxes a restriction on how containers can call
Alloc::construct(...) and Alloc::destroy(...). There is nothing new to test.

llvm-svn: 271477
2016-06-02 04:13:41 +00:00
Eric Fiselier 91ae4a078b Mark LWG issue 2336 as complete. There is nothing to do.
llvm-svn: 271476
2016-06-02 04:08:03 +00:00
Eric Fiselier 4efa1ad561 Mark LWG issue 2250 as complete
llvm-svn: 271475
2016-06-02 04:03:31 +00:00
Eric Fiselier d697ee41bc Mark LWG issue 2450 as complete.
llvm-svn: 271473
2016-06-02 03:12:44 +00:00
Eric Fiselier e44604aec7 Update libcxx.llvm.org documentation by linking to new docs.
Summary:
Currently much of the libcxx website is duplicated between the old www/ documentation and newer Sphinx docs. This patch changes the main libc++ webpage so that it links to the new documentation where possible. This means removing numerous sections from the landing page.

@mclow.lists What do you think?

Reviewers: mclow.lists

Subscribers: cfe-commits, mclow.lists

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

llvm-svn: 271469
2016-06-02 02:16:28 +00:00
Eric Fiselier 5725756791 Add C++17 std::not_fn negator.
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
2016-06-02 01:25:41 +00:00
Eric Fiselier a4f2460fa5 [libcxx] Allow target flags to affect CMake configuration tests
Summary:
This patch changes the libc++ CMake so that it adds certain target flags like '-m32' or '--gcc-toolchain' before including config-ix.cmake.
Since these flags can affect things like check_library_exists([...]) they needed to be added before the tests are performed.

This patch fixes:

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

Reviewers: danalbert, jroelofs, bcraig, compnerd

Subscribers: cfe-commits

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

llvm-svn: 271460
2016-06-02 01:10:08 +00:00
Eric Fiselier 39a724ea36 Remove enable_shared_from_this test since it leaks the control block and fails with ASAN
llvm-svn: 271459
2016-06-02 01:09:12 +00:00
Eric Fiselier 88f5bfdc5b Implement P0033R1 - Re-enabling shared_from_this
Summary: See http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2016/p0033r1.html

Reviewers: mclow.lists

Subscribers: cfe-commits

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

llvm-svn: 271449
2016-06-02 00:15:35 +00:00
Eric Fiselier d04c685168 Remove trailing whitespace in test suite. Approved by Marshall Clow.
llvm-svn: 271435
2016-06-01 21:35:39 +00:00
Eric Fiselier eb5cfb02d6 Cleanup non-standard tests as reported by STL@microsoft.com. NFC.
This patch addresses the following issues in the test suite:

1. Move "std::bad_array_length" test from std/ to libcxx/ test directory
   since the feature is not a part of the standard.

2. Rename "futures.tas" test directory to "futures.task" since that is the
   correct stable name.

3. Move tests for "packaged_task<T>::result_type" from std/ to libcxx/
   test directory since the typedef is a libc++ extension.

llvm-svn: 271430
2016-06-01 21:05:53 +00:00
Chris Bieneman 752cd33136 [CMake] Update to requiring CMake 3.4.3
Summary:
This is as per the discussions on developer lists:

http://lists.llvm.org/pipermail/llvm-dev/2016-April/098780.html
http://lists.llvm.org/pipermail/llvm-dev/2016-May/100058.html

Subscribers: cfe-commits

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

llvm-svn: 271329
2016-05-31 20:21:52 +00:00
Marshall Clow 30bffb9dcf Issues for Oulu
llvm-svn: 271282
2016-05-31 14:29:38 +00:00
Eric Fiselier 7939ae5e08 Mark LWG issue 2520 as complete
llvm-svn: 271249
2016-05-31 04:27:57 +00:00
Eric Fiselier b56f446e2d Add tests that got missed in r271247.
llvm-svn: 271248
2016-05-31 01:51:34 +00:00
Eric Fiselier 5362bbb02a Mark LWG issue 2276 as complete. Add _LIBCPP_ASSERTS for it
llvm-svn: 271247
2016-05-31 01:50:55 +00:00
Eric Fiselier 3bdbb10a48 Mark LWG issue 2537 as complete
llvm-svn: 271241
2016-05-31 01:11:20 +00:00
Eric Fiselier 0ddc14c256 Mark LWG issue #2585 as complete
llvm-svn: 271240
2016-05-31 01:03:07 +00:00
Eric Fiselier 4c46801fa7 Mark LWG issue 2565 as complete. Update the tests to check it.
llvm-svn: 271238
2016-05-31 00:23:31 +00:00
Eric Fiselier af4a5a7f33 Make string_view work with -fno-exceptions and get tests passing.
llvm-svn: 271237
2016-05-30 23:53:19 +00:00
Eric Fiselier 424b5ee8f7 Cleanup error handling when TLS creation fails
llvm-svn: 271235
2016-05-30 23:15:19 +00:00
Eric Fiselier 928431af53 Mark LWG issue #2522 as complete
llvm-svn: 271231
2016-05-30 21:30:46 +00:00
Eric Fiselier 9ef549212c Fix bug in test allocator that incorrectly computed the allocation size
llvm-svn: 271195
2016-05-30 01:31:04 +00:00
Asiri Rathnayake 6edc12c886 [libcxx] Improve tests to use the UNSUPPORTED lit directive
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
2016-05-28 08:57:35 +00:00
Eric Fiselier 71c425f199 Add missing include to test_iterators.h
llvm-svn: 271074
2016-05-27 23:43:29 +00:00
Eric Fiselier 139dc2d728 Fix PR27751. Add proper dependancies for install-libcxx-headers rule
llvm-svn: 271073
2016-05-27 23:33:10 +00:00
Eric Fiselier 72a819e155 Fix PR27875. Parse LIBCXX_CXX_ABI_LIBRARY_PATH as a path not a string
llvm-svn: 271070
2016-05-27 23:05:37 +00:00
Eric Fiselier 38e229f909 Guard testing of tuple extensions to make tests portable
llvm-svn: 271065
2016-05-27 22:41:45 +00:00
Eric Fiselier 589308a0b1 Tolerate incorrect return type for 'isinf' and 'isnan' in tests.
Summary:
GLIBC recently removed the incorrect `int isinf(double)` and `int isnan(double)` overloads in C++11 and greater. This causes previously `XFAIL: linux`  tests to start passing.

Since there is no longer a way to 'XFAIL' the tests I choose to simply tolerate this bug.

See https://sourceware.org/bugzilla/show_bug.cgi?id=19439


Reviewers: rsmith, mclow.lists, EricWF

Subscribers: jroelofs, cfe-commits

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

llvm-svn: 271060
2016-05-27 22:19:53 +00:00
Ben Craig b9599b1b23 [libcxx] Allow explicit pthread opt-in
The existing pthread detection code in __config is pretty good for
common operating systems. It doesn't allow cmake-time choices to be
made for uncommon operating systems though.

This change adds the LIBCXX_HAS_PTHREAD_API cmake flag, which turns
into the _LIBCPP_HAS_THREAD_API_PTHREAD preprocessor define. This is
a name change from the old _LIBCPP_THREAD_API_PTHREAD. The lit tests
want __config_site.in variables to have a _LIBCPP_HAS prefix.

http://reviews.llvm.org/D20573

llvm-svn: 270735
2016-05-25 17:40:09 +00:00
Ben Craig 57b8b1f75f Reorganize locale extension fallbacks. NFCI
The various _l locale extension functions originate from very
different places.  Some come from POSIX, some are BSD extensions,
and some are shared BSD and GLIBC extensions. This patch tries to
group the local extension reimplementations by source. This should
make it easier to make libcxx work with POSIX compliant C libraries
that lack these extensions.

The fallback locale functions are also useful on their own for other
lightweight platforms. Putting these fallback implementations in
support/xlocale should enable code sharing.

I have no access to a newlib system or an android system to build
and test with. I _do_ have access to a system without any of the _l
locale extensions though, and I was able to ensure that the new
__posix_l_fallback.h and __strtonum_fallback.h didn't have any massive
problems.

http://reviews.llvm.org/D17416

llvm-svn: 270213
2016-05-20 12:58:41 +00:00
Eric Fiselier 53df829bd1 Cleanup superfluous std:: qualifiers in <type_traits>
llvm-svn: 269998
2016-05-18 23:09:24 +00:00
Eric Fiselier ae7619a8a3 Optimize declval for compile times. Patch from Eric Niebler.
This patch implements the C++11 version of declval without requiring a template
instantiation.

See PR27798 for more information. https://llvm.org/bugs/show_bug.cgi?id=27798

llvm-svn: 269991
2016-05-18 22:23:46 +00:00
Marshall Clow 2dd562e3d9 Mark LWG2583 as complete. I did this a while ago, and forgot to update the table.
llvm-svn: 269973
2016-05-18 19:31:01 +00:00
Marshall Clow 3379baeb99 Change the control flow in atomic_compare_exchange_strong to avoid a potential deadlock.
When you assign a shared_ptr, the deleter gets called and assigned. In this routine, the assignment happens inside a critical section, which could (potentially) lead to a deadlock, if the deleter did something wonky. Now we swap the old value with an (empty) temporary shared_ptr, and then let the temporary delete the old value when it goes out of scope (after the lock has been released).  This should fix PR#27724. Thanks to Hans Boehm for the bug report and the suggested fix.

llvm-svn: 269965
2016-05-18 17:50:13 +00:00
Eric Fiselier 6a05b007ff Test hijacking ADL for operator& in the stream iterator constructors.
llvm-svn: 269838
2016-05-17 21:01:20 +00:00
Eric Fiselier 7b65137677 Add test for r269789
llvm-svn: 269812
2016-05-17 19:52:32 +00:00
Marshall Clow bc6a7df072 Implement LWG2576: istream_iterator and ostream_iterator should use std::addressof
llvm-svn: 269789
2016-05-17 17:44:40 +00:00
Marshall Clow 6c3fa193bf Add some checking so that the TEST_HAS_XXX macros match up with the _LIBCPP_NO_HAS_XXX macros. No functional change
llvm-svn: 269773
2016-05-17 14:58:09 +00:00
Marshall Clow 4328c2bac8 Implement P0030R1: Introduce a 3-Argument Overload to std::hypot
llvm-svn: 269772
2016-05-17 14:52:19 +00:00
Eric Fiselier 46a256a3eb Remove C++11 feature macros in tests. Use TEST_STD_VER instead.
llvm-svn: 269669
2016-05-16 17:05:14 +00:00
Marshall Clow 779ddd134d Add a test for uniqueptr having either NULL and nullptr
llvm-svn: 269665
2016-05-16 16:57:15 +00:00
Marshall Clow 0e1c6c7ed1 Add a couple of _LIBCPP_ASSERT calls. No functional change.
llvm-svn: 269663
2016-05-16 16:55:32 +00:00
Asiri Rathnayake 28383a4e03 Disable LIBCXX_ENABLE_ABI_LINKER_SCRIPT for static library builds.
This option is geared towards shared library builds and causes static
library builds to fail if not explicitly disabled.

This patch fixes PR27706: https://llvm.org/bugs/show_bug.cgi?id=27706

Thanks rgoodfel@isi.edu for the catch.

llvm-svn: 269585
2016-05-14 23:58:11 +00:00
Marshall Clow 1168ca925c Apply D20014 - fix a missing return in a test. Fixes PR#27720
llvm-svn: 269298
2016-05-12 14:31:35 +00:00
Eric Fiselier a5e201fd55 [libcxx] Prefer C++14 over C++11 when building libc++experimental.
Summary:
Currently libc++experimental builds with C++11. This patch changes that to C++14 when supported by the compiler. Although nothing currently requires C++14 the upcoming <experimental/memory_resource> implementation would benefit from it. [1]

Note that libc++.so continues to build with C++11 and is unaffected by this change.

[1] <experimental/memory_resource> provides global resources which must exist for the entire lifetime of the program. In order to ensure that a global resource can be used during program termination there destructors must never be invoked. The only way to do this, while also allowing "constant initialization", is to use a C++14 union.


Reviewers: mclow.lists

Subscribers: pete, cfe-commits

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

llvm-svn: 269070
2016-05-10 16:17:43 +00:00
Eric Fiselier 31dd2b1c88 Generate code coverage for experimental libraries
llvm-svn: 268887
2016-05-08 23:08:50 +00:00
Eric Fiselier b06c012243 Enable Pthread threading API on Solaris. Fix PR27677
llvm-svn: 268860
2016-05-07 17:05:46 +00:00
Eric Fiselier 2266a8d473 Fix memory_resource build for _LIBCPP_HAS_NO_THREADS
llvm-svn: 268850
2016-05-07 05:37:31 +00:00
Eric Fiselier 8dbe074baf Update TS implementation status page
llvm-svn: 268844
2016-05-07 03:24:31 +00:00
Eric Fiselier 4524d6e739 Change allocator<T>::allocate to throw length_error, not bad_alloc
llvm-svn: 268842
2016-05-07 03:12:24 +00:00
Eric Fiselier 522a7f9535 Add experimental container alias templates for PMRs
llvm-svn: 268841
2016-05-07 03:09:55 +00:00
Eric Fiselier 946c9b4920 Fix one more usage of _LIBCPP_HAS_NO_EXCEPTIONS
llvm-svn: 268839
2016-05-07 02:33:25 +00:00
Eric Fiselier 27acf7585d Fix typo it _LIBCPP_NO_EXCEPTIONS macro
llvm-svn: 268838
2016-05-07 02:30:21 +00:00
Eric Fiselier 15551efd43 Add <experimental/memory_resource>
Reviewers: mclow.lists, EricWF

Subscribers: cfe-commits

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

llvm-svn: 268829
2016-05-07 01:04:55 +00:00
Eric Fiselier 57175711eb Tweak --param=no_default_flags=true to still add -Ilibcxx/test/support
llvm-svn: 268801
2016-05-06 21:35:06 +00:00
Asiri Rathnayake c7e4239fab Refactor pthread usage of libcxx.
This patch extracts out all the pthread dependencies of libcxx into the
new header __threading_support. The motivation is to make it easy to
re-target libcxx into platforms that do not support pthread.

Original patch from Fulvio Esposito (fulvio.esposito@outlook.com) - D11781

Applied with tweaks - D19412

Change-Id: I301111f0075de93dd8129416e06babc195aa936b
llvm-svn: 268734
2016-05-06 14:06:29 +00:00
Eric Fiselier 7946c3f0e2 Fix errors in documentation
llvm-svn: 268709
2016-05-06 04:49:30 +00:00
Eric Fiselier 41fe4bacf5 Fix sphinx build. This is a temporary solution.
llvm-svn: 268614
2016-05-05 08:12:25 +00:00
Eric Fiselier d742bcc9f6 Try and fix sphinx build
llvm-svn: 268613
2016-05-05 06:30:05 +00:00
Eric Fiselier 4a9578aefe Removing some trailing whitespace
llvm-svn: 268543
2016-05-04 20:29:19 +00:00
Marshall Clow 96051a4efc Fixed some spelling errors in assert messages. No functional change. Thanks to giffunip@yahoo.com for the report.
llvm-svn: 268510
2016-05-04 15:35:50 +00:00
Eric Fiselier 43e3a64270 Update version numbers in docs
llvm-svn: 268459
2016-05-03 22:50:33 +00:00
Eric Fiselier 539cd6758b Add documentation for new experimental library
llvm-svn: 268456
2016-05-03 22:32:08 +00:00
Eric Fiselier ad89e3855c Make check-libcxx dependant on libc++experimental if present.
llvm-svn: 268451
2016-05-03 21:58:07 +00:00
Eric Fiselier 27cb2f1225 Create new library 'libc++experimental.a' for packaging TS symbols.
Summary:
Out-of-line symbols for <experimental/...> headers are not ABI or API stable and cannot live in the 'libc++.dylib'. Currently they have nowhere to live. I would like to add a new library target `libc++experimental.a` to fix this. 

Previously I had suggested different libraries for different TS's (`libc++filesystem.a`, 'libc++LFTS.a`, ect). I no longer think this is the right approach.
Instead `c++experimental` will hold *all* TS implementations as a single monolithic library. I see two main benefits to this:

1. Users only have to know about and manually link one library.
2. It makes it easy to implement TS's with one or two out-of-line symbols. (Ex. PMRs)

`c++experimental` provides NO ABI compatibility. Symbols can freely be added/removed/changed without concern for ABI stability.
I will add documentation for this after landing this patch (but before adding anything to it).

`c++experimental` only builds as a static library. By default CMake will build/test this library but will *NOT* install it.

This patch adds the CMake and LIT logic needed to build/test the new library. Once this lands I plan on using it to implement parts of `<experimental/memory_resource>`.



Reviewers: mclow.lists

Subscribers: cfe-commits, theraven, krememek, dexonsmith, bcraig, beanz, danalbert

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

llvm-svn: 268443
2016-05-03 21:30:18 +00:00
Chris Bieneman b05112452f [CMake] Fix a copy-paste error
Based on post commit feedback from Eric Fiselier.

llvm-svn: 268401
2016-05-03 16:54:20 +00:00
Eric Fiselier 59e9748cb5 Fix dependencies on install-libcxx CMake target
llvm-svn: 268363
2016-05-03 05:34:38 +00:00
Eric Fiselier 95b632d4b9 Fix PR27538. Remove __is_convertible specializations for array and function types.
This patch fixes a bunch of bugs in the fallback implementation of
is_convertible, which is used by GCC. Removing the "__is_convertible"
specializations for array/function types we fallback on the SFINAE test,
which is more correct.

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

llvm-svn: 268359
2016-05-03 04:26:02 +00:00
Eric Fiselier 15a297212f [libcxx] [test] Replace non-Standard "atomic_flag f(false);" with Standard "atomic_flag f;"
Summary:
Replace non-Standard "atomic_flag f(false);" with Standard "atomic_flag f;" in clear tests.
Although the  value of 'f' is unspecified it shouldn't matter because these tests always call `f.test_and_set()` without checking the result, so the initial state shouldn't matter.

The test init03.pass.cpp is explicitly testing this non-Standard extension; It has been moved into the `test/libcxx` directory.

Reviewers: mclow.lists, STL_MSFT

Subscribers: cfe-commits

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

llvm-svn: 268355
2016-05-03 02:12:26 +00:00
Eric Fiselier 43a10eb637 Don't use std::__clz in 'test/support/hexfloat.h'.
std::__clz is a libc++ specific function so it can't be used in the test suite.
This patch implements a dumb "count leading zeros" implementation within
hexfloat itself.

This patch also fixes UB since the output of `__builtin_clz(0)` is undefined
according to the GCC docs.

llvm-svn: 268354
2016-05-03 02:04:26 +00:00
Eric Fiselier 4df2666da1 Guard use of <unistd.h> in test.
llvm-svn: 268346
2016-05-03 00:36:57 +00:00
Eric Fiselier 76af416afc Cleanup warnings and remove use of __builtin_va_list in depr.c.headers
llvm-svn: 268294
2016-05-02 20:08:16 +00:00
Eric Fiselier c090b04045 Initialize local doubles to NaN. Patch from STL@microsoft.com
llvm-svn: 268285
2016-05-02 19:20:16 +00:00
Eric Fiselier fb42f4c44a Void cast runtime-unused variables. Patch from STL@microsoft.com
llvm-svn: 268284
2016-05-02 19:15:48 +00:00
Eric Fiselier 53ca3c93db Replace one more occurrence of non-standard std:launch::any. Patch from STL@microsoft.com
llvm-svn: 268153
2016-04-30 02:30:18 +00:00
Chris Bieneman 4497e3a1e6 [CMake] Create a separate install target for libcxx headers
This change doesn't impact the behavior of the install-libcxx target which installs whichever libcxx components you build, it just adds a separate target to just install the headers.

llvm-svn: 268124
2016-04-29 22:17:15 +00:00
Eric Fiselier 3ed9f6ebde Fix PR21428 for long. Buffer was one byte too small in octal formatting case. Rename previously added test
llvm-svn: 268009
2016-04-29 07:23:20 +00:00
Eric Fiselier cc06271d12 Move extern C include test into test/libcxx
llvm-svn: 267983
2016-04-29 04:19:48 +00:00
Eric Fiselier cbeadbdbad Fix test failures by adding missing include
llvm-svn: 267982
2016-04-29 04:18:13 +00:00
Eric Fiselier 382e91792b Fix or move various non-standard tests.
This patch does the following:

* Remove <__config> includes from some container tests.
* Guards uses of std::launch::any in async tests because it's an extension.
* Move "test/std/extensions" to "test/libcxx/extensions"
* Moves various non-standard tests including those in "sequences/vector",
  "std/localization" and "utilities/meta".

llvm-svn: 267981
2016-04-29 04:07:45 +00:00
Eric Fiselier bc32b5cf8f Move INVOKE tests into test/libcxx sub-tree.
Testing the concrete implementation of INVOKE means calling the implementation
specific names `__invoke` and `__invoke_constexpr`. For this reason the test
are non-standard. For this reason it's best if the tests live outside of the
`test/std` directory.

llvm-svn: 267973
2016-04-29 01:52:57 +00:00
Eric Fiselier 23323e25f8 Fix possible test breakage for MinGW
llvm-svn: 267968
2016-04-29 01:22:16 +00:00
Eric Fiselier 903f1ab93a Fix get_temp_file_name() to compile on Windows. Patch from STL@microsoft.com
llvm-svn: 267963
2016-04-29 00:51:24 +00:00
Eric Fiselier a643eb7ec0 Remove more names of unreferenced parameters. Patch from STL@microsoft.com
llvm-svn: 267962
2016-04-29 00:47:16 +00:00
Eric Fiselier 6abce62b4e Add a return value for nasty_mutex::operator&. Patch from STL@microsoft.com
llvm-svn: 267961
2016-04-29 00:45:46 +00:00
Eric Fiselier 6c5edd1263 Add <string> include for streaming operators. Patch from STL@microsoft.com
llvm-svn: 267959
2016-04-29 00:39:40 +00:00
Eric Fiselier 7d7d2c0edd Add proper include for unique_ptr. Patch from STL@microsoft.com
llvm-svn: 267958
2016-04-29 00:37:56 +00:00
Eric Fiselier 1f4231f8cf Guard libc++ specific c.__invariants() tests in LIBCPP_ASSERT macros
llvm-svn: 267947
2016-04-28 22:28:23 +00:00
Eric Fiselier 7626f778a5 Remove names of unreferenced parameters. Patch from STL@microsoft.com
llvm-svn: 267852
2016-04-28 03:17:56 +00:00