Commit Graph

431 Commits

Author SHA1 Message Date
Louis Dionne 82b6dec0ed [libc++] Remove c++98 from the possible Standards of the test suite
Clang treats C++98 and C++03 as the same anyway, so it's no use having
two different settings for the same standard.
2020-07-29 14:18:37 -04:00
Alex Richardson 19e472fd84 [libcxx][lit] Fix running testsuite with python2.7 after 9020d28688
Python 2.7 fails with TypeError: unsupported operand type(s) for +: 'NoneType' and 'str'
if you pass None as the prefix argument to NamedTemporaryFile.

Reviewed By: ldionne, bjope, #libc

Differential Revision: https://reviews.llvm.org/D84595
2020-07-27 10:15:18 +01:00
Alex Richardson 9020d28688 [libcxx][lit] Fix incorrect lambda capture in hasLocale checks
The lambda being used to check whether locales are supported was always
passing the value of alts from the last loop iteration due to the way that
python lambda captures work. Fix this by using a default argument capture.

To help debug future similar issues I also added a prefix to the config
test binary indicating which locale is being tested.
I originally found this issue when implementing a new executor that simply
collects test binaries in a given directory and was surprised to see many
additional executables other than the expected test binaries. I therefore
added the locale prefix to the test binaries and noticed that they were all
checking for cs_CZ.ISO8859-2.

Reviewed By: #libc, ldionne

Differential Revision: https://reviews.llvm.org/D84040
2020-07-23 11:19:18 +01: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
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
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