Commit Graph

2743 Commits

Author SHA1 Message Date
Eric Fiselier
67ec8a281b Move more _LIBCPP_VERSION tests to test/libcxx.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@273365 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-22 02:07:26 +00:00
Eric Fiselier
b065399890 Move all tests for _LIBCPP_VERSION in language.support to test/libcxx/language.support.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@273364 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-22 01:55:59 +00:00
Eric Fiselier
b93bc9a9ed Move typoed dir meta.hel to meta.help
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@273362 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-22 01:42:39 +00:00
Eric Fiselier
3c0e3eb9d2 Use static_assert instead of runtime assert in std::money_base tests.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@273360 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-22 01:40:46 +00:00
Eric Fiselier
63a0af7a79 Remove locale tests that depend on LC_ALL. These are non-portable.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@273359 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-22 01:33:38 +00:00
Eric Fiselier
03dacbe87a Fix comment typos, strip trailing whitespace. Patch from STL@microsoft.com
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@273357 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-22 01:23:51 +00:00
Eric Fiselier
14fe08bcb7 Avoid huge main() functions and huge arrays. Patch from STL@microsoft.com
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@273354 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-22 01:13:44 +00:00
Eric Fiselier
a431a3abc5 Don't use C++17 terse static assert. Patch from STL@microsoft.com
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@273353 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-22 01:10:14 +00:00
Eric Fiselier
dc45b08815 Fix operator precedence mistake in valarray/not.pass.cpp. Patch from STL@microsoft.com
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@273352 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-22 01:04:09 +00:00
Eric Fiselier
ff58059a86 Suppress stupid and incorrect MSVC warning. patch from STL@microsoft.com
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@273350 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-22 01:02:08 +00:00
Eric Fiselier
c6fcb58914 Avoid assignment in return. Patch from STL@microsoft.com
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@273349 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-22 01:00:32 +00:00
Eric Fiselier
91a5c559ba Suppress unused warnings in std::invoke tests.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@273348 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-22 00:58:06 +00:00
Eric Fiselier
62957fb722 Guard libc++ assumption about identity hashing in test. Patch from STL@microsoft.com
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@273345 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-22 00:53:35 +00:00
Eric Fiselier
571d549ddd Guard use of non-standard macros in denorm_min() tests.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@273344 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-22 00:50:09 +00:00
Eric Fiselier
868af68aeb Allow placement new array test to consume extra bytes as specified by the standard.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@273342 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-22 00:32:28 +00:00
Eric Fiselier
c382dd0cd1 Move native_handle thread tests to test/libcxx
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@273341 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-22 00:21:50 +00:00
Eric Fiselier
fa5a105971 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


git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@273334 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-21 23:19:13 +00:00
Eric Fiselier
7c96ddb563 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.


git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@273328 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-21 22:42:42 +00:00
Eric Fiselier
756a6bd177 Implement LWG issue 2725. The issue should move this meeting
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@273325 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-21 22:11:16 +00:00
Eric Fiselier
374a33d1b9 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.



git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@273323 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-21 21:54:23 +00:00
Jonathan Coe
1d4f1c1494 Add entry to CREDITS.TXT for propagate_const
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@273123 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-19 19:36:28 +00:00
Jonathan Coe
ee49613ff4 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


git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@273122 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-19 19:34:13 +00:00
Marshall Clow
5270a84ef2 Test commit; remove some spaces at EOL. No functional change.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@273121 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-19 19:29:52 +00:00
Eric Fiselier
897b2f9a70 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.


git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@273107 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-19 07:08:27 +00:00
Eric Fiselier
fe6d50fcaa 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).


git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@273106 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-19 06:58:22 +00:00
Eric Fiselier
57254f448f 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.


git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@273104 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-19 02:25:22 +00:00
Eric Fiselier
70f7afec38 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.



git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@273103 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-19 02:04:49 +00:00
Eric Fiselier
2730c251ae 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.


git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@273093 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-18 19:11:40 +00:00
Eric Fiselier
d9bca8ab7d 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.


git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@273092 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-18 18:55:18 +00:00
Eric Fiselier
29c26b91df 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.


git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@273091 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-18 18:32:26 +00:00
Eric Fiselier
87a1065747 Use monotonic clock in synthetic SleepFor test helper
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@273089 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-18 17:51:11 +00:00
Eric Fiselier
7840a8ca84 Use utimes instead of utimensat when !defined(UTIME_OMIT). Fixes build for older GLIBC versions
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@273088 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-18 17:37:04 +00:00
Eric Fiselier
880e38b206 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.


git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@273078 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-18 04:10:23 +00:00
Eric Fiselier
ba9dccd902 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

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@273076 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-18 02:12:53 +00:00
Eric Fiselier
591e18f6aa 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.


git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@273075 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-18 02:11:48 +00:00
Eric Fiselier
63a5b248d7 Add checkpoints to string allocation test to help with debugging arm failures.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@273072 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-18 00:23:13 +00:00
Eric Fiselier
f1bc722d8c 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.


git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@273070 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-17 23:57:16 +00:00
Eric Fiselier
a730ec37a9 Work around GCC bug in tests. The bug has been fixed in GCC 6.0
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@273068 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-17 23:30:40 +00:00
Eric Fiselier
5c8a3688be Fix initialization of test case array in C++11
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@273065 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-17 22:36:47 +00:00
Eric Fiselier
6f3b01af9c 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.


git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@273060 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-17 22:22:37 +00:00
Eric Fiselier
40d9e09d89 Get filesystem tests passing for single-threaded configurations.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@273054 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-17 21:44:26 +00:00
Eric Fiselier
841798ce01 Update status of filesystem issues, and add tests for LWG issue 2683
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@273051 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-17 21:24:11 +00:00
Eric Fiselier
0c75540ba2 Reorder permissions test so they are not dependent on the processes umask
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@273049 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-17 21:00:27 +00:00
Eric Fiselier
0354eb7228 Respect the processes umask in the create_directory test
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@273048 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-17 20:54:25 +00:00
Eric Fiselier
e3f386aae3 Add missing space between >> in template declaration. Fixes C++03 build.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@273037 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-17 20:16:46 +00:00
Eric Fiselier
05761e6861 Fix a couple of warnings present in the filesystem tests.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@273035 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-17 19:57:54 +00:00
Eric Fiselier
6e9a694dce 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'.


git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@273034 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-17 19:46:40 +00:00
Ed Schouten
a8f47cc800 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).


git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@272886 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-16 11:53:11 +00:00
Dan Albert
b2ce77fc21 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

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@272827 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-15 20:20:32 +00:00
Eric Fiselier
461797d21a Fix warning in tuple tests. The test suite should now run clean with most warnings enabled
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@272822 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-15 19:41:52 +00:00