Commit Graph

2907 Commits

Author SHA1 Message Date
Louis Dionne
ee53ced93e [libcxx] Remove outdated XFAILs for aligned deallocation
AppleClang 10 has been fixed and so these tests don't fail anymore.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@350736 91177308-0d34-0410-b5e6-96231b3b80d8
2019-01-09 16:13:04 +00:00
Eric Fiselier
cd72c52980 Mark two more tests as FLAKY
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@350692 91177308-0d34-0410-b5e6-96231b3b80d8
2019-01-09 05:48:54 +00:00
Louis Dionne
ed1d77ad35 [Sema] Teach Clang that aligned allocation is not supported with macosx10.13
Summary:
r306722 added diagnostics when aligned allocation is used with deployment
targets that do not support it, but the first macosx supporting aligned
allocation was incorrectly set to 10.13. In reality, the dylib shipped
with macosx10.13 does not support aligned allocation, but the dylib
shipped with macosx10.14 does.

Reviewers: ahatanak

Subscribers: christof, jkorous, dexonsmith, cfe-commits

Differential Revision: https://reviews.llvm.org/D56445

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@350649 91177308-0d34-0410-b5e6-96231b3b80d8
2019-01-08 20:26:56 +00:00
Marshall Clow
11a8815e5a Set the buffer of an fstream to empty when the underlying file is closed. This 'fixes' PR#38052 - std::fstream still good after closing and updating content.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@350603 91177308-0d34-0410-b5e6-96231b3b80d8
2019-01-08 02:48:45 +00:00
Volodymyr Sapsai
354589c472 [libcxx] Optimize vectors construction of trivial types from an iterator range with const-ness mismatch.
We already have a specialization that will use memcpy for construction
of trivial types from an iterator range like

    std::vector<int>(int *, int *);

But if we have const-ness mismatch like

    std::vector<int>(const int *, const int *);

we would use a slow path that copies each element individually. This change
enables the optimal specialization for const-ness mismatch. Fixes PR37574.

Contributions to the patch are made by Arthur O'Dwyer, Louis Dionne.

rdar://problem/40485845

Reviewers: mclow.lists, EricWF, ldionne, scanon

Reviewed By: ldionne

Subscribers: christof, ldionne, howard.hinnant, cfe-commits

Differential Revision: https://reviews.llvm.org/D48342



git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@350583 91177308-0d34-0410-b5e6-96231b3b80d8
2019-01-08 00:03:16 +00:00
Eric Fiselier
4626eac620 Mark more tests as flaky
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@350550 91177308-0d34-0410-b5e6-96231b3b80d8
2019-01-07 18:21:18 +00:00
Marshall Clow
a9c67b27fa Add the feature test macros that were defined in p1353r0 to the headers of the appropriate tests. No actual tests yet, so NFC.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@350535 91177308-0d34-0410-b5e6-96231b3b80d8
2019-01-07 16:17:52 +00:00
Eric Fiselier
6420803549 Fix PR39749 - Headers containing just #error harm __has_include.
This patch changes <experimental/foo> to use #warning instead of
is harmful to common feature detection idioms.

We should also consider only emitting the warning when __DEPRECATED is
defined, like we do in the <ext/foo> headers. Users may want to specify
"-Werror=-W#warnings" while still ignoring the libc++ warnings.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@350485 91177308-0d34-0410-b5e6-96231b3b80d8
2019-01-06 00:37:31 +00:00
Eric Fiselier
936dd3d1ff Fix flaky symlink access time test.
last_write_time(sym, new_time) changes the modification time of the file
referenced by the symlink. But reading through the symlink may change the
symlinks's access time.

This meant the previous test that checked that the symlinks access
time was unchanged was incorrect and made the test flaky.

This patch removes this test (there really is no non-flaky way
to test that the new access time coorisponds to the time at which
the symlink was last dereferenced). This should unflake the test.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@350478 91177308-0d34-0410-b5e6-96231b3b80d8
2019-01-05 21:18:10 +00:00
Marshall Clow
7de83dce41 De-tab a couple tests. NFC
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@350330 91177308-0d34-0410-b5e6-96231b3b80d8
2019-01-03 17:18:40 +00:00
Eric Fiselier
5f14fb5f34 Fix test case breakages caused by lexically_relative change
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@349888 91177308-0d34-0410-b5e6-96231b3b80d8
2018-12-21 04:38:22 +00:00
Eric Fiselier
fdb4802a74 Fix copy paste error in file_clock tests
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@349886 91177308-0d34-0410-b5e6-96231b3b80d8
2018-12-21 04:27:45 +00:00
Eric Fiselier
da05bdc85c Implement LWG 3096: path::lexically_relative is confused by trailing slashes
path("/dir/").lexically_relative("/dir"); now returns "." instead of ""

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@349885 91177308-0d34-0410-b5e6-96231b3b80d8
2018-12-21 04:25:40 +00:00
Eric Fiselier
3cf34d1caf Implement LWG 3065: Make path operators friends.
This prevents things like:

