Commit Graph

425 Commits

Author SHA1 Message Date
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 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 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 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 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
Louis Dionne 1eb211ada1 [libc++] Translate the std Lit parameter to the DSL 2020-06-30 16:51:20 -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
Louis Dionne 5d83880885 [runtimes] Remove the ability to select the old libc++ testing format
As announced on libcxx-dev at [1], the old libc++ testing format is being
removed in favour of the new one. Follow-up commits will clean up the
code that is dead after the removal of this option.

[1]: http://lists.llvm.org/pipermail/libcxx-dev/2020-June/000885.html
2020-06-29 14:07:41 -04:00
Louis Dionne 7014b44c0a [libc++] Remove unnecessary LLVM_INCLUDE_BENCHMARKS option in the Apple build
Since we're using an empty top-level CMakeLists.txt instead of the CMakeLists.txt
inside llvm/, we don't need to specify LLVM_INCLUDE_BENCHMARKS anymore.
2020-06-25 17:34:45 -04:00
Eric Christopher 76ff0775d8 [libcxx] As part of using inclusive language within the llvm
project, migrate away from the use of blacklist and whitelist.
2020-06-19 21:37:11 -07:00
Raul Tambre 98eb1457ff [libc++] Require concepts support for <numbers>
Similar to <concepts>, we need to protect the header and test against
inclusion and being run if concepts aren't supported by the compiler.

Differential Revision: https://reviews.llvm.org/D82171
2020-06-19 10:49:44 -04:00
Raul Tambre 4f6c4b473c [libc++] Implement <numbers>
Summary: Constants have 33 significant decimal digits for IEEE 754 128-bit floating-point numbers.

Reviewers: ldionne, #libc, EricWF, zoecarver, curdeius

Reviewed By: ldionne, #libc, curdeius

Differential Revision: https://reviews.llvm.org/D77505
2020-06-19 14:25:02 +05:30
Louis Dionne 4976771e11 [libc++] Add a dummy CMake file to include runtime subprojects
Add a simple CMakeLists.txt to build the runtimes in lockstep without
building all of LLVM. See [1] for details.

[1]: http://lists.llvm.org/pipermail/llvm-dev/2020-June/142384.html
2020-06-18 14:34:56 -04:00
Louis Dionne c8d0aaa7ff [libc++] Automatically create the %T directory inside config tests 2020-06-15 19:32:06 -04:00
Louis Dionne 619beb0a53 [libc++] Replace the FakeLitConfig by an actual LitConfig object 2020-06-15 19:32:06 -04:00
Louis Dionne eeb96e4f19 [libc++] Re-apply parts of 3ea9450bda "Migrate Lit platform detection to the DSL"
The commit was reverted in 43c4afb56f because it broke the Windows to
Linux cross-compilation build bots. The issue turned out to be that the
bots were setting the LIBCXX_EXECUTOR incorrectly. This has been fixed
now and verified with the bot owners.

Note that this is only a partial re-application of the commit, since
non-problematic parts of the commits have already been re-applied earlier.
2020-06-15 17:40:04 -04:00
Louis Dionne 96e48e9a61 [libc++] Add the ability to run arbitrary programs using the DSL
This is useful for checking runtime properties of the target system.
This is a partial re-application of 3ea9450bda. This part was tested
to work on a Windows host with a SSH executor.
2020-06-15 14:59:53 -04:00
Louis Dionne 58610eb368 [libc++] Raise an exception if a Lit feature resolves to an invalid name
This allows reporting issues early when creating feature names.
2020-06-15 12:20:50 -04:00
Vladimir Vereschaka 43c4afb56f Revert "[libc++] Migrate Lit platform detection to the DSL"
This reverts commit 3ea9450bda.

The commit fails the remote library tests on the toolchain builders:

http://lab.llvm.org:8011/builders/llvm-clang-win-x-armv7l
http://lab.llvm.org:8011/builders/llvm-clang-win-x-aarch64
2020-06-13 12:50:43 -07:00
Louis Dionne 3ea9450bda [libc++] Migrate Lit platform detection to the DSL
As an important fly-by fix, also make sure we set those features to their
value on the target we run on, not on the host compiling the test suite.
2020-06-12 13:59:45 -04:00
Louis Dionne db8255aee7 [libc++] Parse commands inside _executeScriptInternal to remove duplication
Instead of parsing the command each time prior to calling _executeScriptInternal,
do it once inside _executeScriptInternal.
2020-06-12 12:03:15 -04:00
Louis Dionne f998e0d679 [libc++] Make executor scripts executable
This allows running the scripts directly, without running them through
Python.
2020-06-12 10:29:04 -04:00
Louis Dionne 96e6cbbf94 [libc++] Allow specifying arbitrary custom executors with the new format
The integration between CMake and executor selection in the new format
wasn't very flexible -- only the default executor and SSH executors were
supported.

This patch makes it possible to specify arbitrary executors with the new
format. With the new testing format, a custom executor is just a script
that gets called with a command-line to execute, and some arguments like
--env, --codesign_identity and --execdir. As such, the default executor
is just run.py.

Remote execution with the SSH executor can be achived by specifying
LIBCXX_EXECUTOR="<path-to-ssh.py> --host <host>". Similarly, arbitrary
scripts can be provided.
2020-06-11 16:24:29 -04:00
Louis Dionne 1fc5010d6b [libc++] Consider everything inside %T to be a dependency of each test
Instead of passing file dependencies individually, assume that the
whole content of the unique test directory is a dependency. This
simplifies the test harness significantly, by making %T the directory
that contains everything required to run a test. This also removes the
need for the %{file_dependencies} substitution, which is removed by this
patch.

