Commit Graph

947 Commits

Author SHA1 Message Date
Louis Dionne f13dff68d1 [libc++] Try to fix the quoting of -isystem on Windows bots 2022-02-09 10:08:12 -05:00
Louis Dionne 6f17768e11 [runtimes] Remove support for standalone builds
Standalone build have been deprecated for some time now, so this
commit removes support for those builds entirely from libc++, libc++abi
and libunwind.

This, along with the removal of other legacy ways to build, will allow
for major build system simplifications.

Differential Revision: https://reviews.llvm.org/D119255
2022-02-09 08:55:31 -05:00
Louis Dionne eceb40183c [libc++] Avoid -Wmacro-redefined in libc++ headers in the legacy test config 2022-02-09 08:38:06 -05:00
Nikolas Klauser a5b4479d3c [libc++] Add papers from February 2022 plenary meeting
Reviewed By: ldionne, Quuxplusone, #libc

Spies: arichardson, libcxx-commits

Differential Revision: https://reviews.llvm.org/D119189
2022-02-09 10:21:19 +01:00
Louis Dionne 817d897b57 [libc++] Remove _LIBCPP_ABI_UNSTABLE
Previously, _LIBCPP_ABI_UNSTABLE would be used interchangeably with
_LIBCPP_ABI_VERSION >= 2. This was confusing and creating unnecessary
complexity.

This patch removes _LIBCPP_ABI_UNSTABLE -- instead, the LIBCXX_ABI_UNSTABLE
CMake option will result in the LIBCXX_ABI_VERSION being set to '2', the
current unstable ABI. As a result, in the code, we only have _LIBCPP_ABI_VERSION
to check in order to query the current ABI version.

As a fly-by, this also defines the ABI namespace during CMake configuration
to reduce complexity in __config. I believe it was previously done this
way because we used to try to use __config_site as seldom as possible.
Now that we always ship a __config_site, it doesn't really matter and
I think being explicit about how the library is configured in the __config_site
is actually a feature.

Differential Revision: https://reviews.llvm.org/D119173
2022-02-08 15:18:09 -05:00
Louis Dionne 506cf6dc04 [libc++] Fix modules and benchmarks CI builds when incomplete features are disabled
Differential Revision: https://reviews.llvm.org/D119036
2022-02-08 15:15:07 -05:00
Louis Dionne 768b50df29 [libc++] Add a Lit configuration for running back-deployment tests
This testing configuration links tests against one libc++ shared library,
but runs them against another libc++ shared library. This makes sure that
we can build applications against the libc++ provided in a recent SDK and
back-deploy them to platforms containing older libc++ dylibs.

It also switches the Apple CI script to using that new configuration
instead of the legacy one.

Differential Revision: https://reviews.llvm.org/D119195
2022-02-08 11:13:58 -05:00
Nikolas Klauser 126663211a [libc++][CI] Put runs into groups
Many CI runs are very similar in nature. Let's put them into groups for a better overview

Reviewed By: ldionne, #libc

Spies: libcxx-commits, arichardson, mstorsjo

Differential Revision: https://reviews.llvm.org/D119059
2022-02-08 01:19:10 +01:00
Louis Dionne 157bbe6aea [libc++] Remove the ability to use the std::nullptr_t emulation in C++03 mode
Back in https://reviews.llvm.org/D109459, we stopped using the C++03
emulation for std::nullptr_t by default, which was an ABI break. We
still left a knob for users to turn it back on if they were broken by
the change, with a note that we would remove that knob after one release.

The time has now come to remove the knob and clean up the std::nullptr_t
emulation.

Differential Revision: https://reviews.llvm.org/D114786
2022-02-07 17:51:05 -05:00
Nikolas Klauser 9b0d324154 [libc++][CI] Reorder CI runs
This patch makes the uncontrovertial changes to the pipeline.

Reviewed By: ldionne, #libc

Spies: libcxx-commits, arichardson

Differential Revision: https://reviews.llvm.org/D119041
2022-02-07 20:53:13 +01:00
Nikolas Klauser 5488021f3e [libc++] Add Unstable ABI CI run
Reviewed By: ldionne, #libc, Mordante

Spies: mgorny, Mordante, libcxx-commits, arichardson

Differential Revision: https://reviews.llvm.org/D118725
2022-02-05 15:37:22 +01:00
Louis Dionne 78205faf54 [libc++][Docker] Don't actually start using a newer compiler in the CI
To ensure a smooth transition without breaking CI, we should use explicitly
versioned Clangs in the CI jobs definition instead, since that's a change
we can actually test in the CI.

So instead of bumping the compiler version from the Docker image, use
the same version as before by default, and we can bump it from the CI
job definition once all the nodes are running the new image.
2022-02-04 17:17:17 -05:00
Louis Dionne a27304c50f [libc++] Bump the version of Clang we use in the CI
Differential Revision: https://reviews.llvm.org/D118830
2022-02-04 17:05:38 -05:00
Arthur O'Dwyer fa6b9e4010 [libc++] Normalize all our '#pragma GCC system_header', and regression-test.
Now we'll notice if a header forgets to include this magic phrase.

Differential Revision: https://reviews.llvm.org/D118800
2022-02-04 12:27:19 -05:00
Louis Dionne 99ae458231 [libc++] Add CI without experimental features and don't exclude span from the tests
There is no reason for the parts of std::span that don't depend on ranges
to be disabled when ranges aren't provided. Also, to make sure the
"no-experimental-stuff" configuration is tested, add a CI job for it.

Differential Revision: https://reviews.llvm.org/D118740
2022-02-02 10:48:35 -05:00
Louis Dionne c7b255e5a8 [libc++][ci] Re-enable the bootstrapping build
Differential Revision: https://reviews.llvm.org/D118067
2022-02-01 15:29:00 -05:00
Louis Dionne 1f6af9c9ce [libc++][CI] Re-enable all CI jobs
This essentially reverts commit 89f4a18f37 now that our CI is back
online at full capacity.

Differential Revision: https://reviews.llvm.org/D116891
2022-01-24 15:47:11 -05:00
Arthur O'Dwyer 5d78fef6db [libc++] Fix LWG3437 "__cpp_lib_polymorphic_allocator is in the wrong header"
https://cplusplus.github.io/LWG/issue3437

Differential Revision: https://reviews.llvm.org/D117963
2022-01-23 10:30:09 -05:00
Alex Richardson 89103bd2f0 [libc++] Fix GDB pretty printers when GDB uses Python 2.7
The gdb_pretty_printer_test.sh fails if GDB was built against Python 2.7
since Python 2 expects iterators to have a next() method rather than
using __next__. To make the pretty printers work with both Python 2 and 3
we can simply set next to __next__ in the iterator classes.

Python 2.7 support was removed in f46f93b478,
so this partially reverts that commit. While Python 2.7 is EOL, it
appears there are still many GDB installations that are linked against
Python 2.7, so we may want to keep this tiny amount of compat code
around for a while longer.

Without this commit the tests fails with errors such as:
```
GDB printed:
   u"std::tuple containingTypeError: iter() returned non-iterator of type '_Children'\n"
Value should match:
   u'std::tuple containing = {[1] = 2, [2] = 3, [3] = 4}'
```

Reviewed By: #libc, ldionne

Differential Revision: https://reviews.llvm.org/D117470
2022-01-19 10:11:45 +00:00
Louis Dionne 4afa9c1726 [libc++] Persistently cache memoized operations during Lit configuration
When invoking Lit repeatedly, we perform all the configuration checks
over and over again, which takes a lot of time. This patch allows caching
the result of configuration checks persistently across Lit invocations to
speed this up.

In theory, this should still be functionally correct since the cache
key should contain everything that determines the output of the
configuration check. However, in cases where e.g. the compiler has
changed but is at the same path as previously, the Lit configuration
checks will be cached even though technically the cache should have
been invalidated.

