Commit Graph

6540 Commits

Author SHA1 Message Date
Louis Dionne e9748a7255 [libc++] Workaround broken support for C++17 in GCC 5 2020-07-22 15:38:58 -04:00
Louis Dionne e58660750e [libc++] Build the dylib with C++17 to allow aligned new/delete
This allows simplifying the implementation of barriers.

This is a re-commit of 1ac403bd14, which had to be reverted in
64a9c944fc because the minimum CMake version wasn't high enough.
Now that we've upgraded, we can do this.

Differential Revision: https://reviews.llvm.org/D75243
2020-07-22 14:47:29 -04:00
Louis Dionne afa1afd410 [CMake] Bump CMake minimum version to 3.13.4
This upgrade should be friction-less because we've already been ensuring
that CMake >= 3.13.4 is used.

This is part of the effort discussed on llvm-dev here:

  http://lists.llvm.org/pipermail/llvm-dev/2020-April/140578.html

Differential Revision: https://reviews.llvm.org/D78648
2020-07-22 14:25:07 -04:00
Hans Wennborg 3eec657825 Revert "Enable -Wsuggest-override in the LLVM build" and the follow-ups.
After lots of follow-up fixes, there are still problems, such as
-Wno-suggest-override getting passed to the Windows Resource Compiler
because it was added with add_definitions in the CMake file.

Rather than piling on another fix, let's revert so this can be re-landed
when there's a proper fix.

This reverts commit 21c0b4c1e8.
This reverts commit 81d68ad27b.
This reverts commit a361aa5249.
This reverts commit fa42b7cf29.
This reverts commit 955f87f947.
This reverts commit 8b16e45f66.
This reverts commit 308a127a38.
This reverts commit 274b6b0c7a.
This reverts commit 1c7037a2a5.
2020-07-22 20:23:58 +02:00
Alex Richardson e59778a66a [libcxx] Fix default argument for merge_archives.py -L flag
If we use the default of None, we get a python exception in
find_and_diagnose_missing() instead of printing a sensible error message.

Reviewed By: #libc, ldionne

Differential Revision: https://reviews.llvm.org/D84342
2020-07-22 18:32:34 +01:00
Alex Richardson 3980e8956b [libcxx][lit] Simplify parsing of trailing executor arguments
Adding a positional argparse.ONE_OR_MORE arguments will correctly remove
the "--" separator after --env and parse only the command. This also has
the advantage that misspelled flags raise an argparse error rather than
silently being added to the command to be executed.

I discovered this while adding a new commandline option to ssh.py to allow
passing additional arguments to the scp/ssh commands since this is required
for our CHERI CI where we need to pass `-F <custom_config_file>` to each
ssh/scp command to set various arguments such as the localhost port, usage
of controlmaster, etc. to speed up connections to our emulated QEMU systems.

Reviewed By: #libc, ldionne

Differential Revision: https://reviews.llvm.org/D84096
2020-07-21 09:03:45 +01:00
Vy Nguyen f5e49bd9de Disable trivial weak_ptr test on ARM because it is not expected to work.
Summary:
weak_ptr has two pointers (more than the 4 bytes limit), so it will not be returned in registers on ARM, even if it is trivial.
The test, therefore, will fail on ARM.

Reviewers: #libc!

Subscribers: kristof.beyls, danielkiss, libcxx-commits

Tags: #libc

Differential Revision: https://reviews.llvm.org/D84200
2020-07-20 17:02:49 -04:00
Logan Smith 8b16e45f66 Enable -Wsuggest-override in the LLVM build
This patch adds Clang's new (and GCC's old) -Wsuggest-override to the warning flags for the LLVM build. The warning is a stronger form of -Winconsistent-missing-override which warns _everywhere_ that override is missing, not just in places where it's inconsistent within a class.