using namespace std::filesystem;
auto x = L"a/b" == std::string("a/b");

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@349884 91177308-0d34-0410-b5e6-96231b3b80d8
2018-12-21 04:09:01 +00:00
Eric Fiselier
874280d14d Implement LWG 3145: file_clock breaks ABI for C++17 implementations.
This patch adds std::chrono::file_clock, but without breaking the
existing ABI for std::filesystem.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@349883 91177308-0d34-0410-b5e6-96231b3b80d8
2018-12-21 03:54:57 +00:00
Eric Fiselier
a2037284d4 Implement LWG 2936: Path comparison is defined in terms of the generic format
This patch implements path::compare according to the current spec. The
only observable change is the ordering of "/foo" and "foo", which orders
the two paths based on having or not having a root directory (instead
of lexically comparing "/" to "foo").

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@349881 91177308-0d34-0410-b5e6-96231b3b80d8
2018-12-21 03:16:30 +00:00
Louis Dionne
8daffdabc5 [libcxx] Fix order checking in unordered_multimap tests.
Some tests assume that iteration through an unordered multimap elements
will return them in the same order as at the container creation. This
assumption is not true since the container is unordered, so that no
specific order of elements is ever guaranteed for such container. This
patch introduces checks verifying that any iteration will return elements
exactly from a set of valid values and without repetition, but in no
particular order.

Reviewed as https://reviews.llvm.org/D54838.
Thanks to Andrey Maksimov for the patch.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@349780 91177308-0d34-0410-b5e6-96231b3b80d8
2018-12-20 17:55:31 +00:00
Volodymyr Sapsai
d805c8746a [libcxx] Use custom allocator's construct in C++03 when available.
Makes libc++ behavior consistent between C++03 and C++11.

Can use `decltype` in C++03 because `include/__config` defines a macro when
`decltype` is not available.

Reviewers: mclow.lists, EricWF, erik.pilkington, ldionne

Reviewed By: ldionne

Subscribers: dexonsmith, cfe-commits, howard.hinnant, ldionne, christof, jkorous, Quuxplusone

Differential Revision: https://reviews.llvm.org/D48753


git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@349676 91177308-0d34-0410-b5e6-96231b3b80d8
2018-12-19 20:08:43 +00:00
Eric Fiselier
1e048a3c69 Work around GCC 9.0 regression
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@349663 91177308-0d34-0410-b5e6-96231b3b80d8
2018-12-19 18:58:22 +00:00
Marshall Clow
ff04a5678c Add missing include to test. NFC
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@349639 91177308-0d34-0410-b5e6-96231b3b80d8
2018-12-19 16:39:04 +00:00
Marshall Clow
9ff404deec Portability fix: add missing includes and static_casts. Reviewed as https://reviews.llvm.org/D55777. Thanks to Andrey Maksimov for the patch.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@349566 91177308-0d34-0410-b5e6-96231b3b80d8
2018-12-18 23:19:00 +00:00
Marshall Clow
3af9c5fa77 Rework the C strings tests to use ASSERT_SAME_TYPE. NFC there. Also change cwchar.pass.cpp to avoid constructing a couple things from zero - since apparently they can be enums in some weird C library. NFC there, either, since the values were never used.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@349522 91177308-0d34-0410-b5e6-96231b3b80d8
2018-12-18 19:07:30 +00:00
Louis Dionne
6ad953652d [libcxx] Remove XFAILs for older macOS versions
That test doesn't fail anymore since r349378, since the assertions that
r349378 removed must have been bugs in the dylib at some point.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@349484 91177308-0d34-0410-b5e6-96231b3b80d8
2018-12-18 13:46:28 +00:00
Louis Dionne
b8811ad2ca [libcxx] Handle AppleClang 9 and 10 in XFAILs for aligned allocation tests
I forgot that those don't behave like Clang trunk, again.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@349427 91177308-0d34-0410-b5e6-96231b3b80d8
2018-12-18 00:42:09 +00:00
Louis Dionne
3d4bcc1de6 [libcxx] Properly mark aligned allocation macro test as XFAIL on OS X
This test was initially marked as XFAIL using `XFAIL: macosx10.YY`, and
was then moved to `UNSUPPORTED: macosx10.YY`. The intent is to mark the
test as XFAILing when a deployment target older than macosx10.14 is used,
and the right way to do this is `XFAIL: availability=macosx10.YY`.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@349426 91177308-0d34-0410-b5e6-96231b3b80d8
2018-12-18 00:30:15 +00:00
Eric Fiselier
dfa283e2cf Fix FP comparisons when SSE isn't available
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@349387 91177308-0d34-0410-b5e6-96231b3b80d8
2018-12-17 20:17:43 +00:00
Michal Gorny
4b8645f0dc [test] Add target_info for NetBSD, and XFAIL some of locale tests
Add a target_info definition for NetBSD.  The definition is based
on the one used by FreeBSD, with libcxxrt replaced by libc++abi,
and using llvm-libunwind since we need to use its unwinder
implementation to build anyway.

