Commit Graph

377 Commits

Author SHA1 Message Date
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
Louis Dionne 16f5ce5a74 [libc++] Remove -ftemplate-depth when running tests
It doesn't appear to be needed anymore with the Clang on our build bots.
2020-05-15 14:21:29 -04:00
Louis Dionne ddacd370c5 [libc++] Do not set the runtime library path with DYLD_LIBRARY_PATH
We already set it using -rpath when linking test executables, and using
DYLD_LIBRARY_PATH causes problems when running other commands that
shouldn't run against the just-built libc++ (e.g. `ls` in a ShTest).

rdar://63241847
2020-05-15 14:09:40 -04:00
Louis Dionne 93e8164546 [libc++] Remove workaround for DYLD_LIBRARY_PATH being passed to the compiler
Since we're using the new testing format, DYLD_LIBRARY_PATH is not passed
to the compiler -- it's only passed to the programs we run as an argument
to the %{exec} substitution.
2020-05-15 13:53:45 -04:00
Louis Dionne 21b0ec2fc6 [libc++] Do not rely on use_system_cxx_lib to specify the path of the library to run against
This is already handled by setting cxx_runtime_root instead -- I don't
see a reason to have two ways of setting the runtime path of the library
we're running against.
2020-05-15 13:01:37 -04:00
Louis Dionne 1a68b5f048 [libc++] Fix broken Lit features based on __config_site macros
Because of Python's funny scoping rules with lambdas, we were always
using the value of `macro` as set in the last iteration of the loop.
This problem was introduced by e7bdfba4f0.
2020-05-15 12:25:19 -04:00
Louis Dionne bb7191aa81 [libc++] Segregate back-deployment dylibs into their own subdirectory
Otherwise, specifying (for example) the libc++.dylib from macos10.13
but the libc++abi.dylib from macos10.12 would end up adding library
paths for both the 10.12 and 10.13 dylibs, which would each contain
a copy of both libc++abi.dylib and libc++.dylib. By using a separate
directory for libc++.dylib and libc++abi.dylib, those do not conflict
anymore.

The back-deployment roots were updated to match this change.
2020-05-15 12:16:02 -04:00
Louis Dionne 04c89c7fca [libc++] Centralize where we set the libc++ and libc++abi paths in config.py
It's just confusing to have them all over the place.
2020-05-15 11:45:26 -04:00
Louis Dionne e7bdfba4f0 [libc++] Explicitly list Lit features from the config_site header
When grepping for unused features in the test suite, we will now find
those features and where they are defined, as opposed to thinking they
are dead features.
2020-05-13 16:17:22 -04:00
Michael Schellenberger Costa 6d2599e4f7 [libcxx][span] Implement P1976R2
This resolves the NB comment about the construction of a fixed-size span
from a dynamic range.

Differential Revision: https://reviews.llvm.org/D74577
2020-05-13 09:52:47 -04:00
Louis Dionne d98b9a4157 [libc++] NFC: Do not print the environment on remote hosts
Running `export` when there is no environment variable to export will
cause the environment on the remote host to be printed. We don't want
that, so don't run any `export` command on the host when there's no env.
2020-05-06 11:33:13 -04:00
Louis Dionne 7e6221da10 [libc++] Remove unused functions and minor features of the test suite
This commit removes minor features of the test suite that I've never
seen used and that are basically just a maintenance burden:

- color_diagnostics: Diagnostics are colored by default when running
  from a terminal, and not colored otherwise. This is the right behavior.
  Being able to tweak this has minor value, and could be achieved by
  modifying the %{compile_flags} instead if absolutely needed.

- ccache: This can be achieved by using a wrapper for the %{cxx}
  substitution.