Differential Revision: https://reviews.llvm.org/D117361
2022-01-18 10:44:23 -05:00
Nikolas Klauser c10cbb243c [libc++] Install clang-tidy in docker containers
Install clang-tidy

Reviewed By: ldionne, #libc

Spies: sammccall, mgorny, libcxx-commits, arichardson

Differential Revision: https://reviews.llvm.org/D117268
2022-01-17 21:05:42 +01:00
Arthur O'Dwyer 6cc305764f [libc++] [test] Add a test for proper _Uglification of template parameter names.
Merge nasty_macros.h into the new test.

Differential Revision: https://reviews.llvm.org/D116957
2022-01-14 15:50:37 -05:00
Arthur O'Dwyer 4b5d59ffd0 [libc++] libcxx/utils: s/preambule/preamble/g. NFC. 2022-01-10 11:38:25 -05:00
Louis Dionne 49b9b9dc9c [libc++] Fix the documentation and re-enable documentation CI
The documentation CI job is very cheap, so we can afford to keep it
around even with reduced capacity. This commit fixes the documentation
(which had an invalid reference in it) and re-enables that CI step.

Differential Revision: https://reviews.llvm.org/D116897
2022-01-10 08:05:58 -05:00
Nikolas Klauser bec50db2ed [libc++] Implement P1072R10 (std::basic_string::resize_and_overwrite)
Reviewed By: Quuxplusone, #libc, Mordante

Spies: mzeren-vmw, ckennelly, arichardson, ldionne, Mordante, libcxx-commits, Quuxplusone

Differential Revision: https://reviews.llvm.org/D113013
2022-01-07 00:09:16 +01:00
Nikolas Klauser f3aed36981 [libc++] Implement P1425R4 (Iterator pair constructors for std::stack and std::queue)
Implement P1425R4

Reviewed By: Quuxplusone, #libc, Mordante

Spies: Mordante, jloser, libcxx-commits, arichardson

Differential Revision: https://reviews.llvm.org/D115977
2022-01-06 18:55:11 +01:00
Nikolas Klauser 3ef363ecec [libc++] Re-enable `GCC11 / C++11`, `Clang 12` and `ASAN` CI-runs 2022-01-06 18:52:44 +01:00
Nico Weber 085f078307 Revert "Revert D109159 "[amdgpu] Enable selection of `s_cselect_b64`.""
This reverts commit 859ebca744.
The change contained many unrelated changes and e.g. restored
unit test failes for the old lld port.
2022-01-05 13:10:25 -05:00
David Salinas 859ebca744 Revert D109159 "[amdgpu] Enable selection of `s_cselect_b64`."
This reverts commit 640beb38e7.

That commit caused performance degradtion in Quicksilver test QS:sGPU and a functional test failure in (rocPRIM rocprim.device_segmented_radix_sort).
Reverting until we have a better solution to s_cselect_b64 codegen cleanup

Change-Id: Ibf8e397df94001f248fba609f072088a46abae08

Reviewed By: kzhuravl

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

Change-Id: Id169459ce4dfffa857d5645a0af50b0063ce1105
2022-01-05 17:57:32 +00:00
Arthur O'Dwyer 855d7bedb7 [libc++] [P0887] Add newest feature-test macros; mark `type_identity` as implemented.
`__cpp_lib_type_identity` was implemented way back in cf49ccd0 (Clang 8),
probably before the feature-test macro had been settled on.

`__cpp_lib_string_resize_and_overwrite` will be added by D113013 so I didn't add it here.

Fixes #46605.

Differential Revision: https://reviews.llvm.org/D116433
2022-01-04 17:23:37 -05:00
Mark de Wever bd6e6846e7 [libc++] Add the version header to all headers.
Some headers which require the version header depend on other headers to
provide it. Include the version header in all top-level headers to make
sure a header cleanup can't remove the version header.

Note this doesn't add the version header to the c headers.

Reviewed By: #libc, Quuxplusone, ldionne