Additionally, XFAIL the 30 tests that fail because of non-implemented
locale features.  According to the manual, NetBSD implements only
LC_CTYPE part of locale handling.  However, there is a locale database
in the system and locale specifications are validated against it,
so it makes sense to list the common locales as supported.

If I'm counting correctly, this change enables additional 43 passing
tests.

Differential Revision: https://reviews.llvm.org/D55767

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@349379 91177308-0d34-0410-b5e6-96231b3b80d8
2018-12-17 19:14:08 +00:00
Michal Gorny
c88aa7fa75 [test] [re.traits] Remove asserts failing due to invalid UTF-8
Remove the two test cases for \xDA and \xFA with UTF-8 locale, as both
characters alone are invalid in UTF-8 (short sequences).  Upon removing
them, the test passes on Linux again (and also on NetBSD, after adding
appropriate locale configuration).

Differential Revision: https://reviews.llvm.org/D55746

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@349378 91177308-0d34-0410-b5e6-96231b3b80d8
2018-12-17 19:13:41 +00:00
Eric Fiselier
50f14e23b5 Unbreak green dragon bots w/o __builtin_launder
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@349373 91177308-0d34-0410-b5e6-96231b3b80d8
2018-12-17 18:37:59 +00:00
Eric Fiselier
2d0643acea Expect Clang diagnostics in std::launder test
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@349364 91177308-0d34-0410-b5e6-96231b3b80d8
2018-12-17 16:56:24 +00:00
Louis Dionne
8f7fa38fb9 [libcxx] Speeding up partition_point/lower_bound/upper_bound
This is a re-application of r345525, which had been reverted by fear of
a regression.

Reviewed as https://reviews.llvm.org/D53994.
Thanks to Denis Yaroshevskiy for the patch.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@349358 91177308-0d34-0410-b5e6-96231b3b80d8
2018-12-17 16:04:39 +00:00
Michal Gorny
a443a0013d [test] [support] Use socket()+bind() to create unix sockets portably
Replace the mknod() call with socket() + bind() for creating unix
sockets.  The mknod() method is not portable and does not work
on NetBSD while binding the socket should work on all systems supporting
unix sockets.

Differential Revision: https://reviews.llvm.org/D55576

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@349305 91177308-0d34-0410-b5e6-96231b3b80d8
2018-12-16 15:12:06 +00:00
Michal Gorny
36feb1b037 [test] [ctime] Ignore -Wformat-zero-length warnings
Explicitly disable the -Wformat-zero-length diagnostic when running
ctime tests, since one of the test cases passes zero-length format
string to strftime().  When strftime() is appropriately decorated
with __attribute__(format, ...), this caused the test to fail because
of this warning (e.g. on NetBSD).