- _dump_macros_verbose is just a dead function now.
2020-05-05 09:58:36 -04:00
Louis Dionne 17a53a14fc [libc++] Allow <__config_site> not being included
Otherwise, we can't test other standard libraries.
2020-05-05 09:45:30 -04:00
Louis Dionne c0cd106fcc [libc++] Move parsing of <__config_site> macros to the DSL 2020-05-05 09:31:42 -04:00
Louis Dionne 94361ddd93 [libc++] Always enable local submodule visibility in the test suite
When building with modules, always enable local submodule visibility.
It used to be disabled on Apple platforms, but it seems like we want
to use the same flags on Apple and Linux now (see https://reviews.llvm.org/D74892).
2020-05-04 13:29:24 -04:00
Louis Dionne 09e4e9ff7b [libc++] NFC: Remove unnecessary scope
The double-braces were initially to escape Python string formatting, but
that string isn't sent through Python string formatting.
2020-05-04 12:32:45 -04:00
Louis Dionne 0b722a8dba [libc++] Translate the modules-support Lit feature to the DSL 2020-05-04 12:14:19 -04:00
Louis Dionne db015fdd20 [libc++] Translate compiler-identification Lit features to the new DSL 2020-05-04 11:02:38 -04:00
Louis Dionne 9ae23bd0a3 [libc++] NFC: Print Lit available features in sorted order
This makes it easier to diff them between bot runs.
2020-05-04 10:12:07 -04:00
Louis Dionne ff4a3ee49c [libc++] Define a few Lit features using the new DSL
This commit migrates some of the Lit features from config.py to the new
DSL. This simplifies config.py and is a first step towards defining all
the features using the DSL instead of the complex logic in config.py.

Differential Revision: https://reviews.llvm.org/D78382
2020-05-04 08:54:07 -04:00
Marek Kurdej 3e895085de [libc++][P1115][C++20] Improving the Return Value of Erase-Like Algorithms II: Free erase/erase if.
Summary:
This patch adds return type to std::erase and std::erase_if functions.

Also:
* Update __cpp_lib_erase_if to 202002L.
* Fix synopsis in unordered_map.
* Fix generate_feature_test_macro_components.py script.

Reviewers: EricWF, mclow.lists, ldionne, #libc

Reviewed By: ldionne, #libc

Subscribers: broadwaylamb, zoecarver, dexonsmith, ldionne, libcxx-commits

Tags: #libc

Differential Revision: https://reviews.llvm.org/D75905
2020-05-02 14:04:50 +02:00
Louis Dionne cd05707d08 [libc++] Try re-enabling DSL test on Windows
The issues we were seeing before should have been fixed, but it's hard
to say for sure without running through the bots again.
2020-05-01 14:29:37 -04:00
Louis Dionne 68fb8051d0 [libc++] Turn on warnings in the test suite in C++03 for Clang-based compilers 2020-05-01 13:34:11 -04:00
Louis Dionne 0c91e134e6 [libc++] Make sure -Werror is enabled all the time, except in verify tests 2020-05-01 10:45:39 -04:00
Louis Dionne 75a815a28c [libc++] Use Lit utilities instead of old libcxx utilities for str/bytes conversions
The libcxx.util utilities don't work properly, and we should remove them
when we get rid of compiler.py. In particular, libcxx.util.to_string
appears to be completely broken.
2020-04-30 15:49:40 -04:00
Louis Dionne ecd3ce0e5a [libc++] Make sure platform detection works in both Python 2 and 3
19123a3e08 was too naive -- we really want to handle both Python 2 and
Python 3, not only Python 3.
2020-04-30 15:32:08 -04:00
Louis Dionne d789ef1608 [libc++] Make sure we create the working directory for running config check commands
The internal Lit shell requires the current working directory to exist.
This didn't show up locally because the directories were already created
by previous runs of the tests.
2020-04-30 14:10:56 -04:00
Louis Dionne cfedd7d5e3 [libc++] Use the internal Lit shell parser to run config tests
This makes the config tests portable across platforms.
2020-04-30 13:26:57 -04:00
Louis Dionne dfec13fcf2 [libc++] Do not allow customizing the arch in the trunk and back-deployment scripts
We should eventually be able to pass an arbitrary target triple, however
for the time being, just being able to pass 64/32 is not really that
useful.
2020-04-30 12:58:51 -04:00
Louis Dionne 2fd7d364cd [libc++] Make the verify-support feature implicit
Tests that require support for Clang-verify are already marked as such
explicitly by their extension, which is .verify.cpp. Requiring the use
of an explicit Lit feature is, after thought, not really helpful.

This is a change in design: we have been bitten in the past by tests not
being enabled when we thought they were. However, the issue was mostly
with file extensions being ignored. The fix for that is not to blindly
require explicit features all the time, but instead to report all files
that are in the suite but that don't match any known test format. This
can be implemented in a follow-up patch.
2020-04-30 11:47:12 -04:00
Louis Dionne ae3e58517e [libc++] Re-disable DSL test on Windows
This reverts commit 51a60ed14c, since the test still doesn't pass on
Windows. Marking the test as UNSUPORTED	on Windows again until I've
figured out the problem.
2020-04-29 14:21:04 -04:00
Louis Dionne 51a60ed14c [libc++] Try re-enabling DSL test on Windows
The issue we were seeing before should have been fixed by 178a0c80ba.
2020-04-29 11:32:27 -04:00
Louis Dionne 19123a3e08 [libc++] Fix MacOS platform detection broken in Python 3
Since 88af3ddb1e, libc++ will prefer Python 3 when available. It is
available on Apple platforms, so subprocess.check_output will return
bytes instead of str. This lead to comparisons against str to be false,
and the MacOS platform not being detected properly.
2020-04-29 10:00:56 -04:00
Louis Dionne 178a0c80ba [libc++] Make sure temporary config files are closed
Otherwise, trying to remove the file triggers an error on Windows.
2020-04-28 17:13:03 -04:00
Louis Dionne 14f07bcab0 [libc++] Avoid using distutils.util in the DSL
Some bots apparently don't have that package.
2020-04-28 13:33:04 -04:00
Louis Dionne 707df4acdc [libc++] Temporarily disable test that fails on Windows 2020-04-28 13:10:12 -04:00
Louis Dionne e82f0a598f [libc++][Take 2] Create a small DSL for defining Lit features and parameters
This allows defining Lit features that can be enabled or disabled based
on compiler support, and parameters that are passed on the command line.

The main benefits are:
- Feature detection is entirely based on the substitutions provided in
  the TestingConfig object, which is simpler and decouples it from the
  complicated compiler emulation infrastructure.
- The syntax is declarative, which makes it easy to see what features
  and parameters are accepted by the test suite. This is significantly
  less entangled than the current config.py logic.
- Since feature detection is based on substitutions, it works really
  well on top of the new format, and custom Lit configurations can be
  created easily without being based on `config.py`.

This commit is a reapplication of 6d58030c8c, which was reverted in
8f24c4b72f because it broke Python 3 support. This re-application
supports Python 3.

Differential Revision: https://reviews.llvm.org/D78381
2020-04-28 10:02:40 -04:00
David Zarzycki 8f24c4b72f Revert: [libc++] Create a small DSL for defining Lit features and parameters
This reverts commit 6d58030c8c due to lack
of Python 3 support. As a reminder, the Python community ended their
support for 2.x at the start of 2020.
2020-04-28 08:12:19 -04:00
Louis Dionne 05ef484df5 [libc++] Properly handle --no-execute in the new format
If --no-execute is passed, we shouldn't report XFAIL tests as passing,
or they will be considered to XPASS.
2020-04-27 13:37:39 -04:00
Louis Dionne a486edd03a [libc++abi] Assume that libcxx is checked out in the Apple build script
Instead of using the libc++ headers provided alongside the toolchain,
use those in the sibling libcxx directory that we know is checked out.
Before the days of the monorepo, we couldn't assume that the libc++
repository was present when building libcxxabi. Since we can now make
that assumption, it's always better to use the version of libc++ that
is in lockstep with libc++abi, to avoid subtle bugs.
2020-04-27 11:20:11 -04:00
Louis Dionne 6d58030c8c [libc++] Create a small DSL for defining Lit features and parameters
This allows defining Lit features that can be enabled or disabled based
on compiler support, and parameters that are passed on the command line.

The main benefits are:
- Feature detection is entirely based on the substitutions provided in
  the TestingConfig object, which is simpler and decouples it from the
  complicated compiler emulation infrastructure.
- The syntax is declarative, which makes it easy to see what features
  and parameters are accepted by the test suite. This is significantly
  less entangled than the current config.py logic.
- Since feature detection is based on substitutions, it works really
  well on top of the new format, and custom Lit configurations can be
  created easily without being based on `config.py`.

Differential Revision: https://reviews.llvm.org/D78381
2020-04-27 09:56:04 -04:00
Louis Dionne 38a9528ca2 [libc++] NFC: Expose a top-level parseScript function in the new format 2020-04-24 16:55:38 -04:00
Louis Dionne a9104f89b1 [libc++] Properly import lit.formats from the new format 2020-04-24 15:47:48 -04:00
Louis Dionne 4de60d955a [libc++] NFC: Refactor the new format substitutions into its own method
This way, we can reuse the substitution logic in the new DSL.
2020-04-24 15:35:57 -04:00
Louis Dionne 4fd92cc475 [libc++] Get rid of pipe in command to check whether verify is supported 2020-04-24 15:30:25 -04:00
Louis Dionne 7f48246175 [libc++] Quietly scp tarballs over with the remote executor
Otherwise, the progress-meter is printed.
2020-04-24 14:47:56 -04:00
Louis Dionne a2fc2207eb [libc++] NFC: Remove unused parameters in the new test format 2020-04-24 11:05:11 -04:00
Louis Dionne d6c95ae6ff [libc++] Update scripts to build libc++/libc++abi for Apple
Also, make sure we test them.
2020-04-23 14:31:04 -04:00
Louis Dionne 8c61114c53 [libc++/abi/unwind] Rename Lit features for no exceptions to 'no-exceptions'
Instead of having different names for the same Lit feature accross code
bases, use the same name everywhere. This NFC commit is in preparation
for a refactor where all three projects will be using the same Lit
feature detection logic, and hence it won't be convenient to use
different names for the feature.

Differential Revision: https://reviews.llvm.org/D78370
2020-04-22 08:25:27 -04:00