Some directories in the monorepo need the warning disabled for compatibility's, or sanity's, sake; in particular, libcxx/libcxxabi, and any code implementing or interoperating with googletest, googlemock, or google benchmark (which do not themselves use override). This patch adds -Wno-suggest-override to the relevant CMakeLists.txt's to accomplish this.

Differential Revision: https://reviews.llvm.org/D84126
2020-07-20 12:32:47 -07:00
Vy Nguyen be2267ba34 [libcxx] Skip tests on GCC
Summary: These don't work with GCC

Reviewers: jyknight, #libc!

Subscribers: libcxx-commits

Tags: #libc

Differential Revision: https://reviews.llvm.org/D84183
2020-07-20 12:53:51 -04:00
Vy Nguyen 76887bc4c1 Reland [libcxx]Put clang::trivial_abi on smart pointers
Reviewed By: ldionne,EricWF

    Tags: #libcxx

    Differential Revision: https://reviews.llvm.org/D82490
2020-07-20 11:54:34 -04:00
serge-sans-paille 515bc8c155 Harmonize Python shebang
Differential Revision: https://reviews.llvm.org/D83857
2020-07-16 21:53:45 +02:00
Louis Dionne 2659663ee3 [libc++] Remove shortcut Lit features for Apple backdeployment
Some time ago, I introduced shortcut features like dylib-has-no-shared_mutex
to encode whether the deployment target supported shared_mutex (say). This
made the test suite annotations cleaner.

However, the problem with building Lit features on top of other Lit
features is that it's easier for them to become stale, especially when
they are generated programmatically. Furthermore, it makes the bar for
defining configurations from scratch higher, since more features have
to be defined. Instead, I think it's better to put the XFAILs in the
tests directly, which allows cleaning them up with a simple grep.
2020-07-16 15:39:08 -04:00
Louis Dionne 9785f7b196 [libc++] Improve how we report the testing configuration 2020-07-16 15:10:17 -04:00
Louis Dionne ff0d4367bf [runtimes] Move the enable_rtti Lit parameter to the DSL 2020-07-16 12:56:00 -04:00
Louis Dionne 0f03626fbf [runtimes][NFC] Remove unused or unnecessary CMake variables 2020-07-16 10:47:08 -04:00
Hans Wennborg 7ab7b979d2 Bump the trunk major version to 12
and clear the release notes.
2020-07-15 12:05:05 +02:00
Louis Dionne eaca1e4e54 [libc++] Automatically detect whether RTTI is enabled
Instead of detecting it automatically but also allowing for the setting
to be specified explicitly, always detect whether exceptions are enabled
based on whether -fno-rtti (or equivalent) is used. It's less confusing
to have a single way of tweaking that knob.

This change follows the lead of 71d88cebfb.
2020-07-14 16:51:37 -04:00
Sterling Augustine 77ee4b4c9b Desugar class type for iterator lookup.
Summary:
Without this, printing sets and maps hidden behind
using declarations fail.

Reviewers: #libc!

Subscribers: libcxx-commits

Tags: #libc

Differential Revision: https://reviews.llvm.org/D83732
2020-07-14 11:37:03 -07:00
Louis Dionne e1ca7a6522 [libc++] Fix building the benchmarks after introducing a target for cxx-headers
The libc++ headers were included twice, which broke the #include_next
logic.
2020-07-14 11:50:12 -04:00
Louis Dionne efa40eb194 [libc++] Use a proper CMake target to represent libc++ headers
Instead of having complex logic around how to include the libc++ headers
and __config_site, handle that by defining cxx-headers as an INTERFACE
library and linking against it. After this patch, linking against cxx-headers
is sufficient to get the right __config_site include and include paths
for libc++.

