Commit Graph

6144 Commits

Author SHA1 Message Date
Sterling Augustine 6c6fba8808 Correctly handle using foo = std::foo inside namespaces.
Summary:
The gdb pretty printer misprints variables declared via
using declarations of the form:

namespace foo {
using string_view = std::string_view;

string_view bar;
}

This change fixes that, by deferring the decision to ignore
types not inside std until after desugaring.

Reviewers: #libc!

Subscribers: broadwaylamb, libcxx-commits

Tags: #libc

Differential Revision: https://reviews.llvm.org/D76816
2020-03-26 11:20:09 -07:00
Eric Fiselier 076773253e Revert "[libc++] Run the builders Docker containers 'as 'buildbot instead of 'root'"
This reverts commit a32b94c6c3.

The buildbot startup scripts need to run as root. The buildbot
worker should have already been running as a different account.
More investigation needed.
2020-03-26 08:08:01 -04:00
Louis Dionne a5fa5f7cb8 [libc++] Do not force the use of -Werror in verify tests
Forcing -Werror and other warnings means that the test suite isn't
actually testing what most people are seeing in their code -- it seems
better and less arbitrary to compile these tests as close as possible
to the compiler default instead.

Removing -Werror also means that we get to differentiate between
diagnostics that are errors and those that are warnings, which makes
the test suite more precise.

Differential Revision: https://reviews.llvm.org/D76311
2020-03-26 07:54:45 -04:00
Shoaib Meenai 4e2679cd12 [libcxx] Fix .gitignore to not exclude test directories
We have several test directories whose names end in .spec. Ensure we
don't accidentally ignore them by removing a section of the .gitignore
that's irrelevant for libc++.

Differential Revision: https://reviews.llvm.org/D69195
2020-03-25 17:52:23 -07:00
Louis Dionne b58902bc72 [libc++] Fix CMake configuration breakage when libc++ is built neither static nor dynamic
Introduced by https://reviews.llvm.org/D72687. This condition can happen
when the tests are not being run at all, and we're only trying to generate
the libc++ headers.
2020-03-25 16:50:19 -04:00
Louis Dionne aec82f9256 [libc++] Require the use of clang-verify in .fail.cpp tests that don't fail without it
Some tests do not fail at all when -verify is not supported, unless some
arbitrary warning flag is added to make them fail. We currently used
-Werror=unused-result to make them fail, but doing so makes the test
suite a lot more inscrutable. It seems better to just disable those
tests when -verify is not supported.

Differential Revision: https://reviews.llvm.org/D76256
2020-03-25 16:48:09 -04:00
Louis Dionne 9223b7f927 [libc++] Add a new %exec substitution
It allows executing arbitrary commands with the same environment as
normal .pass.cpp tests, which is handy.
2020-03-25 16:26:57 -04:00
Louis Dionne f03ac38147 [libc++] Drop custom support for flaky tests from libc++ test suite
Instead, use the builtin support in lit. This makes the libc++ custom
test format slightly closer to the builtin ShTest format in behavior.
2020-03-25 14:41:53 -04:00
Louis Dionne 95977a7634 [libc++] NFC: Remove unused include from test 2020-03-25 14:00:25 -04:00
Louis Dionne a32b94c6c3 [libc++] Run the builders Docker containers 'as 'buildbot instead of 'root' 2020-03-25 12:07:44 -04:00
Sergej Jaskiewicz eed57dd591 [libcxx] Allow tests to link with static libc++abi/libc++ even if the shared version is present
Summary:
This is essentially D71894, but for libc++.

This is needed for running libc++ tests over SSH.

Reviewers: EricWF, ldionne, phosek, mehdi_amini, mclow.lists, jroelofs, bcraig, #libc

Reviewed By: ldionne, phosek, #libc

Subscribers: mgorny, christof, dexonsmith, libcxx-commits

Tags: #libc

