Commit Graph

6559 Commits

Author SHA1 Message Date
Vladimir Vereschaka 43c4afb56f Revert "[libc++] Migrate Lit platform detection to the DSL"
This reverts commit 3ea9450bda.

The commit fails the remote library tests on the toolchain builders:

http://lab.llvm.org:8011/builders/llvm-clang-win-x-armv7l
http://lab.llvm.org:8011/builders/llvm-clang-win-x-aarch64
2020-06-13 12:50:43 -07:00
Casey Carter 8b828e9838 [libcxx][test] Silence MSVC signed-to-unsigned implicit conversion warnings 2020-06-12 14:54:51 -07:00
Louis Dionne 9c2c698fd4 [libc++] Add missing sitedir to local Lit config
It relied on the site dir being added by a previous config file.
2020-06-12 14:58:54 -04:00
Casey Carter 6ffa6a300d [libcxx][test] include <algorithm> for is_permutation 2020-06-12 11:54:03 -07:00
Louis Dionne a9b9f797e2 [libc++] Remove obsolete 'newlib' Lit Feature
The feature isn't defined anywhere, so it's effectively dead.
2020-06-12 14:08:18 -04:00
Louis Dionne 3ea9450bda [libc++] Migrate Lit platform detection to the DSL
As an important fly-by fix, also make sure we set those features to their
value on the target we run on, not on the host compiling the test suite.
2020-06-12 13:59:45 -04:00
Louis Dionne db8255aee7 [libc++] Parse commands inside _executeScriptInternal to remove duplication
Instead of parsing the command each time prior to calling _executeScriptInternal,
do it once inside _executeScriptInternal.
2020-06-12 12:03:15 -04:00
Louis Dionne c8c7bb31f2 [libc++] Remove redundant UNSUPPORTED annotation for the GDB pretty-printer tests
That test is already only enabled if LIBCXX_TEST_GDB_PRETTY_PRINTERS is
enabled, which isn't the default. If someone turns on that option on
Windows, they should be able to run the test and see whatever failure
happens.
2020-06-12 10:57:11 -04:00
Louis Dionne f998e0d679 [libc++] Make executor scripts executable
This allows running the scripts directly, without running them through
Python.
2020-06-12 10:29:04 -04:00
Louis Dionne 96e6cbbf94 [libc++] Allow specifying arbitrary custom executors with the new format
The integration between CMake and executor selection in the new format
wasn't very flexible -- only the default executor and SSH executors were
supported.

This patch makes it possible to specify arbitrary executors with the new
format. With the new testing format, a custom executor is just a script
that gets called with a command-line to execute, and some arguments like
--env, --codesign_identity and --execdir. As such, the default executor
is just run.py.

Remote execution with the SSH executor can be achived by specifying
LIBCXX_EXECUTOR="<path-to-ssh.py> --host <host>". Similarly, arbitrary
scripts can be provided.
2020-06-11 16:24:29 -04:00
Louis Dionne 1fc5010d6b [libc++] Consider everything inside %T to be a dependency of each test
Instead of passing file dependencies individually, assume that the
whole content of the unique test directory is a dependency. This
simplifies the test harness significantly, by making %T the directory
that contains everything required to run a test. This also removes the
need for the %{file_dependencies} substitution, which is removed by this
patch.

Furthermore, this patch also changes the harness to execute tests locally
inside %T, so as to avoid creating a separate directory for no purpose.
2020-06-10 22:38:05 -04:00
Casey Carter 24836f8cd0 [libcxx][test] MSVC's __is_trivially_copyable is fixed in VS 16.7
... so we can disable `TEST_WORKAROUND_C1XX_BROKEN_IS_TRIVIALLY_COPYABLE`.
2020-06-10 13:55:33 -07:00
Louis Dionne 4e813bbdf3 [libc++] Make sure tests are run in a unique directory
This will allow simplifying executors by always just copying the whole
%T, and assuming that all file dependencies are contained in it.

Superseeds https://reviews.llvm.org/D78245, which tried to make %T unique
in Lit, but which encountered push back.
2020-06-10 16:19:10 -04:00
Joel E. Denny d9a42ec98a [libc++] Work around gcc/Power9 bug in `include/thread`
This fixes PR39696, which breaks the libcxx build with gcc (I tested
7.5.0) on Power9.  This fix was suggested at

https://bugs.llvm.org/show_bug.cgi?id=39696#c38

but never applied.  It just reverts 0583d9ea8d, which reverses
components of the original fix in 3bf63cf3b3, which is correct.

Fixes https://llvm.org/PR39696

Reviewed By: ldionne

Differential Revision: https://reviews.llvm.org/D81438
2020-06-10 12:40:43 -04:00
Louis Dionne 756db3084b [libc++] Install locales in the build bot Docker images
This allows running the locale tests on the build bots.
2020-06-10 09:37:14 -04:00
Mikhail Maltsev 4e94bdceb0 [libcxx] Fix std::vector construct_iter_iter.pass.cpp test (C++98/03)
The test is failing on 32-bit targets in C++03 mode. Clang produces
the following warning: 'integer literal is too large to be represented
in type 'long' and is subject to undefined behavior under C++98,
interpreting as 'unsigned long'; this literal will have type 'long
long' in C++11 onwards [-Wc++11-compat]' which is promoted to an error
and causes the test to fail.

There have been no changes in the test itself since 2019, so it looks
like the diagnostic has been updated.

Differential Revision: https://reviews.llvm.org/D81559
2020-06-10 14:27:33 +01:00
Louis Dionne a2439bebe1 [libc++] Translate the enable_filesystem parameter to the DSL 2020-06-10 08:54:42 -04:00
Louis Dionne 01a0c3b49a [libc++] Define the no-exceptions Lit feature using the DSL
Instead of using logic in config.py, use the DSL to grab the no-exceptions
user-configurable parameter from the Lit command-line invocation.
2020-06-10 08:03:51 -04:00
Louis Dionne 78e266efab [libc++] Allow picking Lit parameters from the config
Unlike parameters in litConfig.params, the config isn't shared across
all test suites. For example, if we want to enable exceptions in the
tests for libcxxabi, but not in the tests for libcxx, we can't set the
enable_exceptions parameter in the litConfig object, cause it will be
used by both. Instead, setting it inside the config object solves that
problem.
2020-06-10 08:02:07 -04:00
Louis Dionne d9dec697cb [libc++][CMake] Add CMake caches for commonly supported configurations
This commit adds CMake caches for the various configurations of libc++
that are tested by our build bots.