Furthermore, this patch also changes the harness to execute tests locally
inside %T, so as to avoid creating a separate directory for no purpose.
2020-06-10 22:38:05 -04:00
Louis Dionne 4e813bbdf3 [libc++] Make sure tests are run in a unique directory
This will allow simplifying executors by always just copying the whole
%T, and assuming that all file dependencies are contained in it.

Superseeds https://reviews.llvm.org/D78245, which tried to make %T unique
in Lit, but which encountered push back.
2020-06-10 16:19:10 -04:00
Louis Dionne 756db3084b [libc++] Install locales in the build bot Docker images
This allows running the locale tests on the build bots.
2020-06-10 09:37:14 -04:00
Louis Dionne a2439bebe1 [libc++] Translate the enable_filesystem parameter to the DSL 2020-06-10 08:54:42 -04:00
Louis Dionne 01a0c3b49a [libc++] Define the no-exceptions Lit feature using the DSL
Instead of using logic in config.py, use the DSL to grab the no-exceptions
user-configurable parameter from the Lit command-line invocation.
2020-06-10 08:03:51 -04:00
Louis Dionne 78e266efab [libc++] Allow picking Lit parameters from the config
Unlike parameters in litConfig.params, the config isn't shared across
all test suites. For example, if we want to enable exceptions in the
tests for libcxxabi, but not in the tests for libcxx, we can't set the
enable_exceptions parameter in the litConfig object, cause it will be
used by both. Instead, setting it inside the config object solves that
problem.
2020-06-10 08:02:07 -04:00
Louis Dionne 7fb40e1569 [libc++] Fix too stringent availability markup for bad_optional_access
The availability markup for bad_optional_access marked it as being added
in MacOS 10.14 and aligned releases, however it appears to have been added
in Mac OS 10.13 and aligned releases.
2020-06-09 14:39:51 -04:00
Louis Dionne 339156ad63 [libc++] Avoid passing -xc++ in Lit feature detection
Otherwise, if %{flags} contain other files like static libraries, those
files are treated as C++ source files instead of object files, and the
compiler gets all confused.
2020-06-05 13:41:48 -04:00
Louis Dionne 3864ee7722 [libc++] Translate locale detection to the DSL 2020-06-05 09:50:00 -04:00
Louis Dionne e0184357fc [libc++] Link against libatomic when it is found
Before this patch, we tried detecting whether small atomics were available
without linking against libatomic. However, that's not really what we want
to know -- instead, we want to know what's required in order to support
atomics fully, which is to link against libatomic when it's provided.

That is both much simpler, and it doesn't suffer the problem that we would
not link against libatomic when small atomics didn't require it, which
lead to non-lockfree atomics never working.

Furthermore, because we understand that some platforms might not want to
(or be able to) ship non-lockfree atomics, we add that notion to the test
suite, independently of a potential extern library.

After this patch, we therefore:
(1) Link against libatomic when it is provided
(2) Independently detect whether non-lockfree atomics are supported in
    the test suite, regardless of whether that means we're linking against
    an external library or not (which is an implementation detail).

Differential Revision: https://reviews.llvm.org/D81190
2020-06-05 09:28:44 -04:00
Louis Dionne cc78f1e0fe [libc++] Avoid warning for large types with std::atomic in the test suite
It is legitimate for the test suite to use types that are slow to use
with std::atomic, since we need coverage for those too. If we don't
disable the warning, it is promoted to an error, which prevents us
from testing such types.
2020-06-04 14:06:04 -04:00
Louis Dionne 68e4e8a8d0 [libc++] Disable LLVM benchmarks in the Apple build 2020-06-04 12:03:25 -04:00
Louis Dionne b68bf11efc [libc++] Merge the Apple install-libcxx and libcxxabi scripts
Also, refactor the now-merged script to remove code duplication in the
creation of universal dylibs.
2020-06-04 11:20:03 -04:00
Louis Dionne 39a116ee07 [libc++] Move away from the standalone build for Apple libc++ and libc++abi 2020-06-04 10:19:38 -04:00
Louis Dionne 77b9abfc8e [libc++] Complete overhaul of constexpr support in std::array
This commit adds missing support for constexpr in std::array under all
standard modes up to and including C++20. It also transforms the <array>
tests to check for constexpr-friendliness under the right standard modes.

Fixes https://llvm.org/PR40124
Fixes rdar://57522096
Supersedes https://reviews.llvm.org/D60666

Differential Revision: https://reviews.llvm.org/D80452
2020-05-28 12:31:06 -04:00
Marek Kurdej 174322c273 [libc++] Mark __cpp_lib_hardware_interference_size as unimplemented. This fxes bug PR41423.
Summary:
As described in the bug report:
The commit a8b9f59e8caf378d56e8bfcecdb22184cdabf42d "Implement feature test macros using a script" added test features macros for libc++. Among others, it added `__cpp_lib_hardware_interference_size`. However, there is nothing like std::hardware_constructive_interference_size nor std::hardware_destructive_interference_size, that should be in header <new>.

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

Reviewed By: ldionne, #libc

Differential Revision: https://reviews.llvm.org/D80431
2020-05-23 14:33:50 +02:00
Louis Dionne 8f555780ef [libc++] Link back-deployment tests against the latest libc++ and libc++abi
Instead of linking the tests against a library in some version of the
SDK, always link against the latest library, but still run against the
specified back-deployment target dylib.

This makes more sense since what we're really trying to test is that
the current library can be used to produce binaries that run on some
deployment target -- not that linking against the library in some
previous SDK makes that possible.

This solves an additional issue that when linking against a system dylib,
the -rpath argument given to the tests is ignored because the install_name
of the system library we link against is absolute.

rdar://63241847
2020-05-21 14:47:04 -04:00