Differential Revision: https://reviews.llvm.org/D72687
2020-03-25 15:29:58 +03:00
Louis Dionne 64a9c944fc Revert "[libc++] Build the dylib with C++17 to allow aligned new/delete"
This reverts commit 1ac403bd14, which
broke some non-libc++ build bots because they use an ancient CMake.
2020-03-24 22:53:47 -04:00
Eric Fiselier d6fb02b196 [libc++] Update a bad documentation link 2020-03-24 21:34:07 -04:00
Louis Dionne 7311b27403 [libc++] Install a recent CMake in the Docker build bots 2020-03-24 18:06:56 -04:00
Louis Dionne 1ac403bd14 [libc++] Build the dylib with C++17 to allow aligned new/delete
This allows simplifying the implementation of barriers.

Differential Revision: https://reviews.llvm.org/D75243
2020-03-24 17:48:46 -04:00
Louis Dionne 43a6d285bf [libc++] NFC: Reuse the TEST_CONCAT macro instead of reimplementing one 2020-03-24 15:28:18 -04:00
Louis Dionne ce36c5ab64 [libc++] Fix installation of cxx_experimental
cxx_experimental was never installed because ${experimental_lib} always
expands to an empty target. This seems to have been broken by 97d6fcce4e.
2020-03-24 10:13:39 -04:00
Louis Dionne 3c84aca9b3 [libc++] Bump Clang support for Clang 4
It's hard to imagine someone using a recent version of libc++ with a
roughly 3 years old Clang. Since we're not testing libc++ with Clang 3.5
anyway, claiming support for it is somewhat of a lie.

Note that we don't test Clang 4 either, however I have no reason to bump
the requirement beyond Clang 4 at the moment, whereas removing Clang 3.5
allows simplifying the test suite.

Differential Revision: https://reviews.llvm.org/D76618
2020-03-23 12:17:04 -04:00
zoecarver 278c00c4ff [libc++] [NFC] Test that correct value category is used in scoped_allocator_adaptor::construct
This patch fixes 2586. Just tests. NFC.

Differential Revision: https://reviews.llvm.org/D63050
2020-03-23 09:08:05 -07:00
Louis Dionne 04d48111bf Revert "Remove legacy CMake targets for libcxx and libcxxabi"
This reverts commit f383fb40b. It looks like several of our build bots
are still using the legacy target names, so we'll change those before
we commit this change again.
2020-03-23 11:03:00 -04:00
Louis Dionne f383fb40b1 Remove legacy CMake targets for libcxx and libcxxabi
We've been meaning to remove those targets for a while, and the fix is
simple enough cause they're all just aliases to other targets.

There's no doubt this commit will break some CI systems, however the
fix is trivial.

Differential Revision: https://reviews.llvm.org/D76104
2020-03-23 10:51:23 -04:00
Sylvestre Ledru 72fd1033ea Doc: Links should use https 2020-03-22 22:49:33 +01:00
Eric Fiselier 90c74435d3 [libc++] tolerate missing diagnostic with modules enabled 2020-03-21 16:27:50 -04:00
Eric Fiselier c0e1135fb0 [libc++] Fix URL to llvm github 2020-03-21 10:13:50 -04:00
Eric Fiselier deb5103378 [libc++] Rework buildbot configuration for the greater good.
This commit rewrites/removes the docker files used to create
the libc++ buildbots.

The major changes in this patch are:

1. Delete Dockerfiles used to build compilers. These have moved to
   github.com/efcs/compiler-images

2. Minimize the llvm-buildbot docker image. Instead of running the
buildbots from a committed docker image, the builders now build the
image on startup. This means changes to the docker file automatically
propogate to the builders (within ~24 hours without restart).

3. Version the compilers used by the builders. This means the bots
won't start failing because the apt.llvm.org clang package updated.
2020-03-21 10:02:40 -04:00
Eric Fiselier 05880fc9ae [libc++] fix some non-modular tests 2020-03-21 10:02:17 -04:00
Louis Dionne 1ae737a7c6 [libc++] Temporarily disable an availability test that is broken
The current lit test suite doesn't really allow us to express that the
test should be disabled when testing the trunk variant of libc++, even
if we're running it on a supported macOS. Because of that, the test
is enabled when _LIBCPP_DISABLE_AVAILABILITY is defined, and the test
XPASSes.
2020-03-20 20:08:09 -04:00
Louis Dionne 0feaf22c8a [libc++] Properly handle environment variables with '=' in them 2020-03-20 19:29:01 -04:00
Louis Dionne e22fe98d05 [libc++] Make the %run substitution closer to how .pass.cpp tests are executed
Before this patch, the %run substitution did not contain the same
environment variables as normal `pass.cpp` tests. It also didn't
have the right working directory and the script wasn't aware of
potential file dependencies.