Differential Revision: https://reviews.llvm.org/D116172
2022-01-04 19:50:59 +01:00
Louis Dionne 4aba7e901e [libc++][CI] Don't install libc6-dev-i386 in the Docker image
We don't cross-compile to 32 bits in the CI anymore.
2022-01-03 16:10:59 -05:00
Louis Dionne 4f7f7284c2 [libc++][NFC] Fix comment for running Docker container 2022-01-03 16:10:59 -05:00
Louis Dionne 89f4a18f37 [libc++][CI] Temporarily disable several Linux jobs
There is an ongoing CI outage with our Linux nodes, so I temporarily
set up a couple of nodes. These nodes will be much slower than the
usual ones and there's only a few of them, so I am temporarily disabling
most of our CI to keep things working.
2022-01-03 12:28:20 -05:00
Martin Storsjö 7176799a7e [libc++] Add from-scratch testing configs for Windows
The paths to the compiler and to the python executable may need to
be quoted (if they're installed into e.g. C:\Program Files).

All testing commands that are executed expect a gcc compatible command
line interface, while clang-cl uses different command line options.
In the original testing config, if the chosen compiler was clang-cl, it
was replaced with clang++ by looking for such an executable in the path.

For the new from-scratch test configs, I instead chose to add
"--driver-mode=g++" to flags - invoking "clang-cl --driver-mode=g++"
has the same effect as invoking "clang++", without needing to run any
heuristics for picking a different compiler executable.

Differential Revision: https://reviews.llvm.org/D111202
2021-12-22 15:16:58 +02:00
Martin Storsjö fd64544fbe [libcxx] [test] Remove a leftover unused function in config.py. NFC.
While there's little value in polishing the old config system,
I ran into this function and was confused for a while, while grepping
around and trying to wrap my head around things.

Differential Revision: https://reviews.llvm.org/D116131
2021-12-22 15:16:14 +02:00
Martin Storsjö d67b25e7f6 [libcxx] [test] Extend test for bash for executor-has-no-bash
If %{exec} sets "--env PATH=single-dir", the directory containing
bash and related shell utils is omitted from the path, which means
that most shell scripts would fail.

(Setting PATH is needed for DLL builds on Windows; PATH fills the same
role as e.g. LD_LIBRARY_PATH on Linux.)

This condition is missed in the current test, because the executor
run.py first resolves the executable to run using the original path,
then invokes that executable with an environment with a restricted
path. Thus the executor is able to run bash, but that bash is then
unable to run further shell commands (other than bash builtins).

Extend the test from "bash --version" to "bash -c 'bash --version'".
This correctly identifies the executor-has-no-bash condition in the
current Windows CI configs, allowing removing 6 cases of
LIBCXX-WINDOWS-FIXME.

Another longterm fix would be to extend run.py with an option like
"--env-prepend PATH=dir", to allow keeping the current path while
adding a directory to it.

Differential Revision: https://reviews.llvm.org/D116117
2021-12-22 00:43:29 +02:00
Martin Storsjö f68e89044a [libcxx] Add LIBCXX_EXTRA_SITE_DEFINES for adding extra defines in __config_site
This is similar to the existing setting LIBCXX_ABI_DEFINES, with
the difference that this also allows setting other defines than
ones that start with "_LIBCPP_ABI_", and allows setting defines
to a specific value.

This allows avoiding using LIBCXX_TEST_COMPILER_FLAGS in two
CI configurations.

Differential Revision: https://reviews.llvm.org/D116109
2021-12-22 00:43:29 +02:00
Martin Storsjö 008849d7a5 [libcxx] [test] Don't rerun supportsVerify for each individual test
We can't just memoize _supportsVerify in place in format.py, as it
previously was executed in each of the individual processes.

Instead use hasCompileFlag() and add a feature flag for it instead,
which can be used both by tests (that already have such a flag,
locally for one set of tests) and for the testing framework itself.

By using hasCompileFlag(), this also implicitly fixes two other issues:
Previously, _supportsVerify called subprocess.call() directly, which can
interpret command line quoting differently than lit.TestRunner.

(In particular, TestRunner handles arguments quoted by a single quote,
while launching Windows processes with subprocess.call() only supports
double quotes. This allows using shlex.quote(), which uses single quotes,
everywhere - as all commands now go through TestRunner. This should make
41d7909368 redundant.)

Secondly, the old _supportsVerify method didn't include %{flags) or
%{compile_flags}.

Differential Revision: https://reviews.llvm.org/D116010
2021-12-21 19:40:30 +02:00
Louis Dionne d4a69ef841 [libc++][NFC] Bump Dockerfile to get latest nightly Clang 2021-12-20 11:25:08 -05:00
Martin Storsjö 2ec75a0869 [lit] Flush stderr manually on Windows after printing messages
When run in a git bash terminal, sys.stderr isn't flushed implicitly
after printing each line. Manually flush it after each printout,
to avoid getting broken/misordered output.

A similar fix had been done in the old libcxx test config, committed
as part of 7e3ee09ad2 / D28725; this
generalizes the fix, making it available in the new libcxx test
configs too, and for any other test that uses lit_config.note().

Differential Revision: https://reviews.llvm.org/D115761
2021-12-18 21:41:40 +02:00
Nikolas Klauser 17cfc57d14 [libc++] Implement P0798R8 (Monadic operations for std::optional)
Implement P0798R8

Reviewed By: #libc, ldionne, Quuxplusone

Spies: tcanens, Quuxplusone, ldionne, Wmbat, arichardson, Mordante, libcxx-commits

Differential Revision: https://reviews.llvm.org/D113408
2021-12-15 22:49:03 +01:00
Louis Dionne 87fe0709d4 [libc++] Allow detecting whether the executor supports Bash
A few tests in the test suite require support for Bash. For example,
tests that run a program and send data through stdin to it require some
way of piping the data in, and we use a Bash script for that.

However, some executors (e.g. an embedded systems simulator) do not
support Bash, so these tests will fail. This commit adds a Lit feature
that tries to detect whether Bash is available through conventional
means, and disables the tests that require it otherwise.

Differential Revision: https://reviews.llvm.org/D114612
2021-12-14 16:54:13 -05:00
Mark de Wever ade336dee4 Revert "[libc++][ci] Disable generating debug information."
The bug this patch works around prevents D70631 to land.
Remove the work-around since it's no longer needed.
2021-12-08 17:58:51 +01:00
Louis Dionne a6e5563dfa [libc++][release] Do not force building the runtimes with -fPIC
There's a lot of history behind this, so here's a summary:

1. I stopped forcing -fPIC when building the runtimes in 30f305efe2,
   before the LLVM 9 release back in 2019.

2. Someone complained that libc++.a couldn't be used in shared libraries
   built without -fPIC (http://llvm.org/PR43604) since the LLVM 9 release.
   This had been caused by my removal of -fPIC when building libc++.a in (1).

3. I suggested two ways of fixing the issue, the first being to force
   -fPIC back unconditionally (http://llvm.org/D104328), and the second
   being to specify that option explicitly when building the LLVM release
   (http://llvm.org/D104327). We converged on the first solution.

4. I landed D104328, which forced building the runtimes with -fPIC.
   This was included in the LLVM 13.0 release.

5. People complained about that and requested that we be able to
   customize this setting (basically we should have done the second
   solution).

This patch makes it such that the LLVM release script will specifically
ask for building with -fPIC using CMAKE_POSITION_INDEPENDENT_CODE,
however by default the runtimes will not force that option onto users.

This patch has the unintended effect that Clang and the LLVM libraries
(not only the runtime ones like libc++) will also be built with -fPIC
in the release. It would be better if we could specify that -fPIC is to
be used only when building the runtimes, however this is left as a
future improvement. The release should probably be using a bootstrapping
build and passing those options to the stage that builds the runtimes
only, see https://reviews.llvm.org/D112748 for that change.

Differential Revision: https://reviews.llvm.org/D110261
2021-12-08 11:34:35 -05:00
Louis Dionne 9678d25a97 [libc++] Bump Dockerfile 2021-12-08 08:57:24 -05:00
Mircea Trofin 5dda2efde5 Re-Reland "[benchmarks] Move libcxx's fork of google/benchmark and llvm/utils'"
This reverts commit b2fbd45d23. D114922
fixed the reason of the 2nd revert.

This patch also re-applies 39e9f5d368.

Differential Revision: https://reviews.llvm.org/D112012
2021-12-07 17:10:41 -08:00
Louis Dionne e7f53ec78f [libc++] Bump Dockerfile 2021-12-07 07:30:46 -05:00
Mark de Wever 15495be014 [libc++][ci] Disable generating debug information.
In the bootstrap build generating debug information causes an ICE.
This is a work-around for llvm.org/PR52584
2021-12-05 13:22:58 +01:00
David Blaikie 1f2492b7da libcxx pretty printers: remove non-lazy_string fallback
This has been supported on gdb for something like ~10 years, so doesn't
seem necessary to carry a fallback.

Differential Revision: https://reviews.llvm.org/D114986
2021-12-02 14:31:08 -08:00
David Blaikie ff618a963a Simplify the libcxx std::string_view gdb pretty printer
Seems better to rely on the existing formatting, makes the output
smaller/simpler - this is consistent with libstdc++'s std::string_view
pretty printing too.

Differential Revision: https://reviews.llvm.org/D113244
2021-12-02 11:36:38 -08:00
Louis Dionne fa1c077b41 [runtimes] Remove support for GCC-style 32 bit multilib builds
This patch removes the ability to build the runtimes in the 32 bit
multilib configuration, i.e. using -m32. Instead of doing this, one
should cross-compile the runtimes for the appropriate target triple,
like we do for all other triples.

As it stands, -m32 has several issues, which all seem to be related to
the fact that it's not well supported by the operating systems that
libc++ support. The simplest path towards fixing this is to remove
support for the configuration, which is also the best course of action
if there is little interest for keeping that configuration. If there
is a desire to keep this configuration around, we'll need to do some
work to figure out the underlying issues and fix them.

Differential Revision: https://reviews.llvm.org/D114473
2021-12-01 12:57:01 -05:00
Mark de Wever 0e9979affe [libc++][format][1/6] Reduce binary size.
This removes the `format_args_t` from `<format>` and adjusts the type of
the `format_args` for the `vformat_to` overloads.

The `format_context` uses a `back_insert_iterator<string>` therefore the
new `output_iterator` function uses a `string` as its temporary storage
buffer. This isn't ideal. The next patches in this series will improve
this. These improvements make it easy to also improve `format_to_n` and
`formatted_size`.

This addresses P2216 `6. Binary size`.
P2216 `5. Compile-time checks` are not part of this change.

Implements parts of:
- P2216 std::format improvements

Depends on D103670

Reviewed By: ldionne, #libc

Differential Revision: https://reviews.llvm.org/D110494
2021-12-01 17:50:17 +01:00
Louis Dionne 5c454033dd [libc++] Trigger rebuild of the Docker image so we get a new nightly Clang 2021-11-26 12:57:30 -05:00
Louis Dionne f18f9ce366 [libc++] Properly handle errors happening during Lit configuration
Instead of silently swallowing errors that happen during Lit configuration
(for example trying to obtain compiler macros but compiling fails), raise
an exception with some amount of helpful information.

This should avoid the possibility of silently configuring Lit in a bogus
way, and also provides more helpful information when things fail.

Note that this requires a bit more finesse around how we handle some
failing configuration checks that we would previously return None for.

Differential Revision: https://reviews.llvm.org/D114010
2021-11-26 11:03:15 -05:00
Louis Dionne ebfeeec4c4 [libunwind] Fix testing with sanitizers enabled
When testing with sanitizers enabled, we need to link against a plethora
of system libraries. Using `-nodefaultlibs` like we used to breaks this,
and we would have to add all these system libraries manually, which is
not portable and error prone. Instead, stop using `-nodefaultlibs` so
that we get the libraries added by default by the compiler.

The only caveat with this approach is that we are now relying on the
fact that `-L <path-to-local-libunwind>` will cause the just built
libunwind to be selected before the system implementation (either of
libunwind or libgcc_s.so), which is somewhat fragile.

This patch also turns the 32 bit multilib build into a soft failure
since we are in the process of removing it anyway, see D114473 for
details. This patch is incompatible with the 32 bit multilib build
because Ubuntu does not provide a proper libstdc++ for 32 bits, and
that is required when running with sanitizers enabled.

Differential Revision: https://reviews.llvm.org/D114385
2021-11-25 15:28:17 -05:00
Louis Dionne 13fa4fcfe7 [libc++] Tidy up how %T and %t are created during configuration checks
Instead of having ad-hoc cleanup in various places, handle all creation
and removal of temporary files and directories inside _makeConfigTest.

As a fly-by, also remove testPrefix since we don't keep any source file
around anymore. Setting a prefix for the files is hence not useful anymore.

Differential Revision: https://reviews.llvm.org/D114390
2021-11-23 09:51:22 -05:00
Nikolas Klauser 1dc62f2653 [libc++] Implement P1272R4 (std::byteswap)
Implement P1274R4

Reviewed By: Quuxplusone, Mordante, #libc

Spies: jloser, lebedev.ri, mgorny, libcxx-commits, arichardson

Differential Revision: https://reviews.llvm.org/D114074
2021-11-22 01:28:18 +01:00
Arthur O'Dwyer 401b76fdf2 [libc++] [test] Eliminate libcpp-no-noexcept-function-type and libcpp-no-structured-bindings.
At this point, every supported compiler that claims a -std=c++17 mode
should also support these features.

Differential Revision: https://reviews.llvm.org/D113436
2021-11-20 11:44:57 -05:00
Louis Dionne e0f58444e1 [libc++] Fix feature test macro for __cpp_lib_to_chars
We would have been defining it in <utility> instead of <charconv>. For
the time being, this doesn't change anything since we don't implement
the feature test macro anyways.

Also, as a fly-by, this removes obsolete feature test macro tests. There
was a brief time back in the days when we wrote feature test macro tests
manually. In particular, we had test files for __cpp_lib_to_chars and
__cpp_lib_memory_resource. Since we now have a principled way of generating
these tests with scripts, this commit removes the obsolete (and empty)
tests for these two feature test macros.

Differential Revision: https://reviews.llvm.org/D114243
2021-11-19 14:26:34 -05:00
Louis Dionne e1ce3dabf0 [libc++] Fix some tests that were broken in the single-threaded configuration
We never noticed it because our CI doesn't actually build against a C
library that doesn't have threading functionality, however building
against a truly thread-free platform surfaces these issues.

Differential Revision: https://reviews.llvm.org/D114242
2021-11-19 14:24:15 -05:00
Louis Dionne 92832e4889 [libc++] Enable <atomic> when threads are disabled
std::atomic is, for the most part, just a thin veneer on top of compiler
builtins. Hence, it should be available even when threads are not available
on the system, and in fact there has been requests for such support.

This patch:
- Moves __libcpp_thread_poll_with_backoff to its own header so it can
  be used in <atomic> when threads are disabled.
- Adds a dummy backoff policy for atomic polling that doesn't know about
  threads.
- Adjusts the <atomic> feature-test macros so they are provided even when
  threads are disabled.
- Runs the <atomic> tests when threads are disabled.

rdar://77873569

Differential Revision: https://reviews.llvm.org/D114109
2021-11-17 23:02:58 -05:00
Martin Storsjö f5ca3ac748 [libcxx] [ci] Add CI configurations for MinGW
Mention support for MinGW in the docs. Rename the existing windows
CI jobs to Clang-cl, as both Clang-cl and MinGW are equally much
"Windows", just different toolchain environments.

Add an XFAIL for a recently added test that fails in the MinGW DLL
configuration (with an explanation of what's causing the failure).

Differential Revision: https://reviews.llvm.org/D112215
2021-11-17 10:00:50 +02:00
Mircea Trofin b2fbd45d23 Revert "Reland "[benchmarks] Move libcxx's fork of google/benchmark and llvm/utils'"""
This reverts commit 1ee32055ea.

We hit additional bot failures; in particular, Fuchsia's seems to be
related to how CMakeLists are ingested, see https://ci.chromium.org/ui/p/fuchsia/builders/toolchain.ci/clang-linux-x64/b8830380874445931681/overview
2021-11-16 16:35:06 -08:00
Mircea Trofin 1ee32055ea Reland "[benchmarks] Move libcxx's fork of google/benchmark and llvm/utils'""
This reverts commit e7568b68da and relands
c6f7b720ec.

The culprit was: missed that libc also had a dependency on one of the
copies of `google-benchmark`

Also opportunistically fixed indentation from prev. change.

Differential Revision: https://reviews.llvm.org/D112012
2021-11-16 10:33:31 -08:00
Louis Dionne 5c539ea9f0 [libc++] Perform the bootstrapping build before legacy builds in CI
This is to help reduce latency by running longer jobs before shorter ones.
2021-11-16 12:44:22 -05:00
Mircea Trofin e7568b68da Revert "[benchmarks] Move libcxx's fork of google/benchmark and llvm/utils'"
This reverts commit c6f7b720ec.

Some buildbots are failing, will investigate and reland.
Example:
  https://lab.llvm.org/buildbot#builders/138/builds/14067
  https://lab.llvm.org/buildbot#builders/73/builds/20159
2021-11-16 09:28:50 -08:00
Mircea Trofin c6f7b720ec [benchmarks] Move libcxx's fork of google/benchmark and llvm/utils'
under third-party

This change:
- moves the libcxx copy of `google/benchmark` to
`third-party/benchmkark`
- points the 2 uses of the library (libcxx and llvm/utils) to this copy

We picked the licxx copy because it is the most up to date.

Differential Revision: https://reviews.llvm.org/D112012
2021-11-16 09:16:11 -08:00
Matheus Izvekov 35f798d05d
[libcxx] CI: only build native target for bootstrapping-build
Signed-off-by: Matheus Izvekov <mizvekov@gmail.com>

Reviewed By: #libc, ldionne

Differential Revision: https://reviews.llvm.org/D113950
2021-11-16 17:22:30 +01:00
Chuanqi Xu 2e6ae1d3f2 [libcxx] [Coroutine] Conform Coroutine Implementation
Since coroutine is merged in C++ standard and the support for coroutine
seems relatively stable. It's the time to move the implementation of
coroutine out of the experimental directory and the std::experimental
namespace. This patch creates header <coroutine> with conformed
implementation with C++ standard. To avoid breaking user's code too
fast, the <experimental/coroutine> header is remained. Note that
<experimental/coroutine> is deprecated and it would be removed in
LLVM15.

Reviewed By: Quuxplusone, ldionne

Differential Revision: https://reviews.llvm.org/D109433
2021-11-16 14:13:13 +08:00
Alfsonso Gregory f46f93b478 [libc++][NFC] Resolve Python 2 FIXME
We don't use Python 2 anymore, so let us do the recommended fix instead
of using the workaround made for Python 2.

Differential Revision: https://reviews.llvm.org/D107715
2021-11-12 13:55:22 -05:00
Louis Dionne 4e70b50b74 [libc++] Disallow running the libc++ benchmarks in standalone builds
We are trying to remove duplication of third-party code in
https://reviews.llvm.org/D112012, which will move the Google
Benchmark code outside of the `libcxx/` directory. That breaks
running the benchmarks in the Standalone build. Since we have
deprecated the Standalone build anyway, this patch just removes
support for the benchmark in Standalone mode until we remove that
mode entirely.

Differential Revision: https://reviews.llvm.org/D113503
2021-11-11 14:13:36 -05:00
Louis Dionne 3016ceb30d [libc++] Allow running the bootstrapping CI build on Darwin
Instead of hard-coding the target for our CI nodes, use the default
compiler triple. Also, allow building compiler-rt for the single
specified triple in case we're running on Darwin (otherwise, the
bootstrapping build complains).

Differential Revision: https://reviews.llvm.org/D113683
2021-11-11 14:12:34 -05:00
David Tenty 2b416b4647 [libcxx][CI][AIX] Switch to LLVM_ENABLE_RUNTIMES
and to the new `runtimes` top level CMakeLists.txt since the old path is now deprecated. This requires a slight adjustment of the libcxxabi CMake, since there are required macro definitions we previously got via the `llvm/CMakeList.txt` path.

Reviewed By: ldionne, #libc, #libc_abi

Differential Revision: https://reviews.llvm.org/D113403
2021-11-09 16:04:10 -05:00
Arthur O'Dwyer 9a3cb73460 [libc++] [test] Eliminate the libcpp-no-if-constexpr feature flag.
At this point, every supported compiler that claims a -std=c++17 mode
should also support `if constexpr`. This was an issue for GCC 5
and GCC 6, but hasn't been an issue since GCC 7. (Our current
minimum supported GCC version, IIUC, is GCC 10 or 11.)

Differential Revision: https://reviews.llvm.org/D113348
2021-11-08 16:58:47 -05:00
Louis Dionne 1837a837b3 [libc++] Trigger a rebuild of the CI Docker images 2021-11-08 14:34:24 -05:00
David Tenty 28b3cac7cf [libc++][CI] Add AIX pipeline config
This changes adds the pipeline config for both 32-bit and 64-bit AIX targets. As well, we add a lit feature `LIBCXX-AIX-FIXME` which is used to mark the failing tests which remain to be investigated on AIX, so that the CI produces a clean build.

Reviewed By: #libc, ldionne

Differential Revision: https://reviews.llvm.org/D111359
2021-11-08 10:30:27 -05:00
Quinn Pham c71fbdd87b [NFC] Inclusive language: Remove instances of master in URLs
[NFC] This patch fixes URLs containing "master". Old URLs were either broken or
redirecting to the new URL.

Reviewed By: #libc, ldionne, mehdi_amini

Differential Revision: https://reviews.llvm.org/D113186
2021-11-05 08:48:41 -05:00
David Spickett 52615df0f2 [libcxx][utils] Note read only mount and ptrace permission in container script
Reviewed By: ldionne, #libc

Differential Revision: https://reviews.llvm.org/D110938
2021-11-03 10:09:15 +00:00
Louis Dionne 4ee17b71f6 [libc++] Update the CI Docker image to Focal
Differential Revision: https://reviews.llvm.org/D112726
2021-10-28 13:21:09 -04:00
Mark de Wever 04a9a25d7c [libc++][ci] Update to Clang 13.
Per our support plan we should now support Clang 12 and 13. Adjust the
documentation and the CI runners. The change indirectly moves the main
CI runners to use the Clang 14 nightly builds.

Reviewed By: ldionne, #libc

Differential Revision: https://reviews.llvm.org/D112360
2021-10-28 17:37:32 +02:00
Mark de Wever 09dc8ab74c [libc++][doc] Fixes FeatureTestMacroTable.html.
`utils/generate_feature_test_macro_components.py` uses the wrong
indentation. `:name: feature-status-table :widths: auto` is rendered as
text instead of being used by Sphinx to render the table properly.

This fixes the identation in the souce and updates the generated output.

Reviewed By: #libc, ldionne

Differential Revision: https://reviews.llvm.org/D112251
2021-10-22 17:25:43 +02:00
Louis Dionne 3cea2505fd [runtimes] Rename CI job from "Runtimes build" to "Bootstrapping build" 2021-10-20 17:43:55 -04:00
Louis Dionne cbe3b6b21f [libc++] Move LIBCXX-DEBUG-FIXME to params.py
This temporary FIXME really belongs to the testing config, not to the
specific CMake cache that enables that configuration.

Differential Revision: https://reviews.llvm.org/D112031
2021-10-20 09:23:03 -04:00
Louis Dionne a039746e1c [runtimes] Trigger CI on changes to libunwind 2021-10-19 13:16:42 -04:00
Louis Dionne 6fd55bba61 [libunwind] Add a from-scratch config for running libunwind tests
Running tests for libunwind is a lot simpler than running tests for
libc++, so a simple Lit config file is sufficient. The benefit is that
we disentangle the libunwind test configuration from the libc++ and
libc++abi test configuration. The setup was too complicated, which led
to some bugs (notably we were running against the system libunwind on
Apple platforms).

Differential Revision: https://reviews.llvm.org/D111664
2021-10-19 12:03:58 -04:00
Louis Dionne 79175f336c [runtimes] Use the new "runtimes" build by default and deprecate other builds
This commit makes the new "runtimes" build (with <monorepo>/runtimes as
the root of the CMake invocation) the default way of building libc++.
The other supported way of building libc++ is the "bootstrapping" build,
where `<monorepo>/llvm` is used as the root of the CMake invocation.

All other ways of building libc++ are deprecated effective immediately.
There should be no use-case for building libc++ that isn't supported by
one of these two builds, and the two new builds work on all environments
and are lightweight. They will also make it possible to greatly simplify
the build infrastructure of the runtimes, which is currently way too
convoluted.

Differential Revision: https://reviews.llvm.org/D111356
2021-10-18 13:50:26 -04:00
Louis Dionne 25cbf72162 [libc++] Use apple-install-libcxx.sh in the Apple/system CI job
That script is what we (need to) use to build libc++ for the system
configuration, so that's what we should test against. At some point
we may be able to fold all of that logic into the CMake build, and
when that happens the CI can go back to running CMake directly.

As a fly-by fix, stop mentioning x86_64 in the names of the Apple
jobs since they are not truly tied to any architecture.

Differential Revision: https://reviews.llvm.org/D111865
2021-10-15 06:08:25 -04:00
David Tenty 228b3b729d [libc++][AIX] Add scripts and config for building with the libcxx CI infrastructure
This initial change adds the AIX configuration to run-buildbot, an AIX
CMake cache file, and appropriate compiler and linker flags for testing
AIX to the lit "from scratch" configuration files. Either of the 32-bit or 64-bit configurations
can be built by setting `OBJECT_MODE` in the build environment (as is
typical for AIX).

Reviewed By: ldionne, #libc, #libc_abi

Differential Revision: https://reviews.llvm.org/D111244
2021-10-14 14:31:10 -04:00
Louis Dionne d1e0f02e0b [libc++abi][ci] Add a from-scratch config for libc++abi on Apple/system
I came across an issue where since we build the library for Apple with
the install name directory being /usr/lib, which means that if we don't
run the tests with DYLD_LIBRARY_PATH, we'll end up loading the
system-provided libc++abi when running the tests. That wreaks havoc.

Instead of fixing it in the legacy config file, this commit introduces
an Apple libc++abi config file that does the right thing.

Differential Revision: https://reviews.llvm.org/D111279
2021-10-13 08:07:40 -04:00
Louis Dionne f4c1258d56 [libc++] Add an option to disable wide character support in libc++
Some embedded platforms do not wish to support the C library functionality
for handling wchar_t because they have no use for it. It makes sense for
libc++ to work properly on those platforms, so this commit adds a carve-out
of functionality for wchar_t.

Unfortunately, unlike some other carve-outs (e.g. random device), this
patch touches several parts of the library. However, despite the wide
impact of this patch, I still think it is important to support this
configuration since it makes it much simpler to port libc++ to some
embedded platforms.

Differential Revision: https://reviews.llvm.org/D111265
2021-10-12 06:08:23 -04:00
Louis Dionne 980c7f3249 [libc++] Remove the ad-hoc "unified standalone" build
It is not used anywhere anymore since we're using the new runtimes build
in <monorepo>/runtimes now, so we can remove all traces of this build.

Differential Revision: https://reviews.llvm.org/D111351
2021-10-08 10:57:40 -04:00
Louis Dionne 1262f8a64d [libc++] Remove the CI job for Apple/System/Noexceptions
When we recently started using DYLD_LIBRARY_PATH to run the test suite
on the Apple/System configuration of the library, the -fno-exceptions
variant started failing.

It started failing because under that configuration, libc++abi.dylib
doesn't provide support for exceptions. For example, it doesn't provide
some symbols such as ___gxx_personality_v0. Now, the problem is that
when the test suite is run with DYLD_LIBRARY_PATH, /usr/lib/libobjc.dylib
uses the just-built libc++abi.dylib, which doesn't support exceptions,
and we end up with an unresolved reference to ___gxx_personality_v0.

Previously, using -Wl,-rpath,path/to/lib, we would be loading both
/usr/lib/libc++abi.dylib and <just-built>/lib/libc++abi.dylib.
/usr/lib/libobjc.dylib would use the system libc++abi.dylib, which
contains support for exceptions, and the tests would be using the
just-built one, which doesn't.

Disentangling that led me to believe that we shouldn't try to test this
configuration where libc++/libc++abi are built as system libraries, but
where they don't support exceptions, since that just doesn't make any
sense. Doing so is like trying to build libc++/libc++abi and test it as
a system library after performing an ABI break -- of course nothing is
going to work.

For that reason, I am removing this configuration. Note that we could
still test the library on macOS without exceptions if we wanted, only
we wouldn't be building it as a system library. This patch doesn't add
that because we already have a -fno-exceptions CI job on Linux.

Differential Revision: https://reviews.llvm.org/D111349
2021-10-07 17:27:24 -04:00
Louis Dionne c07b80ca53 [libc++] Add a from-scratch testing config for GCC
Differential Revision: https://reviews.llvm.org/D111329
2021-10-07 17:26:25 -04:00
Louis Dionne f6a74908a7 [runtimes] Add tests for vendor-specific properties
Vendors take libc++ and ship it in various ways. Some vendors might
ship it differently from what upstream LLVM does, i.e. the install
location might be different, some ABI properties might differ, etc.

In the past few years, I've come across several instances where
having a place to test some of these properties would have been
incredibly useful. I also just got bitten by the lack of tests
of that kind, so I'm adding some now.

The tests added by this commit for Apple platforms have numerous
TODOs that capture discrepancies between the upstream LLVM CMake
and the slightly-modified build we perform internally to produce
Apple's system libc++. In the future, the goal would be to upstream
all those differences so that it's possible to build a faithful
Apple system libc++ with the upstream LLVM sources only.

But this isn't only useful for Apple - this lays out the path for
any vendor being able to add their own checks (either upstream or
downstream) to libc++.

This is a re-application of 9892d1644f, which was reverted in 138dc27186
because it broke the build. The issue was that we didn't apply the required
changes to libunwind and our CI didn't notice it because we were not
running the libunwind tests. This has been fixed now, and we're running
the libunwind tests in CI now too.

Differential Revision: https://reviews.llvm.org/D110736
2021-10-07 15:46:20 -04:00
David Spickett da59376546 [libcxx][CI] Install all locales used by the test suite
Reviewed By: #libc, ldionne

Differential Revision: https://reviews.llvm.org/D111235
2021-10-07 09:24:17 +01:00
Louis Dionne 19a3e24803 [libc++] Simplify writing testing config files
Reduce code duplication by sharing most of the test suite setup across
the different from-scratch configs.

Differential Revision: https://reviews.llvm.org/D111196
2021-10-06 15:51:02 -04:00
Louis Dionne 60fe1f59d0 [runtimes][ci] Run the tests for libunwind in the CI
We should arguably have always been doing that. The state of libunwind
is quite sad, so this commit adds several XFAILs to make the CI pass.
We need to investigate why so many tests are not passing in some
configurations, but I'll defer that to folks who actually work on
libunwind for lack of bandwidth.

Differential Revision: https://reviews.llvm.org/D110872
2021-10-06 11:25:26 -04:00
Louis Dionne 54a8a0d09a [runtimes] Allow FOO_TEST_CONFIG to be a relative path
That makes it possible to store that value in a CMake cache if needed.

Differential Revision: https://reviews.llvm.org/D110843
2021-10-05 19:45:50 -04:00
Louis Dionne 7c9d9e4e64 [libc++] Run the no-unicode CI job on new testing configs
This was most likely an oversight, since we're running all other jobs on
the new configs.

Differential Revision: https://reviews.llvm.org/D111168
2021-10-05 16:55:31 -04:00
Louis Dionne f800560ff1 [libc++] Rename the 'libc++' Lit feature to 'llvm-libc++'
This is to simplify an upcoming change where we distinguish between
flavors of libc++ by adding an apple-libc++ Lit feature.

Differential Revision: https://reviews.llvm.org/D110870
2021-10-04 18:32:50 -04:00
Louis Dionne 45395775c1 [libc++] Disable the Apple system -fno-exceptions CI that is currently building
I'm disabling it to avoid blocking everybody until I've fixed the issue.
2021-10-04 14:58:30 -04:00
Louis Dionne 2e93453114 [libc++][NFC] Remove header name from <version> 2021-10-04 13:34:26 -04:00
Arthur O'Dwyer 2a6b99d5f8 [libc++] Revert the part of my b82683b that affected <version>.
This reverts part of commit b82683b2eb.
I hadn't intended to remove the `// -*- C++ -*-` comment line
from `libcxx/include/version`, only from the generated tests.
Thanks to Raul Tambre for the catch.
2021-10-01 13:01:51 -04:00
Arthur O'Dwyer b82683b2eb [libc++] [test] Remove "// -*- C++ -*-" comments from generated .cpp files.
Even if these comments have a benefit in .h files (for editors that
care about language but can't be configured to treat .h as C++ code),
they certainly have no benefit for files with the .cpp extension.

Discussed in D110794.
2021-10-01 12:04:19 -04:00
David Spickett 81d2cea690 Revert "[libcxx][test] Use python specified by build rather than system default python"
This reverts commit 9f641c96cb.

The "python" command in gdb uses the python gdb is linked to,
not what "python" would give you if you used it directly in the shell.
2021-10-01 09:45:44 +00:00
Leonard Chan 9f641c96cb [libcxx][test] Use python specified by build rather than system default python
As of e9564c3698, libcxx/gdb/gdb_pretty_printer_test.sh.cpp
fails locally for me because the REQUIRES check for host-has-gdb-with-python
uses python, which for me expands to python 2.7.18. This failure does not seem
to be caught on any upstream builders, potentially because they don't have gdb,
python, or a version of python that makes the test UNSUPPORTED (like python3).

This updates the check to use the python specified by the build (which should
be the python that runs this code), rather than just python.

Differential Revision: https://reviews.llvm.org/D110887
2021-09-30 15:34:30 -07:00
Haowei Wu 138dc27186 Revert "[libc++][libc++abi] Add tests for vendor-specific properties"
This reverts commit 9892d1644f, which
causes clang test failures in libcxx tests.
2021-09-30 11:03:59 -07:00
Louis Dionne 981b12fe89 [libc++][NFC] Remove stray whitespace 2021-09-30 12:18:47 -04:00
Louis Dionne c15bbdeaff [libc++] Add a testing configuration specific to Apple's libc++
Apple's libc++ has a few differences with the LLVM libc++, and it is
necessary to use a custom configuration file to test it properly.

Differential Revision: https://reviews.llvm.org/D110777
2021-09-30 10:51:13 -04:00
Louis Dionne 56cd2f93e0 [libc++] Fix missed rename of libcxx-trunk-shared.cfg.in
There was a race condition between the application of 565d45541f
and the application of 0c874382b9, which led to the latter missing
some occurences.
2021-09-29 18:06:37 -04:00
Louis Dionne 0c874382b9 [libc++] Rename testing configurations to match Lit stdlib= parameter
To reduce confusion, this commit makes sure that the name of the testing
configurations match the convention used for the stdlib= Lit parameter,
since those effectively correspond to each other.
2021-09-29 17:23:29 -04:00
Louis Dionne 9892d1644f [libc++][libc++abi] Add tests for vendor-specific properties
Vendors take libc++ and ship it in various ways. Some vendors might
ship it differently from what upstream LLVM does, i.e. the install
location might be different, some ABI properties might differ, etc.

In the past few years, I've come across several instances where
having a place to test some of these properties would have been
incredibly useful. I also just got bitten by the lack of tests
of that kind, so I'm adding some now.

The tests added by this commit for Apple platforms have numerous
TODOs that capture discrepancies between the upstream LLVM CMake
and the slightly-modified build we perform internally to produce
Apple's system libc++. In the future, the goal would be to upstream
all those differences so that it's possible to build a faithful
Apple system libc++ with the upstream LLVM sources only.

But this isn't only useful for Apple - this lays out the path for
any vendor being able to add their own checks (either upstream or
downstream) to libc++.

Differential Revision: https://reviews.llvm.org/D110736
2021-09-29 17:22:37 -04:00
Louis Dionne b852013dd7 [libc++][ci] Run alternative builds earlier to reduce latency
The Runtimes build is by far our longest CI configuration, so it makes
sense to run it earlier during CI. For consistency, move all the other
jobs from that "section" too.
2021-09-29 17:16:30 -04:00
Martin Storsjö 565d45541f [libcxx] Add a CI configuration for standalone building in llvm-project/runtimes
Generate the llvm-lit script in runtimes/CmakeFiles.txt unless invoked
from llvm/runtimes.

Differential Revision: https://reviews.llvm.org/D109593
2021-09-29 21:37:28 +03:00
Louis Dionne 87b4490b3c [libc++][NFC] Reorganize CI jobs into commented sections 2021-09-29 13:43:52 -04:00
Louis Dionne d486c5b117 [libc++] Clarify the name of Lit features related to standard library selection
Before this patch, we had features named 'libc++', 'libstdc++' and
'msvc' to describe the three implementations that use our test suite.
This patch renames them to 'stdlib=libc++', 'stdlib=libstdc++', etc
to avoid confusion between MSVC's STL and the MSVC compiler (or Clang
in MSVC mode).

Furthermore, this prepares the terrain for adding support for additional
"implementations" to the test suite. Basically, I'd like to be able to
treat Apple's libc++ differently from LLVM's libc++ for the purpose of
testing, because those effectively behave in different ways in some aspects.
2021-09-28 16:15:25 -04:00
David Spickett 5efafc3e65 Revert "[libcxx][pretty printers] Import gdb module in gdb feature check"
This reverts commit 0c2a454845.

This was my mistake. When gdb can find its data directory it'll
import it automatically. If it can't (like when you're using a
version from a build folder) you need to give it the data
directory path.

We're safe to assume gdb is installed for testing purposes
so it'll import it for us.
2021-09-24 09:11:28 +00:00
David Spickett 0c2a454845 [libcxx][pretty printers] Import gdb module in gdb feature check
Earlier versions of GDB do not do this automatically.
(from my checks 8.3 does not and 9.2 does)
2021-09-24 09:04:44 +00:00
David Spickett 0a36c72dee [libcxx][pretty printers] Check GDB Python scripting support
I found this after upgrading from Ubuntu bionic (gdb 8.1.1) to
Focal (gdb 9.2). (where this test fails, but that's for a
different patch)

9.2 allows you to set breakpoint commands from
Python, which was added in 8.3.
(bintutils a913fffbdee21fdd50e8de0596358be425775678
"Allow breakpoint commands to be set from Python")

The reason this test never failed before was because it did so
silently. "source <python file>" doesn't fail even if that script
raises an Exception.

To fix this extend the gdb lit feature to check that:
* gdb exists
* has Python support
* allows you to set breakpoint commands

Reviewed By: #libc, ldionne

Differential Revision: https://reviews.llvm.org/D110334
2021-09-24 08:32:11 +00:00
Louis Dionne b1fb3d75c9 [libc++] Implement C++20's P0476R2: std::bit_cast
Thanks to Arthur O'Dwyer for fixing up some of the tests.

Differential Revision: https://reviews.llvm.org/D75960
2021-09-09 11:05:54 -04:00
Louis Dionne 3765d284c4 [libc++] Provide a way to trigger rebuild of Docker images in the CI 2021-09-09 09:59:44 -04:00
Louis Dionne d61ec93ff2 [libc++] Move additional build bots to the from-scratch config
Once all the bots are passing with from-scratch configs, we can attempt
to make the from-scratch config the default configuration.

Differential Revision: https://reviews.llvm.org/D103417
2021-09-09 09:14:43 -04:00
Louis Dionne 8660b89c0c [libc++] Clean up the no-unicode CI job
It was added after we changed the way the CI jobs are run, in particular
how they are pinned down to Linux instances only. As a result, the job
would sometimes run on Mac machines, which we're trying to keep only for
jobs that absolutely need it due to capacity concerns.
2021-09-09 08:39:30 -04:00
Vladimir Vereschaka 621e437e03 [libc++] Provide 'buildhost=<platform> feature for the tests.
The target platform could differ from the host platform for the cross
platform builds. Some tests are depended on the build host features and
they need to determine a proper platform environment.

This commit adds a build host platform name feature for the libc++ tests
in format `buildhost=<platform>`, such as `buildhost=linux`, `buildhost=darwin`,
`buildhost=windows`, etc.

The Windows host gets two features: one `buildhost=windows` and another based
on Windows "sub-system", such as `buildhost=win32`, `buildhost=cygwin`, etc.

Differential Revision: https://reviews.llvm.org/D102045
2021-09-07 11:49:53 -04:00
Mark de Wever df2af9936c [libc++][format] Add a CMake Unicode option.
This option is used to select between the format headers output column
width option. This option should be independent of the locale setting.
It's encouraged to default to Unicode unless the platform doesn't offer
that option.

[format.string.std]/10
```
  For the purposes of width computation, a string is assumed to be in a
  locale-independent, implementation-defined encoding. Implementations
  should use a Unicode encoding on platforms capable of displaying Unicode
```

Reviewed By: #libc, ldionne, vitaut

Differential Revision: https://reviews.llvm.org/D103379
2021-09-04 11:55:10 +02:00
Louis Dionne 87dd51983c [libc++] Remove support for CloudABI, which has been abandoned
Based on https://github.com/NuxiNL/cloudlibc, it appears that the CloudABI
project has been abandoned. This patch removes a bunch of CloudABI specific
logic that had been added to support that platform.

Note that some knobs like LIBCXX_ENABLE_STDIN and LIBCXX_ENABLE_STDOUT
coud be useful in their own right, however those are currently broken.
If we want to re-add such knobs in the future, we can do it like we've
done it for localization & friends so that we can officially support
that configuration.

Differential Revision: https://reviews.llvm.org/D108637
2021-08-24 14:11:32 -04:00
Louis Dionne 0166690401 [libc++] Remove workarounds for the lack of deduction guides in C++17
All supported compilers have supported deduction guides in C++17 for a
while, so this isn't necessary anymore.

Differential Revision: https://reviews.llvm.org/D108213
2021-08-18 08:57:25 -04:00
Dan Albert d42be2d63c Remove unused imports. 2021-08-17 13:04:02 -07:00
Louis Dionne dc0d4b97a2 [libc++] Update the version of CMake in the Docker image 2021-08-17 13:35:57 -04:00
Louis Dionne b408bbbf5b [libc++] Avoid conflating stderr and stdout in the DSL
This is a workaround until https://reviews.llvm.org/D81892 is merged
and the internal Lit shell stops conflating error output with normal
output. Without this, any program that writes to stderr will trip up
the programOutput function, because it will pick up the '# command stderr:'
string and think it's part of the command's stdout.

rdar://81056048

Differential Revision: https://reviews.llvm.org/D107912
2021-08-11 17:06:56 -04:00
Louis Dionne 7c81024a06 [libc++] Remove workarounds for missing __builtin_addressof
All supported compilers implement __builtin_addressof. Even MSVC implements
addressof as a simple call to __builtin_addressof, so it would work if we
were to port libc++ to that compiler.

Differential Revision: https://reviews.llvm.org/D107905
2021-08-11 17:05:12 -04:00
Louis Dionne 15071d2945 [libc++] Remove _LIBCPP_HAS_UNIQUE_OBJECT_REPRESENTATIONS
All supported compilers have implemented __has_unique_object_representations
for a while, so it's reasonable to remove the workaround.

Differential Revision: https://reviews.llvm.org/D107834
2021-08-11 10:11:40 -04:00
Louis Dionne 7be03cc782 [libc++] Remove _LIBCPP_HAS_NO_IS_AGGREGATE
All supported compilers have been supporting __is_aggregate for a long
time now, so it's reasonable to remove this workaround.

Differential Revision: https://reviews.llvm.org/D107833
2021-08-11 10:10:53 -04:00
Mark de Wever 1123100a16 [libcxx] Remove _LIBCPP_HAS_NO_BUILTIN_IS_CONSTANT_EVALUATED
All supported compilers should support
_LIBCPP_HAS_NO_BUILTIN_IS_CONSTANT_EVALUATED so this can be removed.

Reviewed By: ldionne, #libc, Quuxplusone

Differential Revision: https://reviews.llvm.org/D107239
2021-08-10 18:59:55 +02:00
Louis Dionne d232ec3c2a [libc++] Add timeout to BuildKite jobs
We just had a case where a build bot stalled in an infinite loop during
testing, and the whole pipeline got stuck. To avoid that from happening
in the future, use a timeout on BuildKite jobs.

Differential Revision: https://reviews.llvm.org/D107765
2021-08-09 15:31:04 -04:00
David Spickett e517a2405f Revert "[libcxx][CI] Work around Arm buildkite failures"
This reverts commit f8bef47348.

Buildkite agent 3.32.0 includes a fix for the PATH issue.
https://github.com/buildkite/agent/releases/tag/v3.32.0

Differential Revision: https://reviews.llvm.org/D107172
2021-08-02 09:32:08 +01:00
Louis Dionne 9efffe8278 [libc++][NFC] Make private header generation CMake comment more consistent 2021-07-29 14:17:04 -04:00
Arthur O'Dwyer 20c6ddc5bc [libc++] Remove unused variables in generate_private_header_tests.py. NFCI. 2021-07-28 22:28:25 -04:00
Mark de Wever 71909de374 [libc++] Disable incomplete library features.
Adds a new CMake option to disable the usage of incomplete headers.
These incomplete headers are not guaranteed to be ABI stable. This
option is intended to be used by vendors so they can avoid their users
from code that's not ready for production usage.

The option is enabled by default.

Differential Revision: https://reviews.llvm.org/D106763
2021-07-27 22:37:35 +02:00
Louis Dionne 45478619e3 [libc++] CI: Run -std=c++03 on Clang ToT
Differential Revision: https://reviews.llvm.org/D106104
2021-07-27 14:13:28 -04:00
Louis Dionne 496a3815f4 [libc++] NFC: Try to trigger Docker image rebuild on CI nodes 2021-07-27 10:02:00 -04:00
Louis Dionne 069428b6f7 [libc++] Set the target triple by default in the standalone build
Even though the standalone build is deprecated, some people are still
relying on it (including libc++ itself for some configurations). Setting
the target triple will ensure that the build and the test suite behaves
consistently in the standalone and normal builds.

Differential Revision: https://reviews.llvm.org/D106800
2021-07-26 15:04:45 -04:00
Mark de Wever 1139fd4270 [libc++][ci] Detect not committed generated files.
The Generated output CI job only tests for modified files. This job
should also fail the generated output contains new files.

It would be possible to test modified and untracked files in one
execution of `git ls-files`. However the diff is stored as an artifact
so the execution of `git diff` would still be required.

Discussion: Would it be better to do `git ls-files -om` and remove the
excution of
`! grep -q '^--- a' ${BUILD_DIR}/generated_output.patch || false` ?
(Obviously then the name `generated_output.untracked` should change to
something like `generated_output.status`)

Reviewed By: #libc, ldionne

Differential Revision: https://reviews.llvm.org/D106534
2021-07-26 16:41:57 +02:00
Louis Dionne 9333d34b8a [libc++] Disable #pragma system_header in the new testing configuration
The new testing configuration did not turn off #pragma system_header,
which means we were not seeing warnings in system headers.

Differential Revision: https://reviews.llvm.org/D106187
2021-07-19 14:38:24 -04:00
Christopher Di Bella e37bbfe59c [libcxx][modules] protects users from relying on libc++ detail headers (1/n)
libc++ has started splicing standard library headers into much more
fine-grained content for maintainability. It's very likely that outdated
and naive tooling (some of which is outside of LLVM's scope) will
suggest users include things such as `<__algorithm/find.h>` instead of
`<algorithm>`, and Hyrum's law suggests that users will eventually begin
to rely on this without the help of tooling. As such, this commit
intends to protect users from themselves, by making it a hard error for
anyone outside of the standard library to include libc++ detail headers.

This is the first of four patches. Patch #2 will solve the problem for
pre-processor `#include`s; patches #3 and #4 will solve the problem for
`<__tree>` and `<__hash_table>` (since I've never touched the test cases
that are failing for these two, I want to split them out into their own
commits to be extra careful). Patch #5 will concern itself with
`<__threading_support>`, which intersects with libcxxabi (which I know
even less about).

Differential Revision: https://reviews.llvm.org/D105932
2021-07-16 22:39:18 +00:00
Louis Dionne fbc3e69f58 [libc++] ci: Create ~/Library/LaunchAgents if it does not exist yet 2021-07-16 11:48:10 -04:00
Louis Dionne 18e21e6832 [libc++] CI: Setup BuildKite agents through launchd
This makes sure that even if a node goes down, the BuildKite agent will
be started again when it goes back up.
2021-07-16 11:40:08 -04:00
Louis Dionne 851a335b1e [libc++] Add a job running GCC with C++11
This configuration is interesting because GCC has a different level of
strictness for some C++ rules. In particular, it implements the older
standards more stringently than Clang, which can help find places where
we are non-conforming (especially in the test suite).

Differential Revision: https://reviews.llvm.org/D105936
2021-07-15 22:13:03 -04:00
Louis Dionne 8fb47456a3 [libc++/abi] Fix broken Lit feature no-noexcept-function-type
The feature was always defined, which means that the two test cases
guarded by it were never run.

Differential Revision: https://reviews.llvm.org/D106062
2021-07-15 14:42:07 -04:00