Commit Graph

7044 Commits

Author SHA1 Message Date
Louis Dionne 4d79ef814a Allow running back-deployment testing against libc++abi
Summary:
Before this patch, we could only link against the back-deployment libc++abi
dylib. This patch allows linking against the just-built libc++abi, but
running against the back-deployment one -- just like we do for libc++.

Also, add XFAIL markup to flag expected errors.
2020-11-06 08:12:46 -05:00
Louis Dionne 75b6726b57 [libc++] Also allow customizing the build directory when running CI 2020-11-05 19:10:08 -05:00
Louis Dionne 3790e17f46 [libc++] Allow customizing a few paths when running build bots
This allows reusing run-buildbot for downstream testing as well.
2020-11-05 19:02:32 -05:00
Louis Dionne bb43a0cd4a [libc++] Add a Buildkite job that tests back-deployment on Apple
The current way we test this is pretty cheap, i.e. we download previously
released macOS dylibs and run against that. Ideally, we would require a
full host running the appropriate version of macOS, and we'd execute the
tests using SSH on that host. But since we don't have such hosts available
easily for now, this is better than nothing.

At the same time, also fix some tests that were failing when back
deploying.

Differential Revision: https://reviews.llvm.org/D90869
2020-11-05 18:26:08 -05:00
Louis Dionne f7e4f041d6 [libc++] Add a CI job to build the documentation
At the same time, fix an issue that broke the documentation since 2eadbc8614.
2020-11-05 15:33:09 -05:00
Louis Dionne 738d981eb6 [libc++] Update the CI Dockerfile
Remove Phabricator, which isn't needed anymore since we don't report
the job results ourselves. Also, install python3-sphinx instead of
sphinx-doc, since the latter doesn't provide the sphinx-build binary.
2020-11-05 15:33:09 -05:00
Louis Dionne 2eadbc8614 [libc++] Rework the whole availability markup implementation
Currently, vendor-specific availability markup is enabled by default.
This means that even when building against trunk libc++, the headers
will by default prevent you from using some features that were not
released in the dylib on your target platform. This is a source of
frustration since people building libc++ from sources are usually not
trying to use some vendor's released dylib.

For that reason, I've been thinking for a long time that availability
annotations should be off by default, which is the primary change that
this commit enables.

In addition, it reworks the implementation to make it easier for new
vendors to add availability annotations for their platform, and it
refreshes the documentation to reflect the current state of the codebase.

Finally, a CMake configuration option is added to control whether
availability annotations should be turned on for the flavor of libc++
being created. The intent is for vendors like Apple to turn it on, and
for the upstream libc++ to leave it off (the default).

Differential Revision: https://reviews.llvm.org/D90843
2020-11-05 12:28:52 -05:00
Louis Dionne 0e61d02c05 [libc++] Correct XFAILs for the C++20 Synchronization Library
Technically, these tests don't only fail against macosx10.9 to 10.15,
but really against any released macOS yet.
2020-11-05 08:45:57 -05:00
Arthur O'Dwyer 418de7d5d8 Fix UB in one libcxx test, when deleting D through a pointer to B.
This undefined behavior was found by applying Lénárd Szolnoki's proposal
to disable implicit conversion of default_delete<D> to default_delete<B>.

The offending part of the test is circa line 243.

The wording that makes it undefined behavior is http://eel.is/c++draft/expr.delete#3 .

Differential Revision: https://reviews.llvm.org/D90536
2020-11-04 17:34:05 -05:00
Louis Dionne 8e01749bb1 [libc++] Remove stray setting of use_system_cxx_lib left behind 2020-11-04 15:01:59 -05:00
Louis Dionne 70eb30cc81 [libc++] Move availability-related Lit configuration to the DSL
The implementation is not really satisfactory, but it's better than
being in the legacy config, which causes other issues.
2020-11-04 14:56:08 -05:00
Steven Wan 09f2c92e5b Add info about the cherry-picked commit and contributor 2020-11-04 14:23:27 -05:00
Steven Wan 296c2f31f0 [PowerPC] Rename mftbl to mftb
`mftb` and `mftbl` are equivalent, there is no need to have two names for doing the same thing, rename `mftbl` to only have `mftb`.

Differential Revision: https://reviews.llvm.org/D89506
2020-11-04 14:23:27 -05:00
Louis Dionne 0df0d0fe2d [libc++] NFC: Remove trailing whitespace 2020-11-04 14:08:06 -05:00
Louis Dionne 6706342f48 [libc++] Remove the ability to not install the support headers
Those are part of the library, and shipping them just adds a tiny bit of
size to the distribution. This was originally added in b422ecc7de to
make it possible to match the Makefile build, which doesn't exist anymore.

The upside is build system simplification.
2020-11-04 11:45:34 -05:00
Louis Dionne 9d58dab6f6 [libc++] Split off part of a test that require signals into a separate test
This will allow running the basic test on all platforms, and the part that
requires signals on platforms that support them only.
2020-11-04 11:20:47 -05:00
Louis Dionne 2dec36e532 [libc++] NFCI: Refactor chrono.cpp to make it easier to support new platforms
Also simplify a few conditionals along the way for readability.
2020-11-04 10:23:36 -05:00
Louis Dionne bbd15062d2 [libc++] Remove test that is irrelevant since f1a96de1bc
We don't want to give the impression that we allow running arbitrary
shell commands under %{exec}, which isn't the case.
2020-11-04 08:47:48 -05:00
Louis Dionne f1a96de1bc [libc++] Don't run tests in a shell in the default executor 2020-11-04 08:29:05 -05:00
zoecarver e2b6987204 [libc++][NFC] Mark LWG issue 2899 as not complete.
Commit 59e26308e6 accidentally
marked this LWG issue as complete but it has not yet been
implemented. D66262 fixes this issue.
2020-11-03 13:35:12 -08:00
Louis Dionne 8e5156f6b0 [libc++] Harden tests against executors not running tests in a shell
Some executors do not run the tests in a shell, and so assuming that
they can understand shell builtins is wrong. Instead, call Bash
directly to do what we need to do.

This still requires the executor to be able to run Bash, but at least
it does not require it to interpret command lines in the Bash language.
2020-11-03 16:03:20 -05:00
Louis Dionne 5369d8cca7 [libc++] Remove support for .run.fail.cpp tests
Unfortunately, executing these tests correctly on platforms that do not
support a shell is very challenging. Since the executor can't just negate
the result of the command, we'd have to ship a portable program capable
of running the actual test executable, and negating its result.

Doing this portably is challenging. Since we do not currently have strong
use cases for tests that fail at runtime (we effectively have no tests
using that capability right now), it is difficult to justify making them
work portably. Instead, it makes more sense to remove this feature until
we can implement it properly (i.e. without requiring shell support).
2020-11-03 15:40:24 -05:00
Louis Dionne d1217be43f [libc++] NFC: Simplify how we run config tests
We can use the convenience substitutions provided by the format instead
of bootstrapping our own.
2020-11-03 14:59:41 -05:00
Louis Dionne d9a4f936d0 [libc++] Move <memory> helpers outside of std::allocator_traits
They don't really belong as members of allocator_traits.
2020-11-03 12:27:26 -05:00
Martin Storsjö 1127ef789c [libcxx] Error out if __libcpp_mbsrtowcs_l fails in __time_get_storage
If __libcpp_mbsrtowcs_l outputs zero wchar_t's for week days or
month names (due to errors in the locale function setup), these are
matched all the time in __time_get_storage::__analyze, ending up in
an infinite loop, allocating more memory until killed.

Differential Revision: https://reviews.llvm.org/D69553
2020-11-03 17:15:05 +02:00
Martin Storsjö 8a73aa8c4c [libcxx] [libcxxabi] Set flags for visibility when statically linking libcxxabi into libcxx for windows
Previously, these had to be set manually when building each of the
projects standalone, in order to get proper symbol visibility when
combining the two libraries.

Differential Revision: https://reviews.llvm.org/D90021
2020-11-03 17:13:48 +02:00
Martin Storsjö 529ba612b0 [libcxx] [test] Use error_code::default_error_condition to check errors against the expected codes
error_code returned from functions might not be of the generic category,
but of the system category, which can have different error code values.
Use default_error_condition() to remap errors to the generic category
where possible, to allow comparing them to the expected values.

Use the ErrorIs() helper instead of a direct comparison against
an excpected value.

Differential Revision: https://reviews.llvm.org/D90602
2020-11-03 09:32:52 +02:00
Martin Storsjö 08b4cc5e0d [libcxx] Avoid double frees of file descriptors in the fallback ifstream/ofstream codepath
So far, most actual uses of libc++ std::filesystem probably use
the sendfile or fcopyfile implementations.

Differential Revision: https://reviews.llvm.org/D90601
2020-11-03 09:32:52 +02:00
Martin Storsjö 11987248c8 [libcxx] [test] Create symlink_to_dir as the right kind, as a directory symlink
This was missed in 5c39eebc12.

Differential Revision: https://reviews.llvm.org/D90600
2020-11-03 09:32:52 +02:00
Martin Storsjö 22e5ee0eef [libcxx] [test] Avoid an unused variable in non-libcpp cases in path.append
Differential Revision: https://reviews.llvm.org/D89947
2020-11-03 09:32:52 +02:00
Martin Storsjö 321f696920 [libcxx] [test] Fix the fs.op.absolute test to cope with windows paths
Prepend the root path on the already_absolute testcase, and construct
a path ending with the preferred separator for the test reference for
"foo/".

Differential Revision: https://reviews.llvm.org/D89944
2020-11-03 09:32:52 +02:00
Louis Dionne 5a829ef6ad [libc++] Fix invalid parsing of ints in a <random> test
The strings were concatenated together without adding spaces between
numbers, which lead to numbers that wouldn't fit in an unsigned int.