Differential Revision: https://reviews.llvm.org/D81293
2020-06-09 14:52:14 -04:00
Louis Dionne 7fb40e1569 [libc++] Fix too stringent availability markup for bad_optional_access
The availability markup for bad_optional_access marked it as being added
in MacOS 10.14 and aligned releases, however it appears to have been added
in Mac OS 10.13 and aligned releases.
2020-06-09 14:39:51 -04:00
Louis Dionne 1f48f8f6e2 [libc++] Avoid UB in year_month_day_last::day() for incorrect months
This effectively implements the resolution of LWG3231, which mandates
that calling year_month_day_last::day() on an invalid year_month_day_last
is unspecified behavior. Before this change, it was undefined behavior.

Differential Revision: https://reviews.llvm.org/D81477
2020-06-09 13:43:13 -04:00
Louis Dionne babd3aefc9 [libc++] Remove workarounds for the lack of clock_gettime on older macOS platforms
This increases the Mac OS requirement for building libc++ to 10.12.
Note that it doesn't change whether the *headers* still support older
platforms -- it's only that macOS >= 10.12 is required to build the
dylib from sources.

Differential Revision: https://reviews.llvm.org/D74489
2020-06-09 12:57:03 -04:00
Louis Dionne cb347a1106 [libc++] Remove assertion in year_month_day_last::day()
This reverts commit 0c148430cf, which added an assertion in day().
The Standard doesn't allow day() to crash -- instead it says that the
result is unspecified.

Differential Revision: https://reviews.llvm.org/D70346
2020-06-09 10:46:13 -04:00
Louis Dionne 60cde7bbb7 [libc++] Improve tests for iterators.operations
Reduce duplication between the constexpr and the non-constexpr test cases,
and add tests for the return type of the various operations.
2020-06-08 14:59:35 -04:00
zoecarver b1b64dbef1 [NFC] [libcxx] Remove shared_ptr's no-rvalue unique_ptr converting constructor.
All compilers supported by libc++ have rvalues in C++03 mode so, there is no need for this non-rvalue overload.

Differential Revision: https://reviews.llvm.org/D80881
2020-06-08 09:49:21 -07:00
Louis Dionne 339156ad63 [libc++] Avoid passing -xc++ in Lit feature detection
Otherwise, if %{flags} contain other files like static libraries, those
files are treated as C++ source files instead of object files, and the
compiler gets all confused.
2020-06-05 13:41:48 -04:00
Louis Dionne 3864ee7722 [libc++] Translate locale detection to the DSL 2020-06-05 09:50:00 -04:00
Louis Dionne e0184357fc [libc++] Link against libatomic when it is found
Before this patch, we tried detecting whether small atomics were available
without linking against libatomic. However, that's not really what we want
to know -- instead, we want to know what's required in order to support
atomics fully, which is to link against libatomic when it's provided.

That is both much simpler, and it doesn't suffer the problem that we would
not link against libatomic when small atomics didn't require it, which
lead to non-lockfree atomics never working.

Furthermore, because we understand that some platforms might not want to
(or be able to) ship non-lockfree atomics, we add that notion to the test
suite, independently of a potential extern library.

After this patch, we therefore:
(1) Link against libatomic when it is provided
(2) Independently detect whether non-lockfree atomics are supported in
    the test suite, regardless of whether that means we're linking against
    an external library or not (which is an implementation detail).

Differential Revision: https://reviews.llvm.org/D81190
2020-06-05 09:28:44 -04:00
Louis Dionne cc78f1e0fe [libc++] Avoid warning for large types with std::atomic in the test suite
It is legitimate for the test suite to use types that are slow to use
with std::atomic, since we need coverage for those too. If we don't
disable the warning, it is promoted to an error, which prevents us
from testing such types.
2020-06-04 14:06:04 -04:00
Louis Dionne 68e4e8a8d0 [libc++] Disable LLVM benchmarks in the Apple build 2020-06-04 12:03:25 -04:00
Louis Dionne b68bf11efc [libc++] Merge the Apple install-libcxx and libcxxabi scripts
Also, refactor the now-merged script to remove code duplication in the
creation of universal dylibs.
2020-06-04 11:20:03 -04:00
Louis Dionne 39a116ee07 [libc++] Move away from the standalone build for Apple libc++ and libc++abi 2020-06-04 10:19:38 -04:00
Louis Dionne 2bbfa6b02b [libc++] Fix test broken in C++03 due to requiring C++11 features from vector 2020-06-03 12:59:17 -04:00
Louis Dionne 62cfa3a0b5 [libc++] Support move construction and assignment in <thread> in C++03
Libc++ provides support for <thread> in C++03 as an extension. Furthermore,
it does not support any compiler that doesn't have rvalue references. It
is hence possible to provide the move constructor and move assignment
operator in C++03.
2020-06-03 12:16:27 -04:00
David Zarzycki e25f01be0c [libcxx testing] Fix bot failure in my last commit 2020-06-03 11:28:14 -04:00
David Zarzycki 6ce71d2dad [libcxx testing] Fix more bogus timeouts: condvarany/notify_all.pass.cpp
On slow/busy machines, timing cannot be guaranteed.
2020-06-03 10:28:12 -04:00
Louis Dionne 31cbe0f240 [libc++] Remove the c++98 Lit feature from the test suite
C++98 and C++03 are effectively aliases as far as Clang is concerned.
As such, allowing both std=c++98 and std=c++03 as Lit parameters is
just slightly confusing, but provides no value. It's similar to allowing
both std=c++17 and std=c++1z, which we don't do.

This was discovered because we had an internal bot that ran the test
suite under both c++98 AND c++03 -- one of which is redundant.