Differential Revision: https://reviews.llvm.org/D55661

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@349294 91177308-0d34-0410-b5e6-96231b3b80d8
2018-12-16 09:18:31 +00:00
Eric Fiselier
8c36703b2b Fix static assert diagnostic checks in i386
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@349252 91177308-0d34-0410-b5e6-96231b3b80d8
2018-12-15 05:18:56 +00:00
Eric Fiselier
01fac08922 Tolerate Clangs new static_assert messages
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@349189 91177308-0d34-0410-b5e6-96231b3b80d8
2018-12-14 20:42:36 +00:00
Louis Dionne
03017b2675 [libcxx] Mark some tests as still failing on macosx10.14
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@349187 91177308-0d34-0410-b5e6-96231b3b80d8
2018-12-14 20:22:44 +00:00
Marshall Clow
f927635d87 Implement P1209 - Adopt Consistent Container Erasure from Library Fundamentals 2 for C++20. Reviewed as https://reviews.llvm.org/D55532
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@349178 91177308-0d34-0410-b5e6-96231b3b80d8
2018-12-14 18:49:35 +00:00
Louis Dionne
d3f2d5ec4e [libcxx] Fix pop_back() tests to make sure they don't always just pass
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@349071 91177308-0d34-0410-b5e6-96231b3b80d8
2018-12-13 18:53:17 +00:00
Louis Dionne
f77ee9b3c9 [libcxx] Add assertion in deque::pop_back when popping from an empty deque
Also, add tests making sure that vector and deque both catch the problem
when assertions are enabled. Otherwise, deque would segfault and vector
would never terminate.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@348994 91177308-0d34-0410-b5e6-96231b3b80d8
2018-12-12 23:58:25 +00:00
Michal Gorny
f0c3a12346 [test] [depr.c.headers] XFAIL uchar.h on NetBSD
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@348973 91177308-0d34-0410-b5e6-96231b3b80d8
2018-12-12 20:51:46 +00:00
Michal Gorny
13d947cc06 [test] [filesystems] NetBSD can do symlink permissions too
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@348968 91177308-0d34-0410-b5e6-96231b3b80d8
2018-12-12 20:28:52 +00:00
Michal Gorny
413329eb35 [test] [filesystems] Extend FreeBSD tv_sec==-1 workaround to NetBSD
NetBSD also uses tv_sec==-1 as error status indicator, and does not
support setting such a value.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@348967 91177308-0d34-0410-b5e6-96231b3b80d8
2018-12-12 20:20:15 +00:00
Michal Gorny
2d1346288e [test] Permit NetBSD in filesystem_dynamic_test_helper.py
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@348872 91177308-0d34-0410-b5e6-96231b3b80d8
2018-12-11 18:29:35 +00:00
Louis Dionne
649e69dd22 [libcxx] Fix test failure on GCC 4.9
GCC 4.9 seems to think that a constexpr default constructor implies
the constructor to be noexcept.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@348850 91177308-0d34-0410-b5e6-96231b3b80d8
2018-12-11 15:27:10 +00:00
Louis Dionne
bca4d67c16 [pair] Mark constructors as conditionally noexcept
Summary:
std::tuple marks its constructors as noexcept when the corresponding
memberwise constructors are noexcept too -- this commit improves std::pair
so that it behaves the same.

This is a re-application of r348824, which broke the build in C++03 mode
because a test was marked as supported in C++03 when it shouldn't be.

Note:
I did not add support in the explicit and non-explicit `pair(_Tuple&& __p)`
constructors because those are non-standard extensions, and supporting them
properly is tedious (we have to copy the rvalue-referenceness of the deduced
_Tuple&& onto the result of tuple_element).

<rdar://problem/29537079>

Reviewers: mclow.lists, EricWF

Subscribers: christof, llvm-commits

Differential Revision: https://reviews.llvm.org/D48669

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@348847 91177308-0d34-0410-b5e6-96231b3b80d8
2018-12-11 14:22:28 +00:00
Louis Dionne
31355b0538 [libcxx] Fix test on compilers that do not support char8_t yet
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@348846 91177308-0d34-0410-b5e6-96231b3b80d8
2018-12-11 14:15:54 +00:00
Marshall Clow
544d1ba9a3 Fix problems with char8_t stuff on compilers that don't support char8_t yet
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@348829 91177308-0d34-0410-b5e6-96231b3b80d8
2018-12-11 06:06:49 +00:00
Marshall Clow
96484477d1 Second part of P0482 - char8_t. Reviewed as https://reviews.llvm.org/D55308
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@348828 91177308-0d34-0410-b5e6-96231b3b80d8
2018-12-11 04:35:44 +00:00
Louis Dionne
21a8669ade Revert "[pair] Mark constructors as conditionally noexcept"
This broke the tests on Linux. Reverting until I find out why the tests
are broken (tomorrow).

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@348825 91177308-0d34-0410-b5e6-96231b3b80d8
2018-12-11 02:32:46 +00:00
Louis Dionne
adde8aeb1c [pair] Mark constructors as conditionally noexcept
Summary:
std::tuple marks its constructors as noexcept when the corresponding
memberwise constructors are noexcept too -- this commit improves std::pair
so that it behaves the same.

Note:
I did not add support in the explicit and non-explicit `pair(_Tuple&& __p)`
constructors because those are non-standard extensions, and supporting them
properly is tedious (we have to copy the rvalue-referenceness of the deduced
_Tuple&& onto the result of tuple_element).

<rdar://problem/29537079>

Reviewers: mclow.lists, EricWF

Subscribers: christof, llvm-commits

Differential Revision: https://reviews.llvm.org/D48669

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@348824 91177308-0d34-0410-b5e6-96231b3b80d8
2018-12-11 02:17:23 +00:00