Commit Graph

4861 Commits

Author SHA1 Message Date
Eric Fiselier
03856f1e0a [test] Fix Container::insert(value_type const&) tests
Patch from Joe Loser.

Several unit tests meaning to test the behavior of lvalue insertion incorrectly
pass rvalues. Fixes bug PR # 27394

Reviewed as https://reviews.llvm.org/D44411


git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@329541 91177308-0d34-0410-b5e6-96231b3b80d8
2018-04-08 21:57:35 +00:00
Roman Lebedev
862878bc38 [libcxx][test] Silence -Wself-assign diagnostics
Summary:
D44883 extends -Wself-assign to also work on C++ classes.
These new warnings pop up in the test suite, so they have to be silenced.

Please refer to the D45082 for disscussion on whether this is the right way to solve this.

Testing: `ninja check-libcxx check-libcxxabi` in stage-2 build.

Reviewers: mclow.lists, EricWF

Reviewed By: EricWF

Subscribers: Quuxplusone, cfe-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@329490 91177308-0d34-0410-b5e6-96231b3b80d8
2018-04-07 10:36:03 +00:00
Eric Fiselier
f466f69333 Use void() to create a void expression type
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@329484 91177308-0d34-0410-b5e6-96231b3b80d8
2018-04-07 04:28:11 +00:00
Eric Fiselier
b6a95e7ae7 Work around missing braces in init warning
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@329474 91177308-0d34-0410-b5e6-96231b3b80d8
2018-04-07 01:28:54 +00:00
Eric Fiselier
24258c4417 Implement P0768r1: Library support for the Spaceship Operator.
this patch adds the <compare> header and implements all of it
except for [comp.alg].