Thanks to Casey Carter for the find.
2020-11-02 19:20:59 -05:00
Louis Dionne d6e2bac195 [libc++] Migrate warning flags to the DSL
This makes us closer to running the test suite on platforms where the
legacy test suite configuration doesn't work.

One notable change after this commit is that the tests will be run with
warnings enabled on GCC too, which wasn't the case before. However,
previous commits should have tweaked the test suite to make sure it
passes with warnings enabled on GCC.

Note that warnings can still be disabled with `--param enable_warnings=False`,
as before.

Differential Revision: https://reviews.llvm.org/D90432
2020-11-02 12:25:05 -05:00
Louis Dionne 6b2de7c53a [libc++][CI] Allow retries in case an agent is lost
We see this fairly often on our Linux bots, which appear to be killed
by GCE from time to time.
2020-11-02 11:58:45 -05:00
Louis Dionne 2ca4406de8 [libc++] NFC: Re-generate the ABI lists with the new script
The new script keeps the results sorted, which is why the ABI lists appear
to have changed so much. However, this commit makes no actual ABI change.
2020-11-02 11:36:35 -05:00
Louis Dionne b128373eb8 [libc++] Make it easier to re-generate the ABI lists
Instead of having to remember the command-line to use every time, this
commit adds a CMake target to generate the ABI list in the current
configuration, if it is supported.

As a fly-by change, remove scripts that are now unused (sym_match.py
and sym_extract.py).
2020-11-02 11:36:35 -05:00
Louis Dionne 1b2fa6e46e [libc++/libc++abi] Use Python3_EXECUTABLE consistently to run utilities 2020-11-02 11:07:31 -05:00
Louis Dionne c6eaa14e11 [libc++] Split off iostreams explicit instantiations into its own source file
This makes it cleaner to add more instantiations without cluttering the
actual implementation of ios.
2020-11-02 10:36:34 -05:00
Louis Dionne ca62b8673b [libc++] NFC: Remove warning about non-void function returning void 2020-11-02 08:25:44 -05:00
Nico Weber 8954fd436c [libcxx] Fix regression where `ninja all` doesn't copy libcxx headers
Before 6db314e86b, when running cmake with clang, libcxx, and
compiler-rt enabled, building `ninja all` would run the
generate-cxx-headers target, due to the sanitizers depending on it.