With this change, the combination of %build and %run in a .sh.cpp script
should match how pass.cpp tests are actually executed much more closely.
2020-03-20 18:52:14 -04:00
Louis Dionne 7efbd851ad [libc++] Add a new FILE_DEPENDENCIES parser
Instead of considering all the .dat files to be dependencies of a test,
only consider those that are listed in FILE_DEPENDENCIES.
2020-03-20 14:55:52 -04:00
zoecarver 9e2207a00b [libc++] fix non-builtin is_void implementation
Add the missing closing angle bracket to the call to remove_cv. This is only used when we can't use the builtin implementation.

Fixes: 5ade17e0ca
2020-03-19 11:25:41 -07:00
zoecarver 74494d9992 [libc++] Don't use __is_fundamental in C++03 mode
In C++03 mode, nullptr is defined by libc++, not the compiler so, we can't use __is_fundamental (because it will return false for nullptr).

Fixes: 5ade17e0ca
2020-03-19 10:48:52 -07:00
zoecarver 5ade17e0ca [libc++] Use builtin type traits whenever possible
This patch updates <type_traits> to use builtin type traits whenever
possible to improve compile times.

Differential Revision: https://reviews.llvm.org/D67900
2020-03-19 09:54:53 -07:00
Yunlian Jiang 30ccc2e8d2 [libc++] Add missing visibility annotation for __base
Differential Revision: https://reviews.llvm.org/D48680
2020-03-18 17:16:00 -04:00
Louis Dionne a4ef2a71d3 [libc++] Move some misplaced compile-time flags
Some compilation-only flags were in %flags, but they should have been
in %compile_flags only.
2020-03-17 17:53:20 -04:00
Atmn Patel 51b78a3e06 [libc++] Bugfix to std::binomial_distribution<int>
The current implementation of binomial_distribution is not guaranteed to
converge for certain extreme configurations of the engine and distribution.
This is due to a mistake in the implementation of the algorithm from the
given reference paper. The algorithm in the paper is guaranteed to
terminate but has redundant statements. The current implementation
simplified away the redundancy into a while loop, but it excludes the
return condition of the case where a good sample cannot be returned for
the particular sample being used from the uniform distribution, which is
what causes the infinite loop. This change guarantees termination by
recognizing that a good sample cannot be returned and returning 0 after
breaking the loop. This is also in contrast to the paper because the
return value as specified in the paper violates basic checks in at least
a subset of the extreme cases where the current implementation fails to
terminate. This default return value of 0 is satisfactory for the
extreme case known so far.

Since this is only meant to affect extreme cases where the algorithm
does not terminate anyways, the behavior is expected to remain exactly
the same for all non-extreme cases that have been terminating so far.

Fixes https://llvm.org/PR44847

Differential Revision: https://reviews.llvm.org/D74997
2020-03-17 15:56:16 -04:00
Louis Dionne 3d9e6c42f8 [libc++] Use env to set the tool's environment on Darwin 2020-03-17 15:40:51 -04:00
Dimitry Andric 585a3cc31b Fix -Wdeprecated-copy-dtor and -Wdeprecated-dynamic-exception-spec warnings.
Summary:
The former are like:

libcxx/include/typeinfo:322:11: warning: definition of implicit copy constructor for 'bad_cast' is deprecated because it has a user-declared destructor [-Wdeprecated-copy-dtor]
  virtual ~bad_cast() _NOEXCEPT;
          ^
libcxx/include/typeinfo:344:11: note: in implicit copy constructor for 'std::bad_cast' first required here
    throw bad_cast();
          ^

Fix these by adding an explicitly defaulted copy constructor.

The latter are like:

libcxx/include/codecvt:105:37: warning: dynamic exception specifications are deprecated [-Wdeprecated-dynamic-exception-spec]
    virtual int do_encoding() const throw();
                                    ^~~~~~~