As I understand it, the header is needed by the compiler in
when implementing the semantics of operator<=>. For that reason
I feel it's important to land this header early, despite
all compilers lacking support.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@329460 91177308-0d34-0410-b5e6-96231b3b80d8
2018-04-06 21:37:23 +00:00
Marshall Clow
ece1de8658 Mark <span> as "In progress"
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@329375 91177308-0d34-0410-b5e6-96231b3b80d8
2018-04-06 04:43:27 +00:00
Gor Nishanov
b431c5a9ec [coroutines] libcxx, noop_coroutine, make bots even more happy
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@329245 91177308-0d34-0410-b5e6-96231b3b80d8
2018-04-05 00:18:37 +00:00
Gor Nishanov
ab465be926 [coroutines] libcxx noop_coroutine. Make bots happier
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@329240 91177308-0d34-0410-b5e6-96231b3b80d8
2018-04-04 23:43:50 +00:00
Gor Nishanov
827c4ff600 [coroutines] Allow compilation under c++03
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@329239 91177308-0d34-0410-b5e6-96231b3b80d8
2018-04-04 22:51:57 +00:00
Gor Nishanov
81e07a9315 [coroutines] Add noop_coroutine to <experimental/coroutine>
A recent addition to Coroutines TS (https://wg21.link/p0913) adds a pre-defined
coroutine noop_coroutine that does nothing.

This patch implements require library types in <experimental/coroutine>

Related clang and llvm patches:

https://reviews.llvm.org/D45114
https://reviews.llvm.org/D45120

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@329237 91177308-0d34-0410-b5e6-96231b3b80d8
2018-04-04 22:18:03 +00:00
Jan Korous
75b7f52ace [libcxx][test] Fix fs::proximate tests on platforms where /net exists.
Following Eric's patch.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@329199 91177308-0d34-0410-b5e6-96231b3b80d8
2018-04-04 14:23:51 +00:00
Jan Korous
dd8722ce53 [libcxx][test] Improve assert message
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@329194 91177308-0d34-0410-b5e6-96231b3b80d8
2018-04-04 13:31:39 +00:00
Simon Dardis
c5121b933d [libcxx][cmake] Remove libatomic temporarily from CMAKE_REQUIRED_LIBRARIES when configuring
When libcxx is built in tree for a host which requires libatomic, LLVM's
configuration steps will determine it is required and add it to
CMAKE_REQUIRED_LIBRARIES. When libcxx is later configured, it tests if it
has C++ atomics without libatomic. The test erroneously passes as libatomic
is already part of the set of required libraries.

In turn, a number of the atomic tests will fail as they require libatomic
but the test suite is configured not to use libatomic.

Address this by always dropping libatomic from the set of required libraries
before determining if LIBCXX_HAVE_CXX_ATOMICS_WITHOUT_LIB is true,
then restoring the set of required libraries.

Reviewers: EricWF

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


git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@329167 91177308-0d34-0410-b5e6-96231b3b80d8
2018-04-04 11:05:03 +00:00
Eric Fiselier
cac4ec3986 Fix undefined macro issue in locale tests; Try 2
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@329149 91177308-0d34-0410-b5e6-96231b3b80d8
2018-04-04 04:48:26 +00:00
Eric Fiselier
70f2b2c7da Fix undefined macro issue in locale tests
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@329148 91177308-0d34-0410-b5e6-96231b3b80d8
2018-04-04 04:39:38 +00:00
Eric Fiselier
cdcfa903a9 Update Clang version on Appveyor bots
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@329145 91177308-0d34-0410-b5e6-96231b3b80d8
2018-04-04 04:33:09 +00:00
Eric Fiselier
576717d499 Touch up tests for new <version> header; fix module.modulemap.
This patch does some housekeeping for the new <version> header.
It adds it to the module.modulemap, and the double_include.sh.cpp test.

Additionally it corrects the // UNSUPPORTED options for the libc++
specific test. The header needs to compile under C++03 to support
modules, and it should compile under all available compilers.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@329144 91177308-0d34-0410-b5e6-96231b3b80d8
2018-04-04 04:21:54 +00:00
Eric Fiselier
b21b3175b8 Fix locale test data for GLIBC 2.27 and newer.
GLIBC 2.27 changed the locale data for fr_FR and ru_RU. In particular
they change the decimal and thousands separators used. This patch
makes the locale tests tolerate the updated locales.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@329143 91177308-0d34-0410-b5e6-96231b3b80d8
2018-04-04 04:00:14 +00:00
Marshall Clow
0b261846c9 Implement P0754R2: The <version> header.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@329075 91177308-0d34-0410-b5e6-96231b3b80d8
2018-04-03 15:48:24 +00:00
Eric Fiselier
efbbeb195f Fix fs::proximate tests on platforms where /net exists.
The proximate tests depended on `/net` not being a valid path,
however, on OS X it is.

Correct the tests to handle this.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@329038 91177308-0d34-0410-b5e6-96231b3b80d8
2018-04-03 01:52:12 +00:00
Eric Fiselier
e96d6a1fb7 Implement P0430R2 - File system library on non-POSIX systems.
This patch implements P0430R2, who's largest change is adding the path::format
enumeration for supporting path format conversions in path constructors.

However, since libc++'s filesystem only really supports POSIX like systems,
there are no real changes needed. This patch simply adds the format enum
and then ignores it when it's passed to constructors.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@329031 91177308-0d34-0410-b5e6-96231b3b80d8
2018-04-02 23:35:24 +00:00
Eric Fiselier
1e34c76d33 Implement filesystem NB comments, relative paths, and related issues.
This is a fairly large patch that implements all of the filesystem NB comments
and the relative paths changes (ex. adding weakly_canonical). These issues
and papers are all interrelated so their implementation couldn't be split up
nicely.

This patch upgrades <experimental/filesystem> to match the C++17 spec and not
the published experimental TS spec. Some of the changes in this patch are both
API and ABI breaking, however libc++ makes no guarantee about stability for
experimental implementations.

The major changes in this patch are:

* Implement NB comments for filesystem (P0492R2), including:
  * Implement `perm_options` enum as part of NB comments, and update the
    `permissions` function to match.
  * Implement changes to `remove_filename` and `replace_filename`
  * Implement changes to `path::stem()` and `path::extension()` which support
    splitting examples like `.profile`.
  * Change path iteration to return an empty path instead of '.' for trailing
    separators.
  * Change `operator/=` to handle absolute paths on the RHS.
  * Change `absolute` to no longer accept a current path argument.

* Implement relative paths according to NB comments (P0219r1)

* Combine `path.cpp` and `operations.cpp` since some path functions require
  access to the operations internals, and some fs operations require access
  to the path parser.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@329028 91177308-0d34-0410-b5e6-96231b3b80d8
2018-04-02 23:03:41 +00:00
Volodymyr Sapsai
ead2a54952 [libcxx] Disable testing with system lib for 2 tests verifying debug mode.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@329023 91177308-0d34-0410-b5e6-96231b3b80d8
2018-04-02 22:09:57 +00:00
Eric Fiselier
4e177b91d0 fix typo in align_const_pair_U_V.pass.cpp
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@328760 91177308-0d34-0410-b5e6-96231b3b80d8
2018-03-29 03:44:01 +00:00
Eric Fiselier
3e005cc583 Move libc++ pair/tuple assign test to libcxx/ test directory.
Libc++ implements the pair& operator=(pair<U, V>) assignment operator
using a single template that handles assignment from all tuple-like types.

This patch moves the test for that to the libcxx test directory since
it's non-standard. It also adds additional tests to the std/.../pair
directory to test the standard behavior this template implements.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@328758 91177308-0d34-0410-b5e6-96231b3b80d8
2018-03-29 03:30:00 +00:00
Eric Fiselier
f382e53015 Fix PR36914 - num_get::get(unsigned) incorrectly handles negative numbers.
This patch corrects num_get for unsigned types to support strings
with a leading `-` character. According to the standard the
number should be parsed as an unsigned integer and then
negated.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@328751 91177308-0d34-0410-b5e6-96231b3b80d8
2018-03-29 01:18:53 +00:00
Eric Fiselier
245b3a06a1 Fix test case initialization issues in permissions test
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@328477 91177308-0d34-0410-b5e6-96231b3b80d8
2018-03-26 07:06:25 +00:00
Eric Fiselier
f2c93738b8 Implement filesystem::perm_options specified in NB comments.
The NB comments for filesystem changed permissions and added
a new enum `perm_options` which control how the permissions
are applied.

This implements than NB resolution

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@328476 91177308-0d34-0410-b5e6-96231b3b80d8
2018-03-26 06:23:55 +00:00
Eric Fiselier
f1471a367b Make filesystem tests generic between experimental and std versions.
As I move towards implementing std::filesystem, there is a need to
make the existing tests run against both the std and experimental versions.
Additionally, it's helpful to allow running the tests against other
implementations of filesystem.

This patch converts the test to easily target either. First, it
adds a filesystem_include.hpp header which is soley responsible
for selecting and including the correct implementation. Second,
it converts existing tests to use this header instead of including
filesystem directly.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@328475 91177308-0d34-0410-b5e6-96231b3b80d8
2018-03-26 05:46:57 +00:00
Eric Fiselier
85e9de93e2 avoid new/delete ellision in construct.pass.cpp
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@328445 91177308-0d34-0410-b5e6-96231b3b80d8
2018-03-25 03:00:42 +00:00
Eric Fiselier
5a424a9856 Partially Revert "Workaround GCC bug PR78489 - SFINAE order is not respected."
This partially reverts commit r328261. The GCC bug has been fixed in
trunk and has never existed in a released version. Therefore the changes
to variant are unneeded.

However, the additional tests have been left in place.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@328388 91177308-0d34-0410-b5e6-96231b3b80d8
2018-03-23 23:42:30 +00:00
Eric Fiselier
078131e6d2 Add temporary printouts to test to help debug failures.
Some debian libc++ bots started having failures in the locale
tests due to what I assume is a change in the locale data for fr_FR
in glibc.

This change prints the actual value from the test to help debugging.
It should be reverted once the bots cycle.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@328268 91177308-0d34-0410-b5e6-96231b3b80d8
2018-03-22 23:14:20 +00:00
Eric Fiselier
73e00f8321 Avoid Clang error about throwing _LIBCPP_ASSERT in noexcept function.
This fixes a couple of tests which produced a warning that a 'throw'
occurred in a noexcept function (by way of _LIBCPP_ASSERT). It does
so by hiding the 'throw' across an opaque function boundary.

This fix isn't ideal, since we still have _LIBCPP_ASSERT's in functions
marked noexcept -- and this problem should be addressed in the future.
However, throwing _LIBCPP_ASSERT is really only meant to allow testing
of the assertions, and is not yet ready for general use.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@328265 91177308-0d34-0410-b5e6-96231b3b80d8
2018-03-22 23:01:08 +00:00
Stephan T. Lavavej
111f042e6c [libcxx] [test] Strip trailing whitespace. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@328264 91177308-0d34-0410-b5e6-96231b3b80d8
2018-03-22 22:59:02 +00:00
Eric Fiselier
493b609b27 Workaround GCC bug PR78489 - SFINAE order is not respected.
This patch works around variant test failures which are new to
GCC 8. GCC 8 either doesn't perform SFINAE in lexical order, or
it doesn't halt after encountering the first failure. This
causes hard error to occur instead of substitution failure.

See gcc.gnu.org/PR78489

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@328261 91177308-0d34-0410-b5e6-96231b3b80d8
2018-03-22 22:32:55 +00:00
Eric Fiselier
b06c8f07b2 Use DoNotOptimize to prevent new/delete elision.
The new/delete tests, in particular those which test replacement
functions, often fail when the optimizer is enabled because the
calls to new/delete may be optimized away, regardless of their side-effects.

This patch converts the tests to use DoNotOptimize in order to prevent
the elision.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@328245 91177308-0d34-0410-b5e6-96231b3b80d8
2018-03-22 21:28:09 +00:00
Eric Fiselier
b7f27d421f Un-XFAIL a test under new GCC version; the GCC bug has been fixed
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@328229 91177308-0d34-0410-b5e6-96231b3b80d8
2018-03-22 19:18:08 +00:00
Marshall Clow
e9e128b0a6 Fix improperly failing test - and the code it was testing. Thanks to Stephan Lavavej for the catch.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@328225 91177308-0d34-0410-b5e6-96231b3b80d8
2018-03-22 18:27:28 +00:00
Eric Fiselier
959c89de1f commit temporary workaround for new Clang exception warning
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@328186 91177308-0d34-0410-b5e6-96231b3b80d8
2018-03-22 07:53:47 +00:00
Eric Fiselier
6d7a11eb53 Correct TEST_HAS_NO_ALIGNED_ALLOCATION macro definition
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@328185 91177308-0d34-0410-b5e6-96231b3b80d8
2018-03-22 06:21:07 +00:00
Eric Fiselier
f4f3025362 Fix dynarray test failures after changing __libcpp_allocate/deallocate
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@328182 91177308-0d34-0410-b5e6-96231b3b80d8
2018-03-22 05:44:48 +00:00
Eric Fiselier
a831287399 Fix PR22634 - std::allocator doesn't respect over-aligned types.
This patch fixes std::allocator, and more specifically, all users
of __libcpp_allocate and __libcpp_deallocate, to support over-aligned
types.

__libcpp_allocate/deallocate now take an alignment parameter, and when
the specified alignment is greater than that supported by malloc/new,
the aligned version of operator new is called (assuming it's available).

When aligned new isn't available, the old behavior has been kept, and the
alignment parameter is ignored.

This patch depends on recent changes to __builtin_operator_new/delete which
allow them to be used to call any regular new/delete operator. By using
__builtin_operator_new/delete when possible, the new/delete erasure optimization
is maintained.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@328180 91177308-0d34-0410-b5e6-96231b3b80d8
2018-03-22 04:42:56 +00:00
Marshall Clow
256f187bc6 Implement LWG3034: P0767R1 breaks previously-standard-layout types
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@328064 91177308-0d34-0410-b5e6-96231b3b80d8
2018-03-21 00:36:05 +00:00
Marshall Clow
dfeb9b2af7 Implement LWG3035: std::allocator's constructors should be constexpr.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@328059 91177308-0d34-0410-b5e6-96231b3b80d8
2018-03-20 23:02:53 +00:00
Marshall Clow
483bc7c64a Implement LWG 3039 and 3041 - 'Treating Unnecessary decay'.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@328054 91177308-0d34-0410-b5e6-96231b3b80d8
2018-03-20 22:37:37 +00:00
Marshall Clow
6ce040b9aa Updated C++2a status with changes from Jacksonville WG21 meeting
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@327806 91177308-0d34-0410-b5e6-96231b3b80d8
2018-03-18 19:29:21 +00:00
Mike Edwards
ddb6e5f2ef [libcxx][test] Adding apple-clang-9 to UNSUPPORTED in iter_alloc_deduction.fail.cpp.
After two failed attempts last week to make this work I am
going back to a known good method of making this test pass on
macOS...adding the current apple-clang version to the
UNSUPPORTED list.

During a previous patch review (https://reviews.llvm.org/D44103)
it was suggested to just XFAIL libcpp-no-deduction-guides
as was done to iter_alloc_deduction.pass.cpp. However
this caused a an unexpected pass on:
http://lab.llvm.org:8011/builders/libcxx-libcxxabi-x86_64-linux-ubuntu-gcc-tot-latest-std/builds/214

I then attempted to just mark libcpp-no-deduction-guides
as UNSUPPORTED, however this caused an additional bot
failure.  So I reverted everything (https://reviews.llvm.org/rCXX327191).

To solve this and get work unblocked I am adding
apple-clang-9 to the original UNSUPPORTED list.



git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@327304 91177308-0d34-0410-b5e6-96231b3b80d8
2018-03-12 18:06:37 +00:00
Petr Hosek
698b695147 [CMake] Copy the generated __config header into build directory
When the generated __config file is being used, it is currently only
copied during installation process. However, that means that the file
that gets copied into LLVM build directory is the vanilla __config file,
and any parts of the build that depend on the just built toolchain like
sanitizers will get that instead of the generated version. To avoid this
issue, we need to copy the generated header into the LLVM build
directory as well.

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

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@327194 91177308-0d34-0410-b5e6-96231b3b80d8
2018-03-10 01:20:11 +00:00
Mike Edwards
7c796ffe54 [libcxx][test] Reverting r327178 and r327190.
Reverting changes made to iter_alloc_deduction.fail.cpp
as my changes seem to be making several Linux bots angry.



git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@327191 91177308-0d34-0410-b5e6-96231b3b80d8
2018-03-10 00:53:05 +00:00
Mike Edwards
00c27d8a40 [libcxx][test] Marking libcpp-no-deduction-guides unsupported.
This fixes linux bot failures with r327178.



git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@327190 91177308-0d34-0410-b5e6-96231b3b80d8
2018-03-10 00:19:25 +00:00