Differential Revision: https://reviews.llvm.org/D80926
2020-06-03 09:37:22 -04:00
David Zarzycki 579d6ed48c [libcxx testing] Fix lingering bugs in notify_one.pass.cpp
This test is arguably fatally flawed, at least as long as C++ condition
variables are just trivial wrappers around POSIX. I've added some notes
to the test for future authors to consider.
2020-06-03 08:50:27 -04:00
Olivier Giroux 06aaf0b343 Updated synopsis of <atomic> to match what is implemented 2020-06-01 14:30:13 -07:00
Louis Dionne 23776a178f [libc++] Add assertions on OOB accesses in std::array when the debug mode is enabled
Like we do for empty std::array, make sure we have assertions in place
for obvious out-of-bounds issues in std::array when the debug mode is
enabled (which isn't by default).
2020-06-01 16:37:39 -04:00
Louis Dionne 66a14d151e [libc++] NFC: Minor refactoring in std::array 2020-06-01 16:28:44 -04:00
David Zarzycki 1c4238e7a0 [libcxx testing] Stop using arbitrary timeouts in one test
On a busy and/or slow system, 100ms might not be long enough. Instead,
we now use atomic variables to communicate between threads.
2020-05-30 06:09:11 -04:00
Louis Dionne 7265ff928a [libc++] Fix issues with the triviality of std::array
The Standard is currently unimplementable. We have to pick between:

1. Not implementing constexpr support properly in std::array<T, 0>
2. Making std::array<T, 0> non-trivial even when T is trivial
3. Returning nullptr from std::array<T, 0>::begin()

Libc++ initially picked (1). In 77b9abfc8e, we started implementing constexpr properly, but lost the guarantee of triviality. Since it seems like both (1) and (2) are really important, it seems like (3) is the only viable option for libc++, after all. This is also what other implementations are doing.

This patch moves libc++ from (1) to (3).

It also:
- Improves the test coverage for the various ways of initializing std::array
- Adds tests for the triviality of std::array
- Adds tests for the aggregate-ness of std::array

Reviewed By: #libc, miscco, EricWF, zoecarver

Differential Revision: https://reviews.llvm.org/D80821
2020-05-29 16:32:55 -07:00
Louis Dionne d0fcdcd28f [libc++] Fix the LIBCXX_HAS_MERGED_TYPEINFO_NAMES_DEFAULT setting
When the __config_site header is generated, but LIBCXX_HAS_MERGED_TYPEINFO_NAMES_DEFAULT
wasn't specified, _LIBCPP_HAS_MERGED_TYPEINFO_NAMES_DEFAULT would be defined
to 0, which was the NonUnique RTTI comparison implementation. The intent
was to use the Unique RTTI comparison implementation in that case, which
caused https://llvm.org/PR45549.

Instead, use a proper "switch" to select the RTTI comparison implementation.
Note that 0 can't be used as a value, because that is treated the same
by CMake as a variable that is just not defined.

Differential Revision: https://reviews.llvm.org/D80037
2020-05-29 06:14:30 -04:00
Louis Dionne ebddf90a4e [libc++] NFC: Remove outdated numbering in <bit> synopsis 2020-05-28 14:31:21 -04:00
Louis Dionne 77b9abfc8e [libc++] Complete overhaul of constexpr support in std::array
This commit adds missing support for constexpr in std::array under all
standard modes up to and including C++20. It also transforms the <array>
tests to check for constexpr-friendliness under the right standard modes.

Fixes https://llvm.org/PR40124
Fixes rdar://57522096
Supersedes https://reviews.llvm.org/D60666

Differential Revision: https://reviews.llvm.org/D80452
2020-05-28 12:31:06 -04:00
Louis Dionne f46bb9dd5c [NFC] Reformat TEST_FOO macros in test_macros.h
To make them easier to read and to make it easier to add new ones.
2020-05-27 16:54:43 -04:00
Marek Kurdej d1dbda10ce [libc++] [LWG3201] Update status page: lerp should be marked noexcept.
Summary: Update status page and test synopsis. Add synopsis in <cmath>.

Reviewed By: ldionne, #libc

Differential Revision: https://reviews.llvm.org/D80456
2020-05-25 22:28:21 +02:00
zoecarver 37ef15143a [libcxx] Fix C++14 and up constexpr members in MoveOnly.
Summary: a4b8ee6 made all MoveOnly members constexpr but, some members and constructors contain expressions that are only valid in C++14 and later. This patch prefixes those methods and constructors with TEST_CONSTEXPR_CXX14.

Reviewers: ldionne, #libc!

Subscribers: dexonsmith, libcxx-commits

Tags: #libc

Differential Revision: https://reviews.llvm.org/D80482
2020-05-25 11:38:24 -07:00
Sergej Jaskiewicz b62ce9e05d Re-commit "[libc++] [test] Generate static_test_env on the fly"
Don't use std::filesystem APIs for CWDGuard, use POSIX functions
instead. This way the tests don't rely on the correctness of
the functionality they're testing.

Differential Revision: https://reviews.llvm.org/D78200
2020-05-25 19:13:16 +03:00
zoecarver 6e48a6e407 [libcxx] Fix deprecation warning by suppressing deprecated around
__test_has_construct.

In C++17 some tests started failing after a521532aa1. This fixes those errors by suppressing the deprecation warning when calling `construct` in `__test_has_construct`. This is the same solution as `__has_destroy_test` already uses.

Reviewers: ldionne, #libc!

Subscribers: dexonsmith, libcxx-commits

Tags: #libc

Differential Revision: https://reviews.llvm.org/D80481
2020-05-23 14:33:10 -07:00
zoecarver a521532aa1 [NFC] Remove non-variadic overloads of allocator_traits::construct.
Summary:
Libcxx only supports compilers with variadics. We can safely remove all "fake" variadic overloads of allocator_traits::construct.

This also provides the correct behavior if anything other than exactly one argument is supplied to allocator_traits::construct in C++03 mode.

Reviewers: ldionne, #libc!

Subscribers: dexonsmith, libcxx-commits

Tags: #libc

Differential Revision: https://reviews.llvm.org/D80067
2020-05-23 14:03:47 -07:00
Marek Kurdej 174322c273 [libc++] Mark __cpp_lib_hardware_interference_size as unimplemented. This fxes bug PR41423.
Summary:
As described in the bug report:
The commit a8b9f59e8caf378d56e8bfcecdb22184cdabf42d "Implement feature test macros using a script" added test features macros for libc++. Among others, it added `__cpp_lib_hardware_interference_size`. However, there is nothing like std::hardware_constructive_interference_size nor std::hardware_destructive_interference_size, that should be in header <new>.

* https://bugs.llvm.org/show_bug.cgi?id=41423

Reviewed By: ldionne, #libc

Differential Revision: https://reviews.llvm.org/D80431
2020-05-23 14:33:50 +02:00
Louis Dionne 485b9083fe [libc++] Mark __u64toa and __u32toa as noexcept
The two functions don't throw, and the generated code is better when
we explicitly tell the compiler that the functions are noexcept. This
isn't an ABI break because the signatures of the functions stay the
same with or without noexcept.

Fixes https://llvm.org/PR46016

Differential Revision: https://reviews.llvm.org/D80379
2020-05-22 16:11:44 -04:00
Louis Dionne 861b526933 [libc++] Fix broken tuple tests
The tests had copy-paste errors which started showing when an
unused-variable warning started being emitted after we made
the MoveOnly type constexpr (in a4b8ee6422).
2020-05-22 15:33:47 -04:00
Louis Dionne a4b8ee6422 [libc++] Make MoveOnly constexpr-friendly
This is necessary when writing constexpr tests.
2020-05-22 15:18:07 -04:00
Louis Dionne 0161874c04 [libc++] NFC: Inline array<T,N>::at methods inside the class
All other methods are defined in the class, so this increases consistency.
2020-05-22 09:24:07 -04:00
Marek Kurdej 0c148430cf Reland [libc++] [LWG3321] Mark "year_month_day_last::day() specification does not cover !ok() values" issue as "Nothing to do", but add assertion.
Summary:
This LWG issue states that the result of `year_month_day_last::day()` is implementation defined if `ok()` is `false`.
However, from user perspective, calling `day()` in this situation will lead to a (possibly difficult to find) crash.
Hence, I have added an assertion to warn user at least when assertions are enabled.

Reviewed By: ldionne, #libc

Differential Revision: https://reviews.llvm.org/D70346
2020-05-21 21:55:38 +02:00
Louis Dionne 8f555780ef [libc++] Link back-deployment tests against the latest libc++ and libc++abi
Instead of linking the tests against a library in some version of the
SDK, always link against the latest library, but still run against the
specified back-deployment target dylib.

This makes more sense since what we're really trying to test is that
the current library can be used to produce binaries that run on some
deployment target -- not that linking against the library in some
previous SDK makes that possible.

This solves an additional issue that when linking against a system dylib,
the -rpath argument given to the tests is ignored because the install_name
of the system library we link against is absolute.

rdar://63241847
2020-05-21 14:47:04 -04:00
David Nicuesa 3411a1a920 Fix compile for -DLIBCXX_BUILD_EXTERNAL_THREAD_LIBRARY
Summary: Compilation with  -DLIBCXX_BUILD_EXTERNAL_THREAD_LIBRARY was failing due to missing declarations of functions used in libcxx/include/atomic. The lines this commit affects are the places where those functions are defined, now moved to be always defined.

Reviewers: #libc, ldionne

Reviewed By: #libc, ldionne

Subscribers: miyuki, dexonsmith, ldionne, jfb, libcxx-commits

Tags: #libc

Differential Revision: https://reviews.llvm.org/D80372
2020-05-21 13:48:59 +01:00
Louis Dionne 9f19cc8cac [libcxx][test] Portability fix for some locale-dependent tests.
Tests for `std::system_error` constructor marked as slightly non-portable.
One (but not the only one) reason for such non-portability is that these
tests assume the default locale to be set to "C" (or "POSIX").

However, the default locale for the process depends on OS and
environment. This patch adds explicit setting of the correct
locale expected by the tests.

Thanks to Andrey Maksimov for the patch.

Differential Revision: https://reviews.llvm.org/D72456
2020-05-20 14:35:18 -04:00
Jan Wilken Dörrie 416b1560c5 [libcxx] Remove swap for std::span
This change removes both the member function swap and the free function
overload of swap for std::span. While swap is a member and overloaded
for every other container in the standard library [1], it is neither a
member function nor a free function overload for std::span [2].
Thus the corresponding implementation should be removed.

[1] https://eel.is/c++draft/libraryindex#:swap
[2] https://eel.is/c++draft/span.overview

Differential Revision: https://reviews.llvm.org/D69827
2020-05-20 14:34:21 -04:00
zoecarver ca5bff18fc [NFC] Remove non-rvlaue non-variadic allocator::construct overloads.
Summary: All supported compilers have rvalues and variadics so we can safely remove the overloads of allocator::construct which are only enabled on compilers without rvalues and variadics.

Reviewers: ldionne, #libc!

Subscribers: dexonsmith, libcxx-commits

Tags: #libc

Differential Revision: https://reviews.llvm.org/D80068
2020-05-19 17:25:00 -07:00
zoecarver b8998ab9c2 [NFC] Remove non-rvlaue non-variadic allocator::construct overloads.
Summary: All supported compilers have rvalues and variadics so we can safely remove the overloads of allocator::construct which are only enabled on compilers without rvalues and variadics.

Reviewers: ldionne, #libc!

Subscribers: dexonsmith, libcxx-commits

Tags: #libc

Differential Revision: https://reviews.llvm.org/D80068
2020-05-19 17:21:35 -07:00
zoecarver 21d4050e2c Mark shared_ptr::__create_with_control_block as noexcept.
Summary: The default constructor for shared_ptr and shared_ptr::__enable_weak_this are both noexcept so, shared_ptr::__create_with_control_block can also be marked noexcept.

Reviewers: ldionne, #libc!

Subscribers: dexonsmith, libcxx-commits

Tags: #libc

Differential Revision: https://reviews.llvm.org/D80070
2020-05-19 17:17:16 -07:00
zoecarver c98648a175 [NFC] Add _EnableIfLValueCallable and move reference out of __callable.
Summary: In std::functional moves the reference out of the `__callable` implementation and replaces `_EnableIfCallable` with `_EnableIfLValueCallable` (`_EnableIfLValueCallable` passes `__callable` an lvalue reference type).

    Reviewers: ldionne, #libc!

    Subscribers: dexonsmith, libcxx-commits

    Tags: #libc

    Differential Revision: https://reviews.llvm.org/D80071
2020-05-19 17:15:28 -07:00
Michael Schellenberger Costa c579ab9962 [libcxx][type_traits] Add C++20 changes to common_type
Summary: This already implements the expected changes for LWG-3205

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

Reviewed By: #libc, ldionne

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

Tags: #libc

Differential Revision: https://reviews.llvm.org/D74350
2020-05-18 14:06:32 +02:00
David Zarzycki a675c1dee4 [libcxx testing] Remove ALLOW_RETRIES from lock_guard tests
These two tests were clumsily using time measurements to determine
whether std::lock_guard was working correctly. In practice, this
approach merely verified that the underlying lock properly waits.

Now these two tests verify that lock is acquired, not dropped
prematurely, and finally, actually dropped at the end of the scope.
2020-05-18 07:44:16 -04:00
David Zarzycki 3f66bb2017 [libcxx testing] Remove ALLOW_RETRIES from last futures test
Like other uses of ALLOW_RETRIES, this test tried to verify that an API
returned "quickly" but quick is not safe to define given slow and/or
busy machines.

Instead, we now verify that these "wait" APIs actually wait, which the
old test did not.
2020-05-16 07:11:49 -04:00
Casey Carter 634a0acb30 Cleanup some test issues:
* improve coverage in `span`'s "conversion from `std::array`" test, while eliminating MSVC diagnostics about `testConstructorArray<T>() && testConstructorArray<const T, T>()` being redundant when `T` is already `const`.

* Remove use of `is_assignable` that triggers UB due to an insufficiently-complete type argument in `std::function`'s assignment operator test.

* Don't test that `shared_ptr` initialization from an rvalue triggers the lvalue aliasing constructor on non-libc++; this is not the case for Standard Libraries that implement LWG-2996. (Ditto, I'd simply remove this but it's your library ;).)

Differential Revision: https://reviews.llvm.org/D80030
2020-05-15 15:15:47 -07:00
Louis Dionne 16f5ce5a74 [libc++] Remove -ftemplate-depth when running tests
It doesn't appear to be needed anymore with the Clang on our build bots.
2020-05-15 14:21:29 -04:00
Louis Dionne ddacd370c5 [libc++] Do not set the runtime library path with DYLD_LIBRARY_PATH
We already set it using -rpath when linking test executables, and using
DYLD_LIBRARY_PATH causes problems when running other commands that
shouldn't run against the just-built libc++ (e.g. `ls` in a ShTest).

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

The back-deployment roots were updated to match this change.
2020-05-15 12:16:02 -04:00
Louis Dionne 04c89c7fca [libc++] Centralize where we set the libc++ and libc++abi paths in config.py
It's just confusing to have them all over the place.
2020-05-15 11:45:26 -04:00
Marek Kurdej 182adf120c [libc++] [span] [P1976] Update status page. NFC
It was implemented by commit 6d2599e4f7 "[libcxx][span] Implement P1976R2".
2020-05-15 14:35:15 +02:00
Michael Schellenberger Costa f58e78f992 [libcxx][span] trivial whitespace fix to test commit rights
Reviewers: #libc!, miscco

Reviewed By: miscco

Subscribers: broadwaylamb, libcxx-commits

Tags: #libc

Differential Revision: https://reviews.llvm.org/D79986
2020-05-15 09:54:41 +02:00
zoecarver 8f2cc889b0 [libcxx] [NFC] Add more reinterpret_pointer_cast tests.
* Add test for inheritance.
 * Test value is preserved through cast.
2020-05-14 12:04:05 -07:00
Michael Schellenberger Costa ab9f11168f [libcxx][span] Implement solution to LWG-3255
This implements the relaxed requirements on the std::array constructors of span,
where the type only needs to be convertible to the element type of the span.

Note that the previous tests were not sufficient, as the const array<T, n> constructor
was only tested for compile time and the array<T, N> only during runtime.

Restructure the tests so that we can test conversions as well as both constructors.

Differential Revision: https://reviews.llvm.org/D75706
2020-05-14 10:50:44 -04:00
Michael Schellenberger Costa 79941086fb [libc++][span] SFINAE span default constructor on Extent == 0
The default constructor of a static span requires _Extent == 0 so
SFINAE it out rather than using a static_assert

Differential Revision: https://reviews.llvm.org/D71994
2020-05-14 09:35:07 -04:00
Michael Schellenberger Costa c5ff4031c6 [libcxx][span] Remove const_iterator from std::span
This implements the resolution to LWG-3320.

Differential Revision: https://reviews.llvm.org/D75642
2020-05-14 08:34:32 -04:00
Michael Schellenberger Costa c73a491d10 [libcxx][span] Remove tuple interface
This implements P2116 by removing the tuple interface from std::span.

Differential Revision: https://reviews.llvm.org/D75640
2020-05-14 08:25:49 -04:00
John Brawn 4d25f4453d [libc++] Adjust how we guard the inclusion of unistd.h
unistd.h isn't guaranteed to exist when the target isn't Windows, in
particular if the target is bare-metal (i.e. no operating system).
Handle this by using __has_include instead, though in
filesystem/operations.cpp we already unconditionally include it so
just remove the extra include.

Differential Revision: https://reviews.llvm.org/D79784
2020-05-14 11:53:12 +01:00
David Zarzycki 1858953395 [libcxx testing] Remove ALLOW_RETRIES from two futures tests
These two tests do not use the "thread sleeps X milliseconds" pattern
that other libcxx tests use, so all we can do in order to remove
ALLOW_RETRIES workaround is remove the assumption that measuring the
"quick" return of `wait()` is possible (it is not). Let the test harness
verify overall that `wait()` does not hang.

As a bonus, have the spin-waiting threads `yield()`, which is what well
behaved code should do.
2020-05-14 06:18:23 -04:00
Louis Dionne e7bdfba4f0 [libc++] Explicitly list Lit features from the config_site header
When grepping for unused features in the test suite, we will now find
those features and where they are defined, as opposed to thinking they
are dead features.
2020-05-13 16:17:22 -04:00
Michael Schellenberger Costa 6d2599e4f7 [libcxx][span] Implement P1976R2
This resolves the NB comment about the construction of a fixed-size span
from a dynamic range.

Differential Revision: https://reviews.llvm.org/D74577
2020-05-13 09:52:47 -04:00
Marek Kurdej ab61fe4150 Revert "[libc++] [LWG3321] Mark "year_month_day_last::day() specification does not cover !ok() values" issue as "Nothing to do", but add assertion."
This reverts commit e25a2601aa.
It was failing due to _LIBCPP_ASSERT throwing in a method marked noexcept.
2020-05-13 13:16:43 +02:00
David Zarzycki 1febe28982 [libcxx testing] Remove ALLOW_RETRIES from wait_for futures test
This test tried to verify that "wait()" returned quickly but "quick" is
impossible to define given a busy and/or slow system.

Instead, I've refactored the test to verify that `wait()` actually
waits which the old test did not verify.
2020-05-13 06:47:29 -04:00
Marek Kurdej e25a2601aa [libc++] [LWG3321] Mark "year_month_day_last::day() specification does not cover !ok() values" issue as "Nothing to do", but add assertion.
Summary:
This LWG issue states that the result of `year_month_day_last::day()` is implementation defined if `ok()` is `false`.
However, from user perspective, calling `day()` in this situation will lead to a (possibly difficult to find) crash.
Hence, I have added an assertion to warn user at least when assertions are enabled.
I am however not aware of the libc++ stand on the desired behaviour.

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

Reviewed By: ldionne, #libc

Subscribers: christof, dexonsmith, libcxx-commits

Tags: #libc

Differential Revision: https://reviews.llvm.org/D70346
2020-05-13 11:45:55 +02:00
zoecarver 8aa2266fd8 [libcxx] Constrain function assignment operator (2574).
This patch fixes LWG issue 2574.

Differential Review: https://reviews.llvm.org/D62928
2020-05-12 18:57:50 -07:00
Casey Carter 2c861e8a12 [libc++][test] Properly mark libc++-only XFAILs
These tests PASS on libstdc++ and MSVC.
2020-05-12 16:11:22 -07:00
zoecarver ce195fb22b [libcxx] Re-commit: shared_ptr changes from library fundamentals (P0414R2).
Implements P0414R2:
  * Adds support for array types in std::shared_ptr.
  * Adds reinterpret_pointer_cast for shared_ptr.

Re-committing now that the leaking tests are fixed.

Differential Revision: https://reviews.llvm.org/D62259
2020-05-12 11:23:18 -07:00
David Zarzycki 9e32bf550d [libcxx testing] Remove ALLOW_RETRIES from sleep_for.pass.cpp
Operating systems are best effort by default, so we cannot assume that
sleep-like APIs return as soon as we'd like.

Even if a sleep-like API returns when we want it to, the potential for
preemption means that attempts to measure time are subject to delays.
2020-05-12 06:55:11 -04:00
zoecarver 5eb55483eb Revert "[libcxx] shared_ptr changes from library fundamentals (P0414R2)."
This reverts commit e8c13c182a.
2020-05-11 22:43:17 -07:00
zoecarver e8c13c182a [libcxx] shared_ptr changes from library fundamentals (P0414R2).
Implements P0414R2:
  * Adds support for array types in std::shared_ptr.
  * Adds reinterpret_pointer_cast for shared_ptr.

Differential Revision: https://reviews.llvm.org/D62259
2020-05-11 18:46:29 -07:00
David Zarzycki 4f4d6c81f8 [libcxx testing] Remove ALLOW_RETRIES from sleep_until.pass.cpp
Operating systems are best effort by default, so we cannot assume that
sleep-like APIs return as soon as we'd like.

Even if a sleep-like API returns when we want it to, the potential for
preemption means that attempts to measure time are subject to delays.
2020-05-10 05:59:09 -04:00
David Zarzycki 4f4ce13944 [libcxx testing] Make three locking tests more reliable
The challenge with measuring time in tests is that slow and/or busy
machines can cause tests to fail in unexpected ways. After this change,
three tests should be much more robust. The only remaining and tiny race
that I can think of is preemption after `--countDown`. That being said,
the race isn't fixable because the standard library doesn't provide a
way to count threads that are waiting to acquire a lock.

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

Reviewed By: ldionne, #libc

Subscribers: dexonsmith, jfb, broadwaylamb, libcxx-commits

Tags: #libc

Differential Revision: https://reviews.llvm.org/D79406
2020-05-09 11:11:26 -04:00
Eric Fiselier c490c5e81a Reland [libc++] Move abs and div into stdlib.h to fix header cycle.
This commit should will break libc++ without local submodule visibility, but
the LLVM+modules bots are now all using this mode. Before the Green Dragon
LLDB bot was failing to compile with a libc++ built with this commit as LSV
was disabled on macOS.

Original summary:

libc++ is careful to not fracture overload sets. When one overload
is visible to a user, all of them should be. Anything less causes
subtle bugs and ODR violations.

Previously, in order to support ::abs and ::div being supplied by
both <cmath> and <cstdlib> we had to do awful things that make
<math.h> and <stdlib.h> have header cycles and be non-modular.
This really breaks with modules.

Specifically the problem was that in C++ ::abs introduces overloads
for floating point numbers, these overloads forward to ::fabs,
which are defined in math.h. Therefore ::abs needed to be in math.h
too. But this required stdlib.h to include math.h and math.h to
include stdlib.h.

To avoid these problems the definitions have been moved to stddef.h
(which math includes), and the floating point overloads of ::abs
have been changed to call __builtin_fabs, which both Clang and GCC
support.
2020-05-08 21:52:27 +02:00
zoecarver afc8b49782 [libcxx] Delete pointer in shared_ptr deduction test.
Updates the dummy deleter in deduction.pass.cpp to delete the pointer argument. This will fix the asan bots.
2020-05-08 12:19:38 -07:00
zoecarver 26466efe08 Revert "[libc++] ECMAScript IdentityEscape is ambiguous (2584)"
This reverts commit 6d2a66b10d.

The regex expressions in some lld tests need to be fixed. Reverting
until those are fixed.
2020-05-08 10:37:04 -07:00
Casey Carter 197f185274 [libc++][test] Add test coverage for codecvt<char(16|32)_t, char8_t, mbstate_t>
This change adds test coverage for the `codecvt<char16_t, char8_t, mbstate_t>` and `codecvt<char32_t, char8_t, mbstate_t>` ctype facets added to the C++20 WD by [P0482R6](https://wg21.link/P0428R6). Note that libc++ does not implement these facets despite implementing the remainder of P0482, presumably for ABI reasons, so these tests are marked `UNSUPPORTED: libc++`.
2020-05-08 06:14:25 -07:00
zoecarver 6d2a66b10d [libc++] ECMAScript IdentityEscape is ambiguous (2584)
This patch fixes [[ https://cplusplus.github.io/LWG/issue2584 | 2584 ]]. Now the following works:
    const std::regex r1("\\z");
    assert(std::regex_match("z", r1));

Differential Revision: https://reviews.llvm.org/D66610
2020-05-07 14:26:25 -07:00
zoecarver df73e36dc6 [libcxx] [NFC] fpos Requirements (p0759r1).
Implements p0759r1. Test-only change. Adds explicit test for table 106 and type checking.

Differential Review: https://reviews.llvm.org/D60491
2020-05-07 14:02:42 -07:00
Marcel Hlopko c9e6519d15 Remove unused _LIBCPP_RAW_ITERATORS
Summary: This change removes seemingly unused _LIBCPP_RAW_ITERATORS.

Reviewers: #libc, EricWF, ldionne

Reviewed By: #libc, EricWF, ldionne

Subscribers: dexonsmith, ldionne, gribozavr2, libcxx-commits

Tags: #libc

Differential Revision: https://reviews.llvm.org/D79323
2020-05-07 22:26:15 +02:00
Antonio Sanchez aa0b991dcf [libc++] Fix ostream for complex numbers with fixed field width
The ostream operator<< is currently broken for std::complex with
specified field widths.

This patch a partial revert of c3478eff7a (reviewed as D71214),
restoring the correct behavior.

Differential Revision: https://reviews.llvm.org/D78816
2020-05-07 13:51:07 -04:00
Louis Dionne eb252b328c [libc++] NFC: Port type_info tests to C++03 2020-05-07 13:41:51 -04:00
Mara Sophie Grosch 59b3102739 [libc++] chrono: check _POSIX_TIMERS before using clock_gettime
clock_gettime is documented to be available when _POSIX_TIMERS is
defined. Add a check for this.

Differential Revision: https://reviews.llvm.org/D79305
2020-05-07 13:15:10 -04:00
Casey Carter 8615ce246d [libc++][test] Adjust move_iterator tests to allow C++20
These tests fail due to a couple of changes to `move_iterator` for C++20:

* `move_iterator<I>::operator++(int)` returns `void` in C++20 if `I` doesn't model `forward_iterator`.

* `move_iterator<I>::reference` is calculated in C++20, so `I` must actually have an `operator*() const`.

Differential Revision: https://reviews.llvm.org/D79343
2020-05-07 09:58:13 -07:00
Louis Dionne 31d41e3879 [libc++] Add tests for _LIBCPP_HAS_MERGED_TYPEINFO_NAMES_DEFAULT
The issue on Apple platforms was fixed in 2464d8135e, but this commit
adds some tests to make sure we don't regress.

See https://llvm.org/PR45549.

Differential Revision: https://reviews.llvm.org/D78963
2020-05-07 12:40:02 -04:00
Logan Smith 83564056d4 [libcxx] Add deduction guides for shared_ptr and weak_ptr
This patch adds deduction guides to <memory> to allow deducing
construction of shared_ptrs from unique_ptrs, and from weak_ptrs
and vice versa, as specified by C++17.

Differential Revision: https://reviews.llvm.org/D69603
2020-05-07 12:07:48 -04:00
Logan Smith 5b4a98eb58 [libcxx] Qualify make_pair in searcher implementations to prevent ADL
This patch adds `_VSTD::` to some calls to `make_pair` inside the
implementations of searchers, to prevent things exploding if there is
a make_pair in an associated namespace of a user-defined type.
https://godbolt.org/z/xAFG98

Differential Revision: https://reviews.llvm.org/D72640
2020-05-07 11:57:10 -04:00
Sergej Jaskiewicz 5e3ab8f229 Revert "[libc++] [test] Generate static_test_env on the fly"
This reverts commit 52cc8bac77.

As the discussion in https://reviews.llvm.org/D78200 continues, I will
revert this until we figure out what to do.
2020-05-06 23:13:24 +03:00
Louis Dionne 89bb9f8d78 [libc++] Make sure the cin/wcin tests run on remote hosts
When running on remote hosts, we need the whole `echo 123 | %t.exe` command
to run on the remote host. Thus, we need to escape the pipe to make sure
the command is treated as `{ echo 123 | %t.exe } > %t.out` instead of
`{ echo 123 } | %t.exe > %t.out`m where only `echo 123` is run on the
remote host.
2020-05-06 11:33:13 -04:00
Louis Dionne d98b9a4157 [libc++] NFC: Do not print the environment on remote hosts
Running `export` when there is no environment variable to export will
cause the environment on the remote host to be printed. We don't want
that, so don't run any `export` command on the host when there's no env.
2020-05-06 11:33:13 -04:00
Louis Dionne c82f9eba4a [libc++] Fix broken modules tests on single-threaded systems
Since c0cd106fcc, we add __config_site macro defines to the compiler
command line whether we are building with modules or not. This means
that the modules tests are expected to fail on single-threaded systems
whether we build with modules or not.
2020-05-06 09:59:50 -04:00
Sergej Jaskiewicz 52cc8bac77 [libc++] [test] Generate static_test_env on the fly
Summary:
Instead of storing `static_test_env` (with all the symlinks) in the repo, we create it on the fly to be cross-toolchain-friendly. The primary use case for this are Windows-hosted cross-toolchains. Windows doesn't really have a concept of symlinks. So, when the monorepo is cloned, those symlinks turn to ordinary text files. Previously, if we cross-compiled libc++ for some symlink-friendly system (e. g. Linux) and ran tests on the target system, some tests would fail. This patch makes them pass.

Reviewers: ldionne, #libc

Reviewed By: ldionne, #libc

Subscribers: EricWF, dexonsmith, libcxx-commits

Tags: #libc

Differential Revision: https://reviews.llvm.org/D78200
2020-05-06 01:23:50 +03:00
Sergej Jaskiewicz 718a2927ad Revert "[libc++] Generate symlinks in static_test_env on the fly"
This reverts commit 645ad5badb.

This commit did not incorporate all the changes intended.
2020-05-06 01:21:53 +03:00
Sergej Jaskiewicz 645ad5badb [libc++] Generate symlinks in static_test_env on the fly
Instead of storing static_test_env (with all the symlinks) in the repo,
we create it on the fly to be cross-toolchain-friendly. The primary
use case for this are Windows-hosted cross-toolchains. Windows doesn't
really have a concept of symlinks. So, when the monorepo is cloned,
those symlinks turn to ordinary text files. Previously, if we
cross-compiled libc++ for some symlink-friendly system (e. g. Linux) and
ran tests on the target system, some tests would fail. This patch makes
them pass.

Differential Revision: https://reviews.llvm.org/D78200
2020-05-06 01:13:18 +03:00
Louis Dionne 50cd964e61 [libc++] Rewrite the tests for cin, cout, clog, cerr and friends
The tests were disabled with `#if 0`, most likely because there was no
way of writing shell tests when they were first written.
2020-05-05 13:27:17 -04:00
Louis Dionne 7e6221da10 [libc++] Remove unused functions and minor features of the test suite
This commit removes minor features of the test suite that I've never
seen used and that are basically just a maintenance burden:

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

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

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

Differential Revision: https://reviews.llvm.org/D78382
2020-05-04 08:54:07 -04:00
Casey Carter 7e3ef299cb [libc++][test] Use a non-narrowing conversion in assign_pair.pass.cpp
...to avoid warnings, e.g., from MSVC.
2020-05-03 10:59:10 -07:00
Marek Kurdej 3e895085de [libc++][P1115][C++20] Improving the Return Value of Erase-Like Algorithms II: Free erase/erase if.
Summary:
This patch adds return type to std::erase and std::erase_if functions.

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

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

Reviewed By: ldionne, #libc

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

Tags: #libc

Differential Revision: https://reviews.llvm.org/D75905
2020-05-02 14:04:50 +02:00
Louis Dionne cd05707d08 [libc++] Try re-enabling DSL test on Windows
The issues we were seeing before should have been fixed, but it's hard
to say for sure without running through the bots again.
2020-05-01 14:29:37 -04:00
Louis Dionne b420a09959 [libc++] Re-enable some tests under ASAN and MSAN
The tests were disabled under ASAN/MSAN because old Clangs were very
slow to build the test cases. However, I checked with the Clang used
on our build bots and the tests are not slow to build anymore, so the
tests can be re-enabled.
2020-05-01 14:03:51 -04:00
Louis Dionne 68fb8051d0 [libc++] Turn on warnings in the test suite in C++03 for Clang-based compilers 2020-05-01 13:34:11 -04:00
Louis Dionne 566b52da8b [libc++] Disable test that we use -Werror in C++03 2020-05-01 13:12:07 -04:00
Louis Dionne 9ff51bf92e [libc++] NFC: fix typos 2020-05-01 13:10:30 -04:00
Diogo Sampaio 081dbd61db [NFC] Try to fix test due asan failure 2020-05-01 17:18:25 +01:00
Louis Dionne 9295f356bb [libc++] Avoid using GNU extension in test, which triggers a warning 2020-05-01 11:10:06 -04:00
Louis Dionne 0c91e134e6 [libc++] Make sure -Werror is enabled all the time, except in verify tests 2020-05-01 10:45:39 -04:00
Shoaib Meenai cc259638cb [libcxx][libcxxabi][libunwind] Use libgcc on Android
Android doesn't have a libgcc_s and uses libgcc instead, so adjust the
build accordingly. This matches compiler-rt's build setup. libc++abi and
libunwind were already checking for libgcc but in a different context.
This change makes them search only for libgcc on Android now, but the
code to link against libgcc if it were present was already there.

Reviewed By: #libc, #libc_abi, #libunwind, rprichard, srhines

Differential Revision: https://reviews.llvm.org/D78787
2020-04-30 15:42:32 -07:00
Diogo Sampaio c14ac8043e [FIX][libc++][Regex] Using regex_constants match_prev_avail | match_not_bol | match_not_bow
Summary:
pr42199
When using regex_constants::match_prev_avail, it is defined that
--first is valid, and match_not_bol and match_not_bow should be
ignored. At the moment these flags are not ignored. This fixis that.

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

Reviewed By: ldionne, miyuki, #libc

Subscribers: broadwaylamb, dexonsmith, libcxx-commits

Tags: #libc

Differential Revision: https://reviews.llvm.org/D75622
2020-04-30 23:36:25 +01:00
Louis Dionne 75a815a28c [libc++] Use Lit utilities instead of old libcxx utilities for str/bytes conversions
The libcxx.util utilities don't work properly, and we should remove them
when we get rid of compiler.py. In particular, libcxx.util.to_string
appears to be completely broken.
2020-04-30 15:49:40 -04:00
Louis Dionne ecd3ce0e5a [libc++] Make sure platform detection works in both Python 2 and 3
19123a3e08 was too naive -- we really want to handle both Python 2 and
Python 3, not only Python 3.
2020-04-30 15:32:08 -04:00
Louis Dionne 5d46e4b0da [libc++] Don't over-quote arguments to DSL tests
On Windows, quoting with single-quotes is both unnecessary and incorrect.
If the arguments are properly handled by Lit (which they are), quoting
should not be necessary.
2020-04-30 14:23:24 -04:00
Louis Dionne d789ef1608 [libc++] Make sure we create the working directory for running config check commands
The internal Lit shell requires the current working directory to exist.
This didn't show up locally because the directories were already created
by previous runs of the tests.
2020-04-30 14:10:56 -04:00
Louis Dionne cfedd7d5e3 [libc++] Use the internal Lit shell parser to run config tests
This makes the config tests portable across platforms.
2020-04-30 13:26:57 -04:00
Louis Dionne dfec13fcf2 [libc++] Do not allow customizing the arch in the trunk and back-deployment scripts
We should eventually be able to pass an arbitrary target triple, however
for the time being, just being able to pass 64/32 is not really that
useful.
2020-04-30 12:58:51 -04:00