Fix these by using the _NOEXCEPT macro instead.

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

Reviewed By: EricWF, #libc

Subscribers: dexonsmith, libcxx-commits

Tags: #libc

Differential Revision: https://reviews.llvm.org/D76150
2020-03-17 18:59:54 +01:00
Casey Carter 3609110967 Implement _LIBCPP_SUPPRESS_DEPRECATED_XXX when testing MSVC's STL
...to properly silence clang deprecation warnings in `test/std/utilities/meta/meta.trans/meta.trans.other/result_of11.pass.cpp`.
2020-03-16 09:50:23 -07:00
Dan Albert 9c5d0ea678 Revert "Revert "Move more tests to globalMemCounter and reset.""
Test regressions not included this time :)

This reverts commit 1ed671082ef4b13d44e2c0f42ddedf9d450258a7.
2020-03-13 17:07:58 -07:00
Dan Albert 05749acfd3 Revert "Move more tests to globalMemCounter and reset."
Not all of these changes were correct. Will reland appropriate parts
in a follow up.

This reverts commit 4a792965de.
2020-03-13 13:26:35 -07:00
Dan Albert 14d2d8c976 Allow site-specific test_exec_root.
Reviewers: EricWF, mclow.lists, #libc, ldionne

Reviewed By: #libc, ldionne

Subscribers: dexonsmith, ldionne, libcxx-commits

Tags: #libc

Differential Revision: https://reviews.llvm.org/D76092
2020-03-13 12:23:49 -07:00
Dan Albert adefcc8ab5 Revert "Revert "Update system_error tests for more platforms.""
This time using old fashioned starts_with.

This reverts commit d4a8c3f251.
2020-03-13 12:11:27 -07:00
Dan Albert d4a8c3f251 Revert "Update system_error tests for more platforms."
Can't use std::string::starts_with in tests.

This reverts commit a9740ff158.
2020-03-12 18:09:44 -07:00
Dan Albert a9740ff158 Update system_error tests for more platforms.
Reviewers: EricWF, mclow.lists, #libc, ldionne

Reviewed By: #libc, ldionne

Subscribers: dexonsmith, libcxx-commits, cfe-commits

Tags: #libc

Differential Revision: https://reviews.llvm.org/D35732
2020-03-12 17:37:46 -07:00
Dan Albert 4a792965de Move more tests to globalMemCounter and reset.
Summary:
Android's libc uses new/delete internally and these are counted, so
the counter needs to be reset to zero at the start of the test.

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

Reviewed By: #libc, ldionne

Subscribers: dexonsmith, libcxx-commits

Tags: #libc

Differential Revision: https://reviews.llvm.org/D76091
2020-03-12 17:26:31 -07:00
Mark de Wever 56926a9146 Revert "[libcxx] Enable C++17 for the benchmarks."
It seems several build bots have issues with setting the CXX_STANDARD
property to 17.

This reverts commit d184d02263.
2020-03-12 22:23:46 +01:00
Mark de Wever d184d02263 [libcxx] Enable C++17 for the benchmarks.
The benchmarks are intended to be build with C++17 but the
CMAKE_CXX_STANDARD in the LLVM forces the build to use C++14 by default.
This fixes the issue by setting the CXX_STANDARD property of the benchmark
targets.

The CMake documentation is not clear whether this will use the C++1z
fallback for older compilers. So this may break the benchmarks if somebody
uses the benchmarks with pre C++17 compilers with the C++1z fallback.

Differential Revision: https://reviews.llvm.org/D75955
2020-03-12 21:35:00 +01:00
Marek Kurdej 05343588e3 [libc++] [P0646] Add feature-test macro for __cpp_lib_list_remove_return_type.
Summary: The return type modification has already been implemented in rL364840 and rL365290.

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

Reviewed By: ldionne

Subscribers: christof, dexonsmith, libcxx-commits

Tags: #libc

Differential Revision: https://reviews.llvm.org/D70275
2020-03-12 11:06:49 +01:00
Louis Dionne ee87b22a12 [libc+++] Mark two future tests as being FLAKY
They are timing sensitive.
2020-03-11 18:12:59 -04:00