After 6db314e86b, if LIBCXX_ENABLE_SHARED and LIBCXX_ENABLE_STATIC
and LIBCXX_INCLUDE_TESTS and LIBCXX_ENABLE_EXPERIMENTAL_LIBRARY are
disabled (https://reviews.llvm.org/D82702#2153627), `ninja all`
no longer copies the libcxx headers, which means clang can't compile
programs like `#include <string>` on macOS.

Explicitly add the copy target to the all target to restore the old
behavior.
2020-11-01 21:34:51 -05:00
Louis Dionne 81b6aa0e27 [libc++] Fix tests failing with Clang after removing GCC warnings 2020-10-30 14:56:12 -04:00
Louis Dionne 4dfe014a12 [libc++] Add -Wno-sized-deallocation to avoid spurious GCC warnings
GCC tries to be nice and tell us that we probably want to also implement
sized deallocation functions when we override the normal ones. However,
we know what we're doing in the test suite and don't want to override
them.
2020-10-30 12:51:07 -04:00
Louis Dionne c479e0c994 [libc++] NFC: Fix several GCC warnings in the test suite
- Several -Wshadow warnings
- Several places where we did not initialize our base class explicitly
- Unused variable warnings
- Some tautological comparisons
- Some places where we'd pass null arguments to functions expecting
  non-null (in unevaluated contexts)
- Add a few pragmas to turn off spurious warnings
- Fix warnings about declarations that don't declare anything
- Properly disable deprecation warnings in ext/ tests (the pragmas we
  were using didn't work on GCC)
- Disable include_as_c.sh.cpp because GCC complains about C++ flags
  when compiling as C. I couldn't find a way to fix this one properly,
  so I'm disabling the test. This isn't great, but at least we'll be
  able to enable warnings in the whole test suite with GCC.
2020-10-30 12:48:05 -04:00
Louis Dionne d085697013 [libc++] Add a new concept of ConfigAction, and use it in the DSL
This will allow adding bare compiler flags through the new
configuration DSL. Previously, this would have required adding
a Lit feature for each such flag.

Differential Revision: https://reviews.llvm.org/D90429
2020-10-30 09:27:15 -04:00
Louis Dionne bffdc241a6 [libc++] Minor cleanup in the test suite 2020-10-29 13:58:02 -04:00
Louis Dionne bd8884f05e [libc++] Remove additional uses of std::rand() missed by 63aeadb484 2020-10-29 11:11:29 -04:00
Marek Kurdej 6648414b2b [libcxx] [docs] [NFC] Fix typo. 2020-10-29 14:39:09 +01:00
Daniel Kiss fd1c064845 [libcxx] Add targets to available features.
This patch add the target-* (x86_64-*) as used elsewhere in llvm.

Reviewed By: #libc, #libc_abi, ldionne

Differential Revision: https://reviews.llvm.org/D88027
2020-10-29 14:04:11 +01:00
Michael Park 35d2269111 [libc++] Re-apply the switch-based std::variant implementation
This commit is a mass re-application of the following commits:

  7d15ece79c
  e0ec7a0206
  02197f7e50
  a175a96517

Those were temporarily reverted in 057028ed39, and never re-applied.
Re-committed by @ldionne (author edited for credit).

Differential Revision: https://reviews.llvm.org/D90168
2020-10-28 17:09:11 -04:00
YAMAMOTO Takashi acd7be74ca [libc++] Fix a few warnings
Found during a NuttX porting effort.
But these changes are not directly relevant to NuttX.

Differential Revision: https://reviews.llvm.org/D90139
2020-10-28 15:41:10 -04:00
Louis Dionne 63aeadb484 [libc++] Refactor tests to remove uses of std::rand()
This allows running these tests on systems that do not support std::rand().
2020-10-28 15:22:51 -04:00
Louis Dionne 91336a0c61 [libc++] Move the #error message for no localization to <locale.h>
<locale.h> is lower level than <__locale>, so that's where we want the
error to live for systems that don't provide localization support.
2020-10-28 09:49:37 -04:00
Louis Dionne 201184b30b [libc++] Remove <clocale> from some system_error tests
The explicit call to `std::setlocale(LC_ALL, "C")` isn't required, since
the Standard already says the equivalent of this call is performed on
program startup.
2020-10-28 09:49:36 -04:00
Martin Storsjö 70bba9ef35 [libcxx] Don't truncate intermediates to wchar_t when widening
On windows, wchar_t is 16 bit, while we might be widening chars to
char32_t.

This cast had been present since the initial commit, and removing it
doesn't seem to make any tests fail.

Differential Revision: https://reviews.llvm.org/D90228
2020-10-27 23:58:27 +02:00
Louis Dionne 2089e762d0 [libc++] Try to fix cross-loading of lit.local.cfg on Windows
On windows, the previous path replacement using forward slashes wouldn't
work, and so we'd end up including the same file again. We would do that
until we'd hit the recursion limit of the Python interpreter.

Instead, use `os.path` to properly replace without assuming a specific
path separator.
2020-10-27 16:28:29 -04:00
Louis Dionne c56bbb3961 [libc++] Make sure we include a header when checking compiler macros
Otherwise, it's possible for some __config_site macros not to be
picked up.
2020-10-27 15:58:43 -04:00
Louis Dionne 88ffc72717 [libc++] Add a libc++ configuration that does not support localization
When porting libc++ to embedded systems, it can be useful to drop support
for localization, which these systems don't implement or care about.

Differential Revision: https://reviews.llvm.org/D90072
2020-10-27 14:56:30 -04:00
Martin Storsjö 0be27302d4 [libcxx] Fix typo in spelling of 'sentinel'. NFC.
Differential Revision: https://reviews.llvm.org/D90220
2020-10-27 20:38:32 +02:00
Louis Dionne cfa1376a01 [libc++] Get rid of iostreams in the to_string tests 2020-10-27 13:36:13 -04:00
Louis Dionne 87d3a5365e [libc++] Remove references to CONDUIT_TOKEN
It's not required anymore, since we rely on another job to report
the results back to Phabricator.
2020-10-27 12:26:44 -04:00
Louis Dionne 2479b3d7c6 [libc++] Fix filesystem test in C++11/14
Before C++17, std::string::data() was marked as const, so we can't use
it to write to the contents of the string.
2020-10-27 11:21:33 -04:00
Louis Dionne d1afe2e25c [libc++] Remove the reliance of several <random> tests on <iostream> 2020-10-26 18:02:01 -04:00
Louis Dionne 89ec5091cc [libc++] Get rid of <iostream> in a filesystem test 2020-10-26 17:00:12 -04:00
Louis Dionne b03ea054db [libc++] NFC: Minor refactoring in filesystem_test_helper.h to ease readability
The variable declarations interleaved with logic was really difficult
to read. Instead, simply have two different implementations for _WIN32
and others.
2020-10-26 16:34:20 -04:00
Louis Dionne 8cd7786e48 [libc++] NFC: Consistent indentation for buildkite-pipeline.yml 2020-10-26 14:54:13 -04:00
Louis Dionne b888463f8d [libc++abi] Make sure we can run the tests in Standalone mode
The tests would previously fail if the `python` executable wasn't found,
because we were missing the mandatory find_package.
2020-10-26 14:26:44 -04:00
Louis Dionne 88374f76ee [libc++] Fix indentation of buildkite-pipeline.yml 2020-10-26 12:58:37 -04:00
Louis Dionne d3024a074b [libc++] Add a CI jobs to test the Standalone builds 2020-10-26 12:13:19 -04:00
Louis Dionne 9f4b888c32 [libc++] NFC: Remove unused includes from the test suite
- <iostream> include from a <chrono> test
- <regex> include from the filesystem tests
2020-10-23 15:51:54 -04:00
Louis Dionne cb9f6c4c8c [libc++] Clean up unused CI files
Those were useful during CI experimentation, but are not used anymore.
2020-10-23 15:21:04 -04:00
Louis Dionne 2f8dd2687f [libc++] Refactor the run-buildbot script to make it more modular, and run the benchmarks
As a fly-by fix, unbreak the benchmarks on Apple platforms.

Differential Revision: https://reviews.llvm.org/D90043
2020-10-23 15:11:41 -04:00
Louis Dionne 48e4b0fd3a [runtimes] Revert the libc++ __config_site change
This is a massive revert of the following commits (from most revent to oldest):

	2b9b7b5775.
	529ac33197
	28270234f1
	69c2087283
	b5aa67446e
	5d796645d6

After checking-in the __config_site change, a lot of things started breaking
due to widespread reliance on various aspects of libc++'s build, notably the
fact that we can include the headers from the source tree, but also reliance
on various "internal" CMake variables used by the runtimes build and compiler-rt.

These were unintended consequences of the change, and after two days, we
still haven't restored all the bots to being green. Instead, now that I
understand what specific areas this will blow up in, I should be able to
chop up the patch into smaller ones that are easier to digest.

See https://reviews.llvm.org/D89041 for more details on this adventure.
2020-10-23 09:41:48 -04:00
Louis Dionne d098bb39aa [libc++] Allow running the tests in the experimental runtimes-only build 2020-10-22 17:04:22 -04:00
Louis Dionne ce565861c7 [libc++] Drop old workaround for iostreams instantiations missing from the dylib
On old Apple platforms (pre 10.9), we couldn't rely on the iostreams
explicit instantiations being part of the dylib. However, we don't
support back-deploying to such old deployment targets anymore, so the
workaround can be dropped.
2020-10-22 14:51:25 -04:00
Mikhail Goncharov 40f360c2e9 [libc++] Update continous integration scripts
Now libc++ pipeline will be triggered from the "premerge-checks" and the
combined result are going to be returned to Harbormaster.

Reviewed-by: ldionne

Differential Revision: https://reviews.llvm.org/D89113
2020-10-22 10:49:40 +02:00
Martin Storsjö 78ba1e93a6 [libcxx] [test] Move use of statvfs to helper header
Implement the corresponding thing using windows functions as well.

Differential Revision: https://reviews.llvm.org/D89864
2020-10-22 09:00:57 +03:00
Martin Storsjö 545fb7a71c [libcxx] [test] Mark bits of fs.enum tests as libcpp specific
The individual enum values in copy_options and file_type aren't
specified in the standard.

The standard doesn't require fs::path::format to be a scoped enum.

Differential Revision: https://reviews.llvm.org/D89866
2020-10-22 09:00:57 +03:00
Martin Storsjö 586892d583 [libcxx] [test] Add another (void) cast for a function marked nodiscard in MS STL
Differential Revision: https://reviews.llvm.org/D89867
2020-10-22 09:00:57 +03:00
Louis Dionne 28270234f1 [libc++] Fix the benchmarks build 2020-10-21 17:55:35 -04:00
Louis Dionne 1913bb622c [libc++][ci] Also install the library in the CI scripts
It's good to run the installation step to make sure it works properly,
as build system changes can break that.
2020-10-21 17:34:58 -04:00
Louis Dionne 69c2087283 [libc++] Fix compiler-rt build by copying libc++ headers to <build>/include
This commit should really be named "Workaround external projects depending
on libc++ build system implementation details". It seems that the compiler-rt
build (and perhaps other projects) is relying on the fact that we copy libc++
and libc++abi headers to `<build-root>/include/c++/v1`. This was changed
by 5d796645, which moved the headers to `<build-root>/projects/libcxx/include/c++/v1`
and broke the compiler-rt build.

I'm committing this workaround to fix the compiler-rt build, but we should
remove reliance on implementation details like that. The correct way to
setup the compiler-rt build would be to "link" against the `cxx-headers`
target in CMake, or to run `install-cxx-headers` using an appropriate
installation prefix, and then manually add a `-I` path to that location.
2020-10-21 16:56:33 -04:00
Louis Dionne b5aa67446e [libc++] Fix the installation of libc++ headers since the __config_site change 2020-10-21 12:54:42 -04:00
Louis Dionne 5d796645d6 [take 2] [libc++] Include <__config_site> from <__config>
Prior to this patch, we would generate a fancy <__config> header by
concatenating <__config_site> and <__config>. This complexifies the
build system and also increases the difference between what's tested
and what's actually installed.

This patch removes that complexity and instead simply installs <__config_site>
alongside the libc++ headers. <__config_site> is then included by <__config>,
which is much simpler. Doing this also opens the door to having different
<__config_site> headers depending on the target, which was impossible before.

It does change the workflow for testing header-only changes to libc++.
Previously, we would run `lit` against the headers in libcxx/include.
After this patch, we run it against a fake installation root of the
headers (containing a proper <__config_site> header). This makes use
closer to testing what we actually install, which is good, however it
does mean that we have to update that root before testing header changes.
Thus, we now need to run `ninja check-cxx-deps` before running `lit` by
hand.

This commit was originally applied in 1e46d1aa3 and reverted in eb60c487
because it broke the libc++abi and libunwind test suites. This has now
been fixed.

Differential Revision: https://reviews.llvm.org/D89041
2020-10-21 10:40:33 -04:00
Louis Dionne eb60c48744 [libc++] Revert "Include <__config_site> from <__config>"
This temporarily reverts commit 1e46d1aa until I find a solution to fix
the libc++abi and libunwind test suites with that change.
2020-10-21 09:18:29 -04:00
Louis Dionne 1e46d1aa3f [libc++] Include <__config_site> from <__config>
Prior to this patch, we would generate a fancy <__config> header by
concatenating <__config_site> and <__config>. This complexifies the
build system and also increases the difference between what's tested
and what's actually installed.

This patch removes that complexity and instead simply installs <__config_site>
alongside the libc++ headers. <__config_site> is then included by <__config>,
which is much simpler. Doing this also opens the door to having different
<__config_site> headers depending on the target, which was impossible before.

It does change the workflow for testing header-only changes to libc++.
Previously, we would run `lit` against the headers in libcxx/include.
After this patch, we run it against a fake installation root of the
headers (containing a proper <__config_site> header). This makes use
closer to testing what we actually install, which is good, however it
does mean that we have to update that root before testing header changes.
Thus, we now need to run `ninja check-cxx-deps` before running `lit` by
hand.

Differential Revision: https://reviews.llvm.org/D89041
2020-10-21 08:46:57 -04:00
Martin Storsjö b4a289b03c [libcxx] [test] Split the file_time_type synopsis test
Split the resolution check to a separate test, which is marked as
unsupported on windows.

On windows (both with MS STL and libstdc++), the file time has
100 ns resolution; the standard doesn't mandate a specific resolution.

Differential Revision: https://reviews.llvm.org/D89535
2020-10-21 10:00:02 +03:00
Louis Dionne 9339ab30fb [libc++] Get rid of <sstream> in the valarray tests 2020-10-20 18:15:57 -04:00
Louis Dionne e557b6a66d [libc++] Remove uses of verbose_assert.h in Filesystem tests
For a modest loss of debugability in the tests, this allows more tests
to run on platforms that do not have support for <iostream>.
2020-10-20 16:57:00 -04:00
Louis Dionne c2279b262f [libc++] Make it easier to add new restrictions for feature-test macro tests 2020-10-20 15:52:57 -04:00
Louis Dionne a037059577 [libc++] Decouple debug mode tests from iostreams 2020-10-20 15:48:42 -04:00
Martin Storsjö 87d7c00092 [libcxx] [test] Fix path.modifiers/make_preferred for windows
Use p.string() instead of p.native() for comparing with the expected
value.

Explicitly list the expected values for both posix and windos, even if
the operation is an identity operation on posix.

Differential Revision: https://reviews.llvm.org/D89532
2020-10-20 19:44:21 +03:00
Martin Storsjö b30e42922a [libcxx] [test] Avoid conflicting definitions of _CRT_SECURE_NO_WARNINGS
This is defined both by libcxx/utils/libcxx/test/config.py (for
any windows target) and msvc_stdlib_force_include.h (when testing
specifically the MSVC C++ library).

The command line define (-D_CRT_SECURE_NO_WARNINGS) defines it to the
value 1; change the header define to match that.

Keeping both instances, to keep the fix for cases when not building
in cases that don't use config.py.

Also remove a comment about whether this can be removed; it can't at
least be removed altogether - doing that breaks a number of tests that
otherwise succeed.

Differential Revision: https://reviews.llvm.org/D89588
2020-10-20 19:44:21 +03:00
Eric Fiselier 229db36474 [libc++] Make __shared_weak_count vtable consistent across all build configurations
This patch ensures that __shared_weak_count provides a consistent vtable
regardless of if RTTI is enabled or if we are targeting a static or shared
libc++ build.

This patch is technically ABI breaking, but only for a very specific
configuration that no vendor should be shipping.

Note that _LIBCPP_BUILD_STATIC is not normally defined when building
libc++.a, but instead it must be manually provided by the user or the
__config_site.

Differential Revision: https://reviews.llvm.org/D32838
2020-10-20 08:19:43 -04:00
Casey Carter a668ad92d5 [libc++][test] MSVC has no __PRETTY_FUNCTION__
Use `__FUNCSIG__` instead when compiling with MSVC. While we're touching `makeTypeIDImp`, remove the warning suppression for C4640 "construction of local static object is not thread safe" since C1XX now correctly constant-initializes `id`.
2020-10-19 17:20:47 -07:00
Casey Carter 7f82352a2c [libc++][test] Test nonconforming atomic_fetch_XXX overloads only on libc++
The Standard doesn't include the
```c++
template<class T>
T* atomic_fetch_meow(atomic<T*>, ...);
```
templates these tests are testing.

(See https://bugs.llvm.org/show_bug.cgi?id=47908)
2020-10-19 17:19:52 -07:00
Casey Carter f92d874fe5 [libc++][test] Silence MSVC "comparison of signed and unsigned" warning 2020-10-19 17:18:44 -07:00
Casey Carter d5971a63ca [libc++][test] test allocator<const T> extension only on libc++ 2020-10-19 17:14:51 -07:00
Casey Carter 877766573b [libc++][test] Don't violate precondition [atomics.flag]/6
... which forbids passing `memory_order_release` or `memory_order_acq_rel` to either overload of `atomic_flag_test_explicit`.
2020-10-19 17:14:01 -07:00
Casey Carter dccc742c22 [libc++][test] atomic<T> requires trivially copyable T
The author of these tests apparently forgot that `atomic_{,un}signed_lock_free` are already specializations of `atomic`.
2020-10-19 17:13:18 -07:00
Casey Carter fce9ca3c1e [libc++][test] Pass correct ordering to std::merge
The predicate passed to `merge` must induce a strict weak ordering on its arguments.
2020-10-19 17:12:06 -07:00
Casey Carter 24ab5787b4 [libc++][test] Spell "TEST_CONSTEXPR_CXX17" correctly
These three algorithm tests are incorrectly using `_LIBCPP_CONSTEXPR_AFTER_CXX17` instead of `TEST_CONSTEXPR_CXX17`.
2020-10-19 17:11:26 -07:00
Martin Storsjö 93671fffb5 [libcxx] [test] Use _putenv instead of setenv/unsetenv on windows
Move the functions to the helper header and keep the arch specific
logic there.

Differential Revision: https://reviews.llvm.org/D89681
2020-10-20 00:07:02 +03:00
Martin Storsjö 81db3c31aa [libcxx] [test] Fix all remaining issues with fs::path::string_type being wstring
Use fs::path as variable type instead of std::string, when the input
potentially is a path, as they can't be implicitly converted back to
string.

Differential Revision: https://reviews.llvm.org/D89674
2020-10-20 00:07:02 +03:00
Martin Storsjö 5c39eebc12 [libcxx] [test] Fix filesystem_test_helper.h to compile for windows
Use .string() instead of .native() in places where we want to combine
paths with std::string.

Convert some methods to take a fs::path as parameter instead of
std::string, for cases where they are called with paths as
parameters (which can't be implicitly converted to std::string if
the path's string_type is wstring).

Differential Revision: https://reviews.llvm.org/D89530
2020-10-20 00:07:02 +03:00
Martin Storsjö afe40b305d [libcxx] [test] Mark tests that require specific allocation behaviours as libcpp only
This fixes/silences a few failures on libstdc++ on linux.

Differential Revision: https://reviews.llvm.org/D89676
2020-10-20 00:07:01 +03:00
Martin Storsjö fa88f61ef5 [libcxx] [test] Exclude domain socket tests on windows, like bsd/darwin
Differential Revision: https://reviews.llvm.org/D89673
2020-10-20 00:07:01 +03:00
Martin Storsjö cf9831b843 [libcxx] [test] Add LIBCPP_ONLY() around another test for an implementation detail
Differential Revision: https://reviews.llvm.org/D89675
2020-10-20 00:07:01 +03:00
Martin Storsjö 41c5070888 [libcxx] [test] Don't require fs::path::operator(string_type&&) to be noexcept
Mark this as a libcpp specific test; the standard doesn't say that
this method should be noexcept.

Differential Revision: https://reviews.llvm.org/D89677
2020-10-20 00:07:01 +03:00
Martin Storsjö e2ddd515ab [libcxx] [test] Allow fs::permissions(path, perms, perm_options, error_code) to be noexcept
The standard doesn't declare this overload as noexcept, but doesn't
either say that it strictly cannot be noexcept either. The function
doesn't throw on errors that are signaled via error_code, but the
standard says that it may throw a bad_alloc.

This fixes an error with libstdc++ on linux.

Differential Revision: https://reviews.llvm.org/D89678
2020-10-20 00:07:01 +03:00
Martin Storsjö c61c7ba595 [libcxx] [test] Do error printfs to stderr in filesystems tests
This makes them more readable in llvm-lit's output on failures.

This only applies the change on the filesystem test subdir.

Differential Revision: https://reviews.llvm.org/D89680
2020-10-20 00:07:01 +03:00
Louis Dionne ec0dc70efc [libc++] Add more tests for operator<< on std::complex 2020-10-19 13:23:59 -04:00
Alex Richardson 8041f13e62 [libc++] Skip tests using constexpr destructors with older clang versions
It appears that the released version of clang that supports constexpr
destructors is clang 10 and the oldest one that accepts -std=c++2a is 5,
so mark these as UNSUPPORTED for clang-5 to clang-9.

Reviewed By: #libc, ldionne

Differential Revision: https://reviews.llvm.org/D89704
2020-10-19 17:23:02 +01:00
Louis Dionne b4bd194378 [libc++] Refactor the fuzzing tests
Define all the fuzzing tests in libcxx/test/libcxx/fuzzing, and get
rid of the ad-hoc libcxx/fuzzing directory, which wasn't properly
integrated with the build system or test suite.

As a fly-by change, this also reduces the dependencies of fuzzing tests
on large library components like <iostream>, to make them work on more
platforms.
2020-10-19 12:11:50 -04:00
Louis Dionne 9b40ee8eb0 [libc++] Define new/delete in libc++abi only by default
Previously, we would define new/delete in both libc++ and libc++abi.
Not only does this cause code bloat, but also it's technically an ODR
violation since we don't know which operator will be selected. Furthermore,
since those are weak definitions, we should strive to have as few of them
as possible (to improve load times).

My preferred choice would have been to put the operators in libc++ only
by default, however that would create a circular dependency between
libc++ and libc++abi, which GNU linkers don't handle.

Folks who want to ship new/delete in libc++ instead of libc++abi are
free to do so by turning on LIBCXX_ENABLE_NEW_DELETE_DEFINITIONS at
CMake configure time.

On Apple platforms, this shouldn't be an ABI break because we re-export
the new/delete symbols from libc++abi. This change actually makes libc++
behave closer to the system libc++ shipped on Apple platforms.

On other platforms, this is an ABI break for people linking against libc++
but not libc++abi. However, vendors have been consulted in D68269 and no
objection was raised. Furthermore, the definitions can be controlled to
appear in libc++ instead with the CMake option.

Differential Revision: https://reviews.llvm.org/D68269
2020-10-19 11:35:01 -04:00
Casey Carter b20918997a [libc++][test] Portably silence warnings
... in `<numbers>` tests with `[[maybe_unused]]`.
2020-10-19 08:33:58 -07:00
Alex Richardson 7928d40c6b [libc++][dsl] Run checks for locale names aliases using a single %exec
This changes the checking for available locales to use one program that
iterates over argv to test multiple locale names instead of checking each
name with a separate executable.

This massively speeds up running individual tests using an SSH executor
(it can take up to 10 seconds to compile and run a single test in some
emulated environments) in case no locales are installed since then all
fallback names are tested idividually. But even on a native machine
this reduces the libc++ lit startup time by ~1-2 second for me on a machine
that does not have locale data installed.

Reviewed By: #libc, ldionne
Differential Revision: https://reviews.llvm.org/D88884
2020-10-18 18:17:50 +01:00
Alex Richardson 82b0ac4f1f [libc++] Fix aligned_alloc tests FreeBSD
On FreeBSD we get the following error when passing zero as the requested
alignment: error: requested alignment is not a power of 2

Reviewed By: #libc, ldionne
Differential Revision: https://reviews.llvm.org/D88820
2020-10-18 18:17:50 +01:00
Martin Storsjö 3784bdf217 [libcxx] [test] Fix string type handling in a few fairly trivial class.path tests
Use string() for convenience for testing where possible, but keep using
native() for move tests where we want to check that no allocations are
made, constructing a reference fs::path::string_type instead.

Use the right value_type in a few places.

Make the synop test check for the right types and for the expected
preferred separator.

Differential Revision: https://reviews.llvm.org/D89537
2020-10-16 21:04:23 +03:00
Louis Dionne 2408fc2a1e [libc++] Avoid relying on `realpath` being installed on the system
It doesn't appear to be a standard utility.
2020-10-16 13:07:18 -04:00
Louis Dionne 880fc4d581 [libc++] Move the oss-fuzz script to libcxx/utils/ci 2020-10-16 12:40:43 -04:00
Louis Dionne e1612c3866 [libc++] Move the oss-fuzz script to libc++
Instead of having this script be part of the OSS-Fuzz repository, I think
it makes more sense to have it alongside the rest of the fuzzing targets
in libc++.
2020-10-16 12:23:03 -04:00
Martin Storsjö ddb4693a92 [libcxx] [test] Add (void) return casts on functions marked nodiscard in MS STL
Differential Revision: https://reviews.llvm.org/D89533
2020-10-16 17:36:56 +03:00
Martin Storsjö 66427d7359 [libcxx] [test] Mark tests for libcxx specific implementation details with LIBCPP_ONLY()
This matches an existing marking in enum.path.format.pass.cpp.

Differential Revision: https://reviews.llvm.org/D89534
2020-10-16 17:36:56 +03:00
Martin Storsjö 701fa703fc [libcxx] [test] Use fs::path::string_type instead of std::string in fs.op.relative
Differential Revision: https://reviews.llvm.org/D89538
2020-10-16 17:36:56 +03:00
Martin Storsjö fdbfff8fd4 [libcxx] [test] Use string() instead of native() as parameter to std::ifstream/ofstream in copy_file_large.pass.cpp
This fixes building with libstdc++ for windows. MS STL has got
ifstream/ofstream overloads that taken wide strings though.

Differential Revision: https://reviews.llvm.org/D89539
2020-10-16 17:36:56 +03:00
Simon Tatham 4d60467f99 [libcxx] Fix printf formats in two tests.
rGcc69d211d0d65d7b introduced several uses of `printf` with format
directives `%lu` and `%ld` to format values of type `size_t` and
`ptrdiff_t` respectively.

That doesn't reliably work in all C implementations, because those
types aren't necessarily the same thing as 'long int': sometimes
they're not even the same size, and when they are the same size, they
might be officially defined as int rather than long (for example),
which causes clang to emit a diagnostic for the mismatch.

C has special-purpose printf modifier letters for these two types, so
it's safer to use them. Changed all `%lu` on `size_t` to `%zu`, and
all `%ld` on `ptrdiff_t` to `%td`.

Reviewed By: ldionne, #libc

Differential Revision: https://reviews.llvm.org/D89545
2020-10-16 13:47:45 +01:00
Louis Dionne 13410fa79f [libc++] NFCI: Use Lit features to disable tests instead of #if 2020-10-16 08:35:34 -04:00
Louis Dionne c474d829d0 [libc++] NFC: Move iterator.range tests into the right place
They seem to have been placed under stream.iterators by mistake.
This is relevant for some upcoming UNSUPPORTED markup.
2020-10-16 08:35:34 -04:00
Louis Dionne 6abc15ae3c [libc++] Reduce dependencies on <iostream> from <random>
We included <istream> and <ostream> from <random>, but really it is
sufficient to include <iosfwd> if we make sure we access ios_base
members through a dependent type. This allows us to break a hard
dependency of <random> on locales.
2020-10-15 13:40:18 -04:00
Louis Dionne 17dcf85ebe [libc++][filesystem] Only include <fstream> when we actually need it in copy_file_impl
This allows building <filesystem> on systems that don't support <fstream>,
such as systems that don't support localization.
2020-10-15 13:21:14 -04:00
Louis Dionne 54f7ad2d6f [libc++] NFC: Remove unused include 2020-10-15 12:54:50 -04:00
Louis Dionne e0d01294bc [libc++] Allow building libc++ on platforms without a random device
Some platforms, like several embedded platforms, do not provide a source
of randomness through a random device. This commit makes it possible to
build and test libc++ for such platforms, i.e. without std::random_device.

Surprisingly, the only functionality that doesn't work on such platforms
is std::random_device itself -- everything else in <random> still works,
one just has to find alternative ways to seed the PRNGs.
2020-10-15 12:20:29 -04:00
Louis Dionne 0728b67b27 [libc++] Mark two tests as unsupported in C++03
This was dropped when I split the tests into individual source files
to make sure they would actually run (in 2908eb20ba).
2020-10-14 12:42:11 -04:00
Louis Dionne 4212533961 [libc++] Use ADDITIONAL_COMPILE_FLAGS instead of #define for _LIBCPP_DEBUG 2020-10-14 12:02:37 -04:00
Louis Dionne 2908eb20ba [libc++] Split off debug tests that were missed by ce1365f8f7 into test/libcxx
Also, some tests had multiple death tests in them, so split them into
separate tests instead. The second death test would obviously never
get run, because the first one would kill the program before.
2020-10-14 12:02:37 -04:00
Louis Dionne 41d85fe0e1 [libc++] Remove signal-based checkpoints in libc++ tests
While this adds some convenience to the test suite, it prevents the tests
using these checkpoints from being used on systems where signals are not
available, such as some embedded systems. It will also prevent these tests
from being constexpr-friendly once e.g. std::map is made constexpr, due
to the use of statics.

Instead, one can always use a debugger to figure out exactly where a
test is failing when that isn't clear from the log output without
checkpoints.
2020-10-14 10:38:32 -04:00
Dominik Montada 8c03fdf34a [libcxxabi,libunwind] support running tests in standalone mode
Remove check for standalone and shared library mode in libcxxabi to
allow including tests in said mode. This check prevented running the
tests in standalone mode with static libraries, which is the case for
baremetal targets.

Fix check-unwind target trying to use a non-existent llvm-lit executable
in standalone mode. Copy the HandleOutOfTreeLLVM logic from libcxxabi to
libunwind in order to make the tests work in standalone mode.

Reviewed By: ldionne, #libc_abi, #libc

Differential Revision: https://reviews.llvm.org/D86540
2020-10-14 09:10:20 +02:00
Louis Dionne cc69d211d0 [libc++/abi] Clean up uses of <iostream> in the test suite
We used <iostream> in several places where we don't actually need the
full power of <iostream>, and where using basic `std::printf` is enough.
This is better, since `std::printf` can be supported on systems that don't
have a notion of locales, while <iostream> can't.
2020-10-13 20:25:33 -04:00
Louis Dionne ab55897817 [libc++] Allow passing relative paths to the Apple install script 2020-10-13 12:27:47 -04:00
Raphael Isemann 6b7a49bb43 Fix all the CMake code that can only handle -stdlib= but not --stdlib=
There are several places in LLVM's CMake setup that try to remove the
`stdlib=...` flag from the CMake flags. All this code however only considered
the `-stdlib=` variant of the flag but not the alternative spelling with a
double dash. This causes that when one adds `--stdlib=...` to the user-provided
CMake flags that this gets transformed into just `-` which ends up causing the
build system to think it should read the source from stdin (which then lead to
very confusing build errors).

This just adds the alternative spelling before the`-stdlib=` variant in all
these places

Reviewed By: ldionne

Differential Revision: https://reviews.llvm.org/D87133
2020-10-13 16:05:21 +02:00
Louis Dionne 647fb6b374 [libc++] Update the <version> header in-place from generate_feature_test_macro_components
This simplifies the workflow for adding new feature-test macros for
contributors. Previously, they would have to move the generated <version>
header from a temporary directory to libc++'s include directory by hand.
This makes the behavior for the <version> header consistent with what's
done for the tests and the documentation.
2020-10-13 09:18:35 -04:00
Louis Dionne 2dc9b26c00 [libc++] Remove code to prevent overwriting the system libc++ on Darwin
The system partition is read-only since Catalina.
2020-10-09 17:02:39 -04:00
Louis Dionne 4bd3d16c2d [libc++] Remove redundant if(LIBCXX_INSTALL_LIBRARY)
The individual LIBCXX_INSTALL_(SHARED|STATIC)_LIBRARY are already
dependent on whether LIBCXX_INSTALL_LIBRARY is ON or OFF.
2020-10-09 17:02:39 -04:00
Louis Dionne 877667287f [libc++] Fixup a missing occurrence of LIBCXX_ENABLE_DEBUG_MODE 2020-10-09 14:40:47 -04:00
Louis Dionne e0d66ccf06 [libc++] Rename LIBCXX_ENABLE_DEBUG_MODE to LIBCXX_ENABLE_DEBUG_MODE_SUPPORT
To make it clearer this is about whether the library supports the debug
mode at all, not whether the debug mode is enabled. Per comment by Nico
Weber on IRC.
2020-10-09 14:39:20 -04:00
Louis Dionne 4abb519619 [libc++] NFCI: Define small methods of basic_stringstream inline
It greatly increases readability because defining the methods out-of-line
involves a ton of boilerplate template declarations.
2020-10-09 14:33:49 -04:00
Louis Dionne c778f6c4f9 [libc++] Clean up logic around aligned/sized allocation and deallocation
Due to the need to support compilers that implement builtin operator
new/delete but not their align_val_t overloaded versions, there was a
lot of complexity. By assuming that a compiler that supports the builtin
new/delete operators also supports their align_val_t overloads, the code
can be simplified quite a bit.

Differential Revision: https://reviews.llvm.org/D88301
2020-10-09 12:43:28 -04:00
Louis Dionne 12805513a6 [libc++] Remove some workarounds for C++03
We don't support any compiler that doesn't support variadics and rvalue
references in C++03 mode, so these workarounds can be dropped. There's
still *a lot* of cruft related to these workarounds, but I try to tackle
a bit of it here and there.
2020-10-09 12:35:13 -04:00
Louis Dionne ddb2baf9fb [libc++] Make sure we don't cache DSL functions too aggressively
To make sure we don't store a mutable object (which could be modified by
outside code without us noticing) as the cache key, we pickle the cache
key to get a byte stream. If two keys are unequal, we know for sure they
will not have the same pickling. And if they are equal, there's a large
chance they will have the same pickling. If they don't, we might end up
not reusing a cached entry when we could have, but at least the behavior
we'll have is semantically correct.
2020-10-09 10:22:46 -04:00
Louis Dionne 86d61365d8 [libc++] More consistency with declaring int main(int, char**) 2020-10-09 10:09:57 -04:00
Louis Dionne 5390c5a96e [libc++] Add caching for feature-detection Lit tests
This significantly speeds up the configuration of libc++'s test suite
by making sure that we don't perform the same operations over and over
again.

Differential Revision: https://reviews.llvm.org/D89003
2020-10-08 21:08:53 -04:00
Louis Dionne 504bc07d1a [runtimes] Use int main(int, char**) consistently in tests
This is needed when running the tests in Freestanding mode, where main()
isn't treated specially. In Freestanding, main() doesn't get mangled as
extern "C", so whatever runtime we're using fails to find the entry point.

One way to solve this problem is to define a symbol alias from __Z4mainiPPc
to _main, however this requires all definitions of main() to have the same
mangling. Hence this commit.
2020-10-08 14:28:13 -04:00
Petr Hosek 4424d2428a [libcxx] Fix the thousands_sep test failure
This fixes the issue introduced in 80ef4126b.
2020-10-08 09:14:52 -07:00
Petr Hosek 80ef4126b1 [libcxx] Use runtime rather then compile-time glibc version check
glibc supports versioning, so it's possible to build against older
version and run against newer version. This is sometimes relied on
in practice, e.g. in Fuchsia build we build against older sysroot
(equivalent to Ubuntu Trusty) to cover the broadest possible range
of host systems, but that doesn't necessarily match the system that
binary is going to run on which may have newer version, in which case
the compile test used in curr_symbol is going to fail. Using runtime
check is more reliable. This is a follow up to D56702 which addressed
one instance, this patch addresses all of the remaining ones.

Differential Revision: https://reviews.llvm.org/D88188
2020-10-07 17:59:16 -07:00
Louis Dionne 8da0df3d6d [libc++] Remove unused includes of Availability.h
Since ebaf1d5e2b, the macros defined in <Availability.h> are not used
anymore.
2020-10-07 18:03:40 -04:00
Min-Yih Hsu bd5fe7b010 [M680x0] Add google/benchmark's CycleTimer support for M68K
This is a cherrypick of the upstream fix commit ffe1342 onto
`llvm/utils/benchmark` and `libcxx/utils/google-benchmark`.
This adds CycleTimer implementation for M680x0, which simply
uses `gettimeofday` same as MIPS.

Differential Review: https://reviews.llvm.org/D88868
2020-10-07 14:58:36 -07:00
Nico Weber fbce456fad [gn build] (manually) port ce1365f8f7 2020-10-07 10:33:51 -04:00
Louis Dionne 62d4ee5b7a [libc++] Use the existing CMake caches when running build bots 2020-10-07 09:30:11 -04:00
Louis Dionne ce1365f8f7 [libc++] Add a CMake option to control whether the debug mode is supported
Some libc++ builds may want to disable support for the debug mode,
for example to reduce code size or because the current implementation
of the debug mode requires a global map. This commit adds the
LIBCXX_ENABLE_DEBUG_MODE CMake option and ties it into the test
suite.

It also adds a CI job to test this configuration going forward.

Differential Revision: https://reviews.llvm.org/D88923
2020-10-07 09:20:59 -04:00
Louis Dionne 602c193e2a [libc++] Make sure __clear_and_shrink() maintains string invariants
__clear_and_shrink() was added in D41976, and a test was added alongside
it to make sure that the string invariants were maintained. However, it
appears that the test never ran under UBSan before, which would have
highlighted the fact that it doesn't actually maintain the string
invariants.

Differential Revision: https://reviews.llvm.org/D88849
2020-10-07 09:16:59 -04:00
Chris Palmer 9eff07a746 [libc++] Add assert to check bounds in `constexpr string_view::operator[]`
Differential Revision: https://reviews.llvm.org/D88864
2020-10-06 16:57:41 -04:00
Louis Dionne 370b7887e5 [libc++] Add a script to setup CI on macOS nodes 2020-10-06 15:34:09 -04:00
Hafiz Abid Qadeer f78bb4d84e [libc++] Check _LIBCPP_USE_CLOCK_GETTIME before using clock_gettime
The clock_gettime function is available when _POSIX_TIMERS is defined.
We check for this and set _LIBCPP_USE_CLOCK_GETTIME accordingly since
59b3102739. But check for _LIBCPP_USE_CLOCK_GETTIME was removed in
babd3aefc9. As a result, code is now trying to use clock_gettime even
on platforms where it is not available and it is causing build failure
with newlib.

This patch restores the checks to fix this.

Differential Revision: https://reviews.llvm.org/D88825
2020-10-06 11:56:54 -04:00
Louis Dionne 281de8f361 [libc++] Allow retries in two flaky tests 2020-10-06 11:32:19 -04:00
Alex Richardson 04f908b9f0 [libcxx][lit] Add support for custom ssh/scp flags in ssh.py
In our CHERI Jenkins CI 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.

For our specific use-case I could have also added a single --ssh-config-file
argument that can be used for both the scp and ssh commands, but being able
to pass arbitrary extra flags for both commands seems more flexible.

Reviewed By: #libc, ldionne

Differential Revision: https://reviews.llvm.org/D84097
2020-10-06 11:38:52 +01:00
Louis Dionne 2ea8fec2cd [libc++] Improve tests for std::quoted
Instead of using ad-hoc mechanisms to disable the tests in C++ < 14, use
UNSUPPORTED markup.
2020-10-05 19:07:03 -04:00
Alex Richardson e426ae2bd5 [libcxx][dsl] Fix mutable default argument warning
This is flagged by PyCharm and can cause subtle bugs. While changing this
also re-sort the imports and add missing ones.

Reviewed By: #libc, ldionne

Differential Revision: https://reviews.llvm.org/D88816
2020-10-05 23:23:30 +01:00
Louis Dionne 477a68760b [libc++] Use __has_include instead of complex logic in thread.cpp
We might end up including more headers than strictly necessary this way,
but it's much simpler and it makes it easier to port thread.cpp to systems
not handled by the existing conditionals.
2020-10-05 16:41:25 -04:00
Louis Dionne fe7245b772 [libc++] NFC: Rename variant helpers to avoid name clashes
Some system headers define __constructor and __destructor macros (for
Clang attributes constructor and destructor). While this is badly
behaved, it is easy for libc++ to work around this issue.
2020-10-05 16:41:25 -04:00
Louis Dionne 32a2209b5c [libc++] NFC: Remove unused <iostream> include in atomic.cpp 2020-10-05 16:41:25 -04:00
Louis Dionne a506a66bd9 [libc++] Fix several debug mode tests
These tests were only being run when _LIBCPP_DEBUG was defined, which
isn't the case by default when we run the test suite. In other words,
all these debug mode tests were never being run. This commit makes sure
they are run, and in some cases, extracts them into a file under test/libcxx
to separate them from the Standard tests.

Differential Revision: https://reviews.llvm.org/D88836
2020-10-05 16:15:32 -04:00
Louis Dionne d5a6da84a3 [libc++/abi] Revert "[libc++] Move the weak symbols list to libc++abi"
This reverts commit c7d4aa711a. I am still investigating the issue,
but it looks like that commit has an interaction with ld64 that causes
new/delete weak re-exports not to work properly anymore. This is weird
because this commit did not touch the exports of new/delete -- I am
still investigating.
2020-10-05 11:42:13 -04:00
Louis Dionne 04fce1515b [libc++] Fix the build with GCC < 10
For now, we still need to support older GCCs, so work around the lack of
__is_constructible on older GCCs.
2020-10-02 18:01:48 -04:00
Louis Dionne f7e91e6cc7 [libc++] Allow retries on some slightly flaky mutex tests 2020-10-02 17:21:21 -04:00
Louis Dionne 870827f652 [libc++] NFCI: Remove the _LIBCPP_DEBUG_MODE helper macro
It was used inconsistently and the name was pretty confusing, so we might
as well use `#if _LIBCPP_DEBUG_LEVEL == 2` consistently everywhere.
2020-10-02 15:11:23 -04:00
Louis Dionne 31e820378b [libc++] NFCI: Simplify macro definitions for the debug mode
The debug mode always had three possibilities:
- _LIBCPP_DEBUG is undefined => no assertions
- _LIBCPP_DEBUG == 0         => some assertions
- _LIBCPP_DEBUG == 1         => some assertions + iterator checks

This was documented that way, however the code did not make this clear
at all. The discrepancy between _LIBCPP_DEBUG and _LIBCPP_DEBUG_LEVEL
was especially confusing. I reworked how the various macros are defined
without changing anything else to make the code clearer.
2020-10-02 15:11:23 -04:00
Louis Dionne 1a92de0064 [libc++] NFCI: Remove _LIBCPP_EXTERN_TEMPLATE2
This seems to have been added a long time ago as a temporary help
for debugging some <regex> issue, but it's really the same as
_LIBCPP_EXTERN_TEMPLATE.
2020-10-02 14:31:43 -04:00
Louis Dionne aac2de1b1a [libc++] Remove unnecessary usage of <iostream> in the test suite
Tests should strive to be as minimal as possible, since it makes them
relevant on platforms where <iostream> does not work.
2020-10-02 13:00:34 -04:00
Louis Dionne c7d4aa711a [libc++] Move the weak symbols list to libc++abi
Those symbols are exported from libc++abi in the first place, so it
makes more sense to have them there.
2020-10-02 09:22:23 -04:00
Petr Hosek 8d26760a95 [CMake] Use -isystem flag to access libc++ headers
This is a partial revert of D62155. Rather than copying libc++ headers
into the build directory to be later overwritten by the final headers,
use -isystem flag to access libc++ headers during CMake checks. This
should address the occasional flake we've seen, especially on Windows
builders where CMake fails to overwrite __config with the final version.

Differential Revision: https://reviews.llvm.org/D88454
2020-10-01 12:09:27 -07:00
Louis Dionne ba9b15072c [libc++][ci] Add a job to run the vanilla configuration on Apple
Previously, we'd only have jobs testing the Apple cache on Apple platforms,
but libc++ should also work out-of-the-box.
2020-10-01 13:56:58 -04:00
Louis Dionne a0119e5675 [libc++] NFC: Add missing SHA to ABI Changelog 2020-10-01 13:40:13 -04:00
Louis Dionne 8654a0f8bb [libc++] Don't re-export new/delete from libc++abi when they are defined in libc++
This is a temporary workaround until the new/delete situation is made
better (i.e. we don't include new/delete in both libc++ and libc++abi
by default).
2020-10-01 13:31:55 -04:00
Louis Dionne 79410ddb96 [libc++][ci] Add a configuration testing Apple's system library build
Differential Revision: https://reviews.llvm.org/D88650
2020-10-01 10:37:36 -04:00
Louis Dionne 4f13b99929 [libc++] Simplify how we re-export symbols from libc++abi
Instead of managing two copies of the symbol lists, reuse the same list
in libc++abi and libc++.

Differential Revision: https://reviews.llvm.org/D88623
2020-10-01 08:30:27 -04:00
Louis Dionne 490b556a0f [libc++] Make sure we don't attempt to run check-cxx-abilist when libc++ doesn't define new/delete
That would make the test fail spuriously because we don't generate
an ABI list for that configuration.
2020-09-30 14:59:03 -04:00
Richard Smith afcf9c47c5 Fix test failures with trunk clang
- Make the consteval constructor for the zero type be noexcept
- Don't expect three-way comparison of 0 against a comparison category
  to fail
2020-09-29 17:10:07 -07:00
Richard Smith bf434a5f17 Improve the representation of <compare>'s zero-only type.
* Use an empty struct instead of a member pointer to represent this
  type, so that we don't actually pass a zero member pointer at runtime.

* Mark the constructor as consteval to ensure that no code is emitted
  for it whenever possible.

* Add a honeypot constructor to reject all non-int arguments, so that
  the only argument that can arrive at the real constructor is the
  literal 0.

This results in better generated code, and rejecting invalid comparisons
against nullptr, 0L, and so on, while also rejecting invalid comparisons
against (1-1) and similar that would be allowed if we required an
integer constant expression with value 0.

Differential Revision: https://reviews.llvm.org/D85051
2020-09-29 15:44:05 -07:00
Louis Dionne f9e70fa546 [libc++] Rename the -fno-rtti Lit feature to just no-rtti
This is consistent to the way we name other Lit features, and it removes
the possibility for confusing the Lit feature with the actual compiler
flag.
2020-09-29 16:29:44 -04:00
Louis Dionne d0667562e1 [libc++] Fix some test failures in unusual configurations 2020-09-29 16:22:56 -04:00
Louis Dionne d94253b52e [libc++][ci] Turn on Phabricator reporting by default 2020-09-29 15:57:07 -04:00
Louis Dionne b1e7850967 [libc++][ci] Improve the phabricator-report script
- Detect whether a build has passed more accurately
- Retry pushing the status to Phabricator
- Allow running on a non-review branch
2020-09-29 15:32:27 -04:00
Louis Dionne d689a64edd [libc++][ci] Add a script to describe when to trigger libc++ CI builds 2020-09-29 15:32:26 -04:00
Louis Dionne 2159ed811f [libc++][ci] Update how we build the Docker image
This fixes a couple of issues, such as failing filesystem tests (due to
running the tests as root), and not running with the GCC we downloaded.
2020-09-29 12:50:57 -04:00
Arthur O'Dwyer 7bed95a856 [libc++] Add a regression test for erasing from a vector
After rebasing my trivially-relocatable branch, this behavior was broken...
but no libc++ unit test caught it! Add a regression test specifically for
erasing out of a vector.

Differential Revision: https://reviews.llvm.org/D88421
2020-09-29 12:19:05 -04:00
Louis Dionne 3e5f9dacb0 [libc++] Fix tests on GCC 10
Also, remove workarounds for ancient Clangs from is_constructible tests.
2020-09-29 12:08:33 -04:00
ogiroux 665dc4012b Attempt to clear some msan errors in the libcxx atomic tests. 2020-09-28 16:34:41 -07:00
Petr Hosek 2d657d1bd7 [libcxx] Don't pass -s to libtool
This flag is the default in libtool on Darwin, and it's not supported
by llvm-libtool-darwin causing a build failure.

Differential Revision: https://reviews.llvm.org/D88449
2020-09-28 14:50:09 -07:00
Louis Dionne d092c91288 [libc++] Fix constexpr dynamic allocation on GCC 10
We're technically not allowed by the Standard to call ::operator new in
constexpr functions like __libcpp_allocate. Clang doesn't seem to complain
about it, but GCC does.
2020-09-28 17:44:31 -04:00
Louis Dionne 59f8ac3eb4 [libc++] Replace uses of __libcpp_allocate by std::allocator<>
Both are equivalent, however std::allocator can appear in constant
expressions and is higher level.
2020-09-28 16:09:42 -04:00
Louis Dionne 93ba33066c [libc++] Add UNSUPPORTED markup to atomic test in single-threaded mode 2020-09-28 16:09:15 -04:00
Louis Dionne 46fdaac098 [libc++] Fix heap UaF issue in coroutine test
This wasn't being flagged by older versions of ASAN, but it is now.
2020-09-28 16:09:15 -04:00
Haojian Wu bf890dcb0f [clang] Don't emit "no member" diagnostic if the lookup fails on an invalid record decl.
The "no member" diagnostic is likely bogus.

Reviewed By: sammccall, #libc

Differential Revision: https://reviews.llvm.org/D86765
2020-09-28 15:10:00 +02:00
Louis Dionne 2a11a197af [libc++][ci] Don't require passing --token to phabricator-report
The CONDUIT_TOKEN is already taken from the environment. Also, disable
reporting back to Phabricator for now until we're ready to start spamming
the results back. This still needs a bit of testing.
2020-09-25 11:19:19 -04:00
Louis Dionne 9f21d341e8 [libc++] Initial support for pre-commit CI with Buildkite
This commit adds basic files and scripts that are used for the Buildkite
pre-commit CI setup. This was tested to mostly work on a fork of llvm-project,
however some adjustments will have to be made as we complete the real
setup.
2020-09-25 09:51:10 -04:00
Louis Dionne 23291e8ec7 [libc++] Fix spurious test failure in -fno-exceptions 2020-09-23 19:44:31 -04:00
Louis Dionne c90dee1e90 [libc++] Re-apply fdc41e11f (LWG1203) without breaking the C++11 build
fdc41e11f was reverted in e46c1def5 because it broke the C++11 build.
We shouldn't be using enable_if_t in C++11, instead we must use
enable_if<...>::type.
2020-09-23 08:56:00 -04:00
Raphael Isemann e46c1def52 Revert "[libc++] Implement LWG1203"
This reverts commit fdc41e11f9. It causes the
libcxx/modules/stds_include.sh.cpp test to fail with:
libcxx/include/ostream:1039:45: error: no template named 'enable_if_t'; did you mean 'enable_if'?
template <class _Stream, class _Tp, class = enable_if_t<

Still investigating what's causing this and reverting in the meantime to get
the bots green again.
2020-09-23 10:13:38 +02:00
Louis Dionne 7656dd33d9 [libc++] NFC: Reindent the feature test macro generation script
Each feature-test macro is now a clear block indentation-wise.
2020-09-22 17:40:14 -04:00
Louis Dionne 2404ed0202 [libc++] NFC: Collocate C++20 removed members of std::allocator 2020-09-22 17:40:14 -04:00
Louis Dionne fdc41e11f9 [libc++] Implement LWG1203
Libc++ had an issue where nonsensical code like

  decltype(std::stringstream{} << std::vector<int>{});

would compile, as long as you kept the expression inside decltype in
an unevaluated operand. This turned out to be that we didn't implement
LWG1203, which clarifies what we should do in that case.

rdar://58769296
2020-09-22 17:15:31 -04:00
Louis Dionne 0724f8bf47 [libc++] Implement C++20's P0784 (More constexpr containers)
This commit adds std::construct_at, and marks various members of
std::allocator_traits and std::allocator as constexpr. It also adds
tests and turns the existing tests into hybrid constexpr/runtime tests.

Thanks to Richard Smith for initial work on this, and to Michael Park
for D69803, D69132 and D69134, which are superseded by this patch.

Differential Revision: https://reviews.llvm.org/D68364
2020-09-22 11:20:33 -04:00
Louis Dionne 0451ed9619 [libc++] NFC: Remove trailing whitespace from the feature test macro table 2020-09-22 08:45:48 -04:00
Louis Dionne ac65e3d2ce [libc++] Fix copy/paste error that broke a test 2020-09-21 20:29:54 -04:00
Louis Dionne bb09ef9598 [libc++] Fix failures when running the test suite without RTTI 2020-09-21 20:17:24 -04:00
Louis Dionne 43270c65cf [libc++] Verify base substitutions earlier in the testing format
This allows diagnosing missing substitution issues even when doing
availability feature detection in the DSL.
2020-09-21 15:30:29 -04:00
Mark de Wever d4dd961300 Fixes complexity of map insert_or_assign with a hint.
Mitsuru Kariya reported the map operations insert_or_assign with a hint
violates the complexity requirement. The function no longer uses a lower_bound,
which caused the wrong complexity.

Fixes PR38722: [C++17] std::map::insert_or_assign w/ hint violate complexity requirements

Differential Revision: https://reviews.llvm.org/D62779
2020-09-19 16:28:55 +02:00
Louis Dionne a3c28ccd49 [libc++] Remove some workarounds for missing variadic templates
We don't support GCC in C++03 mode, and Clang provides variadic templates
even in C++03 mode. So there's effectively no supported compiler that
doesn't support variadic templates.

This effectively gets rid of all uses of _LIBCPP_HAS_NO_VARIADICS, but
some workarounds for the lack of variadics remain.
2020-09-17 11:05:39 -04:00
ogiroux 5b205ff474 Commenting out atomics with padding to unbreak MSAN tests 2020-09-16 16:12:10 -07:00
Louis Dionne 39faf42816 [libc++] Ensure streams are initialized early
When statically linking libc++ on some systems, the streams are not
initialized early enough, which causes all kinds of issues. This was
reported e.g. in http://llvm.org/PR28954, but also in various open
source projects that use libc++.

Fixes http://llvm.org/PR28954.

Differential Revision: https://reviews.llvm.org/D31413
2020-09-16 13:19:16 -04:00
Louis Dionne 583c8ce30c [libc++] Fix broken test for std::any and allocators
The test was not allocating the right number of bytes. This is my fault,
not Marshall's, as I was the one to write the tests for 39c8795141.
2020-09-15 15:01:52 -04:00
Louis Dionne d9c9a74d0d [libc++] Add missing friend keyword
Otherwise, we're declaring a non-static member function, and that
gives errors in C++11 because of the change of semantics between
C++11 and C++14 for non-const constexpr member functions.

This was always intended to be a friend declaration.
2020-09-15 14:21:05 -04:00
Mark de Wever 74a9c6d7e1 [libc++] Add a benchmark for std::map operations
Before tackling http://llvm.org/PR38722, make sure there is a baseline
benchmark.

Differential Revision: https://reviews.llvm.org/D62778
2020-09-15 12:09:29 -04:00
Marshall Clow 39c8795141 [libc++] Use allocator_traits to consistently allocate/deallocate/construct/destroy objects in std::any
https://llvm.org/PR45099 notes (correctly) that we're inconsistent in memory
allocation in `std::any`. We allocate memory with `std::allocator<T>::allocate`,
construct with placement new, destroy by calling the destructor directly, and
deallocate by calling `delete`. Most of those are customizable by the user,
but in different ways.

The standard is silent on how these things are to be accomplished.
This patch makes it so we use `allocator_traits<allocator<T>>` for all
of these operations (allocate, construct, destruct, deallocate).
This is, at least, consistent.

Fixes https://llvm.org/PR45099.

Differential Revision: https://reviews.llvm.org/D81133
2020-09-15 11:04:59 -04:00
Oliver Stannard 2744c2e295 [libcxx] Disable failing test for no-exceptions build
This test tries to create a 2 GiB std::string, catching the bad_alloc
exception if the allocation fails. However, for no-exceptions builds
there is no way for the error to be reported, so this crashes with a
null pointer dereference.

Differential revision: https://reviews.llvm.org/D87682
2020-09-15 14:28:32 +01:00
zoecarver 3ed89b51da [Take 2] [libc++] Make rotate a constexpr.
This patch makes `std::rotate` a constexpr. In doing so, this patch also
updates the internal `__move` and `__move_backward` funtions to be
constexpr.

This patch was previously reverted in ed653184ac because it was missing
some UNSUPPORTED markup for older compilers. This commit adds it.

Differential Revision: https://reviews.llvm.org/D65721
2020-09-14 18:14:46 -04:00
zoecarver ed653184ac Revert "[libc++] Make rotate a constexpr."
This reverts commit 1ec02efee9.
2020-09-14 14:53:17 -07:00
Louis Dionne b3445c839f [libc++][test] Portability fix of std::strstreambuf constructor test
The standard does not require the constructor `strstreambuf(streamsize alsize_arg = 0)`
leave the stream array unallocated when called with parameter `alsize_arg > 0`.
Conformant implementations of this constructor may allocate minimal `alsize_arg`
number of bytes forcing `str()` method to return non-null pointer.

Thanks to Andrey Maksimov for the patch.

Differential Revision: https://reviews.llvm.org/D72465
2020-09-14 17:09:09 -04:00
Nicholas-Baron b552a30283 [libc++] Finish implementing P0202R3
cppreference lists the support for this paper as partial.
I found 4 functions which the paper marks as `constexpr`,
but did not use the appropriate macro.

Differential Revision: https://reviews.llvm.org/D84275
2020-09-14 16:58:49 -04:00
zoecarver 1ec02efee9 [libc++] Make rotate a constexpr.
This patch makes `std::rotate` a constexpr. In doing so, this patch also
updates the internal `__move` and `__move_backward` funtions to be
constexpr.

Reviewed By: ldionne

Differential Revision: https://reviews.llvm.org/D65721
2020-09-14 13:56:48 -07:00
Louis Dionne becf155275 [libc++] Add comment in atomic test to explain why part of it is disabled on Apple 2020-09-14 16:13:25 -04:00
Louis Dionne f06090243d [libc++] Use LLVM 11 instead of trunk on build bots
Somehow the snapshot of LLVM trunk we use was seeing failures.
2020-09-14 15:12:13 -04:00
Louis Dionne 7235326fb2 [libc++] Upgrade the Clang on build bots 2020-09-14 13:52:01 -04:00
Louis Dionne 71a16e40f7 [libcxx] ostream{,buf}_iterator::difference_type changes in C++20
In C++20, since P0896R4, std::ostream_iterator and std::ostreambuf_iterator
must have std::ptrdiff_t instead of void as a difference_type.

Tests by Casey Carter (thanks!).

Differential Revision: https://reviews.llvm.org/D87459
2020-09-14 11:08:09 -04:00
Olivier Giroux 59fc867790 Re-split integral & pointer overloads. Add tests. 2020-09-11 12:13:35 -07:00
Louis Dionne f980ed4184 [libcxx] Remove the 'availability' Lit feature
Instead, use with_system_cxx_lib with various compile-only tests to ensure
that we're getting compile-time errors, as expected. This follows the
lead of ec46cfefe8.
2020-09-11 11:34:49 -04:00
Louis Dionne 4d12d6149c [libc++] NFC: Add missing license to test 2020-09-11 10:15:27 -04:00
Mikhail Maltsev 6af8758ba4 [libcxx] Handle target triples with dashes in platform name
Target triples may contain a dash in the platform name (e.g.
"aarch64-arm-none-eabi"). Account for it when splitting the triple
into components.

Reviewed By: ldionne, #libc

Differential Revision: https://reviews.llvm.org/D87508
2020-09-11 14:42:05 +01:00
Louis Dionne b0ae5332dc [libcxx] Make sure we pass -isysroot when linking AND when compiling 2020-09-10 12:24:11 -04:00
Louis Dionne ec46cfefe8 [libcxx] Simplify back-deployment testing
The needs of back-deployment testing currently require two different
ways of running the test suite: one based on the deployment target,
and one based on the target triple. Since the triple includes all the
information we need, it's better to have just one way of doing things.

Furthermore, `--param platform=XXX` is also supersedded by using the
target triple. Previously, this parameter would serve the purpose of
controling XFAILs for availability markup errors, however it is possible
to achieve the same thing by using with_system_cxx_lib only and using
.verify.cpp tests instead, as explained in the documentation changes.

The motivation for this change is twofold:
1. This part of the Lit config has always been really confusing and
   complicated, and it has been a source of bugs in the past. I have
   simplified it iteratively in the past, but the complexity is still
   there.
2. The deployment-target detection started failing in weird ways in
   recent Clangs, breaking our CI. Instead of band-aid patching the
   issue, I decided to remove the complexity altogether by using target
   triples even on Apple platforms.

A follow-up to this commit will bring the test suite in line with
the recommended way of handling availability markup tests.
2020-09-10 08:17:26 -04:00
Olivier Giroux 11352fa83b Revert a test using padding bits in atomics 2020-09-09 12:14:53 -07:00
Eric Fiselier 1301febe71 [libc++] Fix variant benchmark build for some configurations.
The benchmarks expect to be built in C++17 or newer, but this
isn't always how CMake configures the C++ dialect. Instead
we need to explicitly set the CXX_STANDARD target property.
2020-09-09 14:25:17 -04:00
Olivier Giroux fc4bff0cd3 Update atomic feature macros, synopsis, signatures to match C++20. Improve test coverage for non-lock-free atomics. 2020-09-09 10:00:09 -07:00
Louis Dionne c2f6a00128 [libc++] Allow overriding the cached value of LIBCXX_TEST_CONFIG 2020-09-08 11:29:32 -04:00
Louis Dionne 6454140ab3 [libc++] Make sure we always print all available features
Previously, we'd only print the features added through the new config,
however printing all the features is important for debugging purposes.
2020-09-08 11:18:02 -04:00
Raul Tambre 86bd8f82cc [CMake] Remove dead FindPythonInterp code
LLVM has bumped the minimum required CMake version to 3.13.4, so this has become dead code.

Reviewed By: #libc, ldionne

Differential Revision: https://reviews.llvm.org/D87189
2020-09-08 15:23:23 +03:00
Louis Dionne d0706cfc4c [libc++] Mark std::atomic<_ExtInt> test as unsupported in C++03 2020-09-03 13:28:21 -04:00
John Brawn db574fc7ba [libc++] Make ext-int.verify.cpp test compatible with c++03
Currently the libcxx/atomics/ext-int.verify.cpp test fails when run with
-std=c++03 because there's an extra error due to using list initialization. Fix
this by using parentheses instead.
2020-09-03 18:18:19 +01:00
Louis Dionne 5571467879 [libc++] Avoid including <sys/cdefs.h> on non-Apple platforms in <ctime> 2020-09-02 18:11:26 -04:00
Michael Schellenberger Costa afe8ca8673 [libcxx] Fix whitespace error 2020-09-02 21:44:15 +02:00