Differential Revision: https://reviews.llvm.org/D82702
2020-07-14 09:52:58 -04:00
Louis Dionne 2d3b8cc83f [libc++] Implement P0551
Make sure we satisfy the requirements added by P0551, and add tests to
enforce that.
2020-07-13 13:42:26 -04:00
Louis Dionne 389b67b809 [libc++] Get rid of the %{libcxx_src_root} substitution
This reduces the set of substitutions required to run the test suite.
2020-07-09 15:17:47 -04:00
Louis Dionne cfb3675410 [libc++] The enable_experimental Lit feature should be False by default
This preserves existing behavior before f5f58f1f73.
2020-07-09 14:21:24 -04:00
Louis Dionne f5f58f1f73 [libc++] Move the enable_experimental Lit param to the DSL 2020-07-09 14:00:05 -04:00
Louis Dionne b785396525 [libc++] Clean up some outdated documentation about running libc++ tests
The documentation is still awfully outdated, but it's a bit better at least.
2020-07-09 13:39:00 -04:00
Louis Dionne 4598a3c784 [libc++] Move the long_tests Lit feature to the DSL 2020-07-09 13:25:27 -04:00
Louis Dionne c1a83c30e1 [libc++] Move the stdlib Lit parameter to the DSL 2020-07-09 13:23:11 -04:00
Louis Dionne 6a8ed4a8ff [libc++] Fix test failure in C++03 mode 2020-07-09 13:05:22 -04:00
Louis Dionne 6f69318c72 [runtimes] Allow passing Lit parameters through CMake
This allows passing parameters to the test suites without using
LLVM_LIT_ARGS. The problem is that we sometimes want to set some
Lit arguments on the CMake command line, but the Lit parameters in
a CMake cache file. If the only knob to do that is LLVM_LIT_ARGS,
the command-line entry overrides the cache one, and the parameters
set by the cache are ignored.

This fixes a current issue with the build bots that they completely
ignore the 'std' param set by Lit, because other Lit arguments are
provided via LLVM_LIT_ARGS on the CMake command-line.
2020-07-09 12:45:00 -04:00
Louis Dionne 305b500eaf [libc++] Fix test failures in C++14 mode 2020-07-09 01:14:30 -04:00
Louis Dionne 7a5d79de95 [libc++] Make sure the ENABLE_FILESYSTEM variable is always bound
The script always fails otherwise, since we run with 'set -u'
2020-07-08 16:28:33 -04:00
Louis Dionne 512c903898 [libc++] Install PSTL when installing libc++ with parallel algorithms enabled 2020-07-08 15:01:15 -04:00
Louis Dionne 2be4014fe6 [libc++] Reimplement platform detection features without running on the test host
It's sufficient to sniff the platform we're running on using the compiler
macros -- we don't need to run any code.
2020-07-08 14:05:33 -04:00
Michael Park 6ab3208d77
Remove the unnecessary `is_nothrow_swappable` condition in `swap`.
Thanks to @lewissbaker who pointed out the unnecessary condition in
https://reviews.llvm.org/D81954#inline-756872. Since this codepath does not
make use of `swap` anyway (that codepath is a different branch), we can safely
remove this condition and produce better codegen when all types are nothrow
movable but are potentially-throwing swappable.

See codegen in https://gcc.godbolt.org/z/uDFZjz

Reviewed By: ldionne, #libc

Differential Revision: https://reviews.llvm.org/D83274
2020-07-08 10:46:38 -07:00
Louis Dionne f69acb2af8 [libc++][NFC] Remove outdated TODO item 2020-07-08 13:04:33 -04:00
Louis Dionne a42a58c9ce [libc++] Mark some tests as unsupported on GCC 5
There used to be a workaround where we'd pretend that GCC 5 didn't support
C++14 because it doesn't implement it properly. Since that workaround has
been removed (in 1eb211ada1), we need to mark a few individual tests as
failing with GCC 5.
2020-07-08 12:02:36 -04:00
MinJae Hwang 8421364282 Modifications to the algorithm sort benchmark
Summary:
Modifies the algorithm sort bench:
- shows sorting time per element, instead of sorting time per array.
This would make comparison between different sizes of arrays easier.
- adds std::pair benchmark cases.
- uses a large number of arrays to benchmark, instead of repeatedly sorting the same array.
* sorting the same array again and again would not show actual sorting performance over randomized data sets.

Reviewers: EricWF, #libc, mvels

Reviewed By: EricWF, #libc, mvels

Subscribers: mgrang, libcxx-commits

Tags: #libc

Differential Revision: https://reviews.llvm.org/D81770
2020-07-06 18:30:02 -04:00
Stephan Herhut 3341d470fc Revert "Revert "Revert "[libcxx] Put clang::trivial_abi on std::unique_ptr, std::shared_ptr, and std::weak_ptr"""
This reverts commit f706b01a00.
2020-07-06 12:18:17 +02:00
Vy Nguyen f706b01a00 Revert "Revert "[libcxx] Put clang::trivial_abi on std::unique_ptr, std::shared_ptr, and std::weak_ptr""
This reverts commit dc13ac0280.

Rolling forward + fix typos and unused variables in tests

    Differential Revision: https://reviews.llvm.org/D82490
2020-07-05 13:44:42 -04:00
Vy Nguyen dc13ac0280 Revert "[libcxx] Put clang::trivial_abi on std::unique_ptr, std::shared_ptr, and std::weak_ptr"
This reverts commit 5cde3c9633.

The tests were reported failing on clang10
2020-07-04 11:29:08 -04:00
David Zarzycki e56e96a264 [libcxx testing] Remove ALLOW_RETRIES from another test 2020-07-04 10:15:21 -04:00
Vy Nguyen 5cde3c9633 [libcxx] Put clang::trivial_abi on std::unique_ptr, std::shared_ptr, and std::weak_ptr
Reviewers: jyknight, EricWF, #libc!

Subscribers: arphaman, libcxx-commits

Tags: #libc

Differential Revision: https://reviews.llvm.org/D82490
2020-07-03 17:23:13 -04:00
Louis Dionne 71d88cebfb [libc++/libc++abi] Automatically detect whether exceptions are enabled
Instead of detecting it automatically (in libc++) and relying on
_LIBCXXABI_NO_EXCEPTIONS being set explicitly (in libc++abi), always
detect whether exceptions are enabled automatically.

This commit also removes support for specifying -D_LIBCPP_NO_EXCEPTIONS
and -D_LIBCXXABI_NO_EXCEPTIONS explicitly -- those should just be inferred
from using -fno-exceptions (or an equivalent flag).

Allowing both -D_FOO_NO_EXCEPTIONS to be provided explicitly and trying
to detect it automatically is just confusing, especially since we did
specify it explicitly when building libc++abi. We should have only one
way to detect whether exceptions are enabled, but it should be robust.
2020-07-03 14:58:09 -04:00
David Zarzycki 8aff689164 [libcxx testing] Remove ALLOW_RETRIES from another test 2020-07-03 07:00:34 -04:00
Louis Dionne 1eb211ada1 [libc++] Translate the std Lit parameter to the DSL 2020-06-30 16:51:20 -04:00
Louis Dionne 99f213e07c [libc++] Fix the Lit DSL test in case a substitution is empty 2020-06-30 14:52:51 -04:00
Louis Dionne 73370b2c0c [libc++] Add missing include in test 2020-06-30 14:16:47 -04:00
Louis Dionne ce6153a528 [libc++] Split dylib instantiations for deprecated std::random_shuffle into a separate source file
That makes it easier to exclude from the build if one wants to build libc++
without support for the deprecated std::random_shuffle.
2020-06-30 13:50:17 -04:00
Louis Dionne 70f6389257 [runtimes] Rename newformat to just format, now that the old format has been removed 2020-06-30 10:10:30 -04:00
Louis Dionne b58b61c4b7 [libc++] Remove dead code since the removal of the old testing format 2020-06-30 10:07:59 -04:00