Commit Graph

3516 Commits

Author SHA1 Message Date
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
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
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 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 c0cd106fcc [libc++] Move parsing of <__config_site> macros to the DSL 2020-05-05 09:31:42 -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
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 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 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 2fd7d364cd [libc++] Make the verify-support feature implicit
Tests that require support for Clang-verify are already marked as such
explicitly by their extension, which is .verify.cpp. Requiring the use
of an explicit Lit feature is, after thought, not really helpful.

This is a change in design: we have been bitten in the past by tests not
being enabled when we thought they were. However, the issue was mostly
with file extensions being ignored. The fix for that is not to blindly
require explicit features all the time, but instead to report all files
that are in the suite but that don't match any known test format. This
can be implemented in a follow-up patch.
2020-04-30 11:47:12 -04:00
Dan Albert 2e090e4884 Reset another globalMemCounter. 2020-04-29 17:15:04 -07:00
Louis Dionne ae3e58517e [libc++] Re-disable DSL test on Windows
This reverts commit 51a60ed14c, since the test still doesn't pass on
Windows. Marking the test as UNSUPORTED	on Windows again until I've
figured out the problem.
2020-04-29 14:21:04 -04:00
Louis Dionne 43a1d0d963 [libc++] NFC: Properly indent nested #ifs in platform_support.h 2020-04-29 12:53:16 -04:00
Louis Dionne 5b97aa14f4 [libc++] Re-disable parts of the failing RU locale tests on Apple
Instead of completely disabling the tests on Apple, which makes them
disabled on all platforms we test (and hence useless), this commit
disables only the assertions that actually fail. I also created a
bug report to track re-enabling them (https://llvm.org/PR45739).
2020-04-29 12:50:58 -04:00
Louis Dionne 5e37cf0adc [libc++] Try re-enabling long-disabled locale tests on Apple platforms
These two locale tests are disabled because they were said to "pass in
an uncontrolled manner on Apple platforms". This commit re-enables them
to see what that means, and whether that is still relevant on the
platforms we test.

Before this commit, the tests were either XFAILed or UNSUPPORTED on
Apple and Linux, which is pretty much all the systems we support. If
the tests truly don't work anywhere, they should be removed instead.
2020-04-29 12:03:05 -04:00
Louis Dionne d7da36c6e0 [libc++] Mark two timed_mutex tests as flaky 2020-04-29 11:52:17 -04:00
Louis Dionne 51a60ed14c [libc++] Try re-enabling DSL test on Windows
The issue we were seeing before should have been fixed by 178a0c80ba.
2020-04-29 11:32:27 -04:00
Casey Carter 68b30bc02b [NFC] Correct spelling of "ambiguous" 2020-04-28 14:51:37 -07:00
Louis Dionne 707df4acdc [libc++] Temporarily disable test that fails on Windows 2020-04-28 13:10:12 -04:00
Louis Dionne e82f0a598f [libc++][Take 2] Create a small DSL for defining Lit features and parameters
This allows defining Lit features that can be enabled or disabled based
on compiler support, and parameters that are passed on the command line.

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

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

Differential Revision: https://reviews.llvm.org/D78381
2020-04-28 10:02:40 -04:00
David Zarzycki 8f24c4b72f Revert: [libc++] Create a small DSL for defining Lit features and parameters
This reverts commit 6d58030c8c due to lack
of Python 3 support. As a reminder, the Python community ended their
support for 2.x at the start of 2020.
2020-04-28 08:12:19 -04:00
Casey Carter b4437992ec [libc++][test] Disable test for extension that's unsupportable in C++20
Defining the nested types `reference` and `iterator_concept` of `reverse_iterator<I>` necessarily requires `I` to be complete in C++20. These tests that verify that `std::map<int, X>::reverse_iterator` can be instantiated when `X` is incomplete are going to have a bad time.

Differential Revision: https://reviews.llvm.org/D78944
2020-04-27 13:06:31 -07:00
Louis Dionne b640ec007f [libc++] Quote path to the Python executable in ShTest
This is an attempt to unbreak this test on Windows, where paths contain
backslashes that are interpreted as escape characters unless quoted.
2020-04-27 13:07:29 -04:00
Louis Dionne 6d58030c8c [libc++] Create a small DSL for defining Lit features and parameters
This allows defining Lit features that can be enabled or disabled based
on compiler support, and parameters that are passed on the command line.

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

Differential Revision: https://reviews.llvm.org/D78381
2020-04-27 09:56:04 -04:00
Louis Dionne f17eb4ec20 [libc++] Add UNSUPPORTED markup for shared_mutex and shared_timed_mutex tests
The tests were previously disabled entirely whenever availability markup
was enabled. Instead, enable the tests but add the proper UNSUPPORTED
markup.
2020-04-27 04:23:58 -04:00
Louis Dionne e0ae2cc894 [libc++] Mark C++20 Synchronization Library tests as unsupported in C++11
The various headers comprising the C++20 Synchronization Library only
contain something in C++ >= 14, not C++ >= 11.
2020-04-27 03:38:31 -04:00
Louis Dionne f76c42416c [libc++] Improve the detection of whether the blocks runtime is available
The runtime for Blocks may not be available even though the Blocks
language extension _is_ available. Instead of potentially failing,
this commit is much more conservative and assumes the runtime for
Blocks is only provided on Apple platforms.

Differential Revision: https://reviews.llvm.org/D78757
2020-04-24 07:02:21 -04:00
Sergej Jaskiewicz abe827be9e [libcxx] Add FILE_DEPENDENCIES line to the func.blocks.sh.cpp test
This should fix the bots that use ssh.py to execute tests
2020-04-23 23:17:57 +03:00
Louis Dionne cd66970b37 [libc++] Don't try to include <Block.h> when not available 2020-04-22 15:22:12 -04:00
Louis Dionne 430b00954c [libc++] Add support for blocks in std::function
rdar://14390808
2020-04-22 14:58:02 -04:00
Louis Dionne 8c61114c53 [libc++/abi/unwind] Rename Lit features for no exceptions to 'no-exceptions'
Instead of having different names for the same Lit feature accross code
bases, use the same name everywhere. This NFC commit is in preparation
for a refactor where all three projects will be using the same Lit
feature detection logic, and hence it won't be convenient to use
different names for the feature.

Differential Revision: https://reviews.llvm.org/D78370
2020-04-22 08:25:27 -04:00
David Zarzycki b2f06bd20b [libc++ testing] Fix unused variable warning turned error 2020-04-22 08:05:31 -04:00
Louis Dionne fccc4af658 [libc++] Re-enable warnings in the new format
When the new libc++ test format was enabled, warnings were accidentally
dropped cause they were not part of the %{compile_flags} substitution.
This commit adds them back, however `-Werror` is only used for non-verify
tests (cause it doesn't make sense for verify tests).

This commit is a re-application of 20fd624380, which was reverted in
5ec6fdb058 because it broke the C++03 bot. This failure should have
been fixed in b4fb705e77.
2020-04-21 13:01:08 -04:00
Louis Dionne b4fb705e77 [libc++] Fix warnings with Clang in C++03 2020-04-21 11:03:05 -04:00
Louis Dionne 5ec6fdb058 Revert "[libc++] Re-enable warnings in the new format"
This reverts commit 20fd624380, which broke the C++03 build bot.
I'll have another stab at this after fixing those failures.
2020-04-20 16:42:53 -04:00
Louis Dionne 20fd624380 [libc++] Re-enable warnings in the new format
When the new libc++ test format was enabled, warnings were accidentally
dropped cause they were not part of the %{compile_flags} substitution.
This commit adds them back, however `-Werror` is only used for non-verify
tests (cause it doesn't make sense for verify tests).
2020-04-20 16:02:49 -04:00
Louis Dionne 1cac82cf38 [libc++] Fix a few warnings when running the test suite with GCC 2020-04-20 13:48:50 -04:00
Louis Dionne 5eb8d45ab5 [libc++] Use proper shell escaping in the executors
This was originally committed as f8452ddfcc and reverted in 7cb1aa9d93.
The issue was that shell builtins were being escaped too, and apparently
Bash won't execute a builtin when it is quoted e.g. '!'. Instead, it
thinks it's a command and it can't find it.

Re-committing the change with that issue fixed.
2020-04-18 11:22:42 -04:00
Louis Dionne a8e4b7a550 [libc++] NFC: Rename Lit feature for no RTTI to -fno-rtti 2020-04-17 10:37:14 -04:00
Louis Dionne 9a39d5a2ec [libc++] Move .fail.cpp tests with verify-support to .verify.cpp 2020-04-17 09:05:28 -04:00
Louis Dionne 68587af9ad [libc++] Move handling of convenience substitutions outside of config.py
These substitutions are strongly tied to the operation of the test
format, so it makes sense to have them defined by the test format
instead of the Lit configuration. They should be defined regardless
of which configuration is in use.
2020-04-16 17:30:09 -04:00
Dan Albert 75c4408653 Reland: Don't expose unavailable cstdio functions.
Marked unsupported for C++03 and C++11 since this test uses alias
declarations, and at least one C++03 bot was failing with
-Wc++11-extensions.

Change-Id: I8c3a579edd7eb83e0bc74e85d116b68f22400161
2020-04-16 12:51:08 -07:00
Louis Dionne 3fbc9c7b51 [libc++] Add a new target check-cxx-deps to build dependencies of the test suite
When running the tests through `lit` directly instead of through `check-cxx`,
it is required to manually build the `cxx` (and often `cxx_experimental`)
targets. Instead of having to do that manually, this commit adds a new
target `check-cxx-deps` that does that for you.
2020-04-15 15:11:27 -04:00
Louis Dionne 91f110f50e [libc++] Adjust XFAIL markup for modules tests on single-threaded systems
When building these tests without modules in the whole test suite,
the __config_site macro definitions are not included anymore in the
%{compile_flags}. This causes the _LIBCPP_HAS_NO_THREADS define not
to be picked up, and the test to XPASS on single-threaded systems.

This is a stop-gap measure to fix the build bots, however the proper
solution would be to always pass the __config_site defines as compiler
macros, whether we build with modules or not.
2020-04-15 14:28:07 -04:00
Louis Dionne e87c46b162 [libc++] Remove the need for the %{build_module} substitution
Instead of using .sh.cpp tests for the modules tests, use .compile.pass.cpp
and add the -fmodules additional flag.
2020-04-15 13:01:26 -04:00
Louis Dionne 40515b19b0 [libc++] Split up tests for <stdint.h> on AIX and make them AIX-independent
Avoid using <sys/types.h> in those tests so that we can run them on
non-AIX systems (otherwise this test is basically dead-code on all
the build bots I'm aware of). Also, split up the test to allow using
.compile.pass.cpp tests instead of .sh.cpp tests, since that is the
last test referencing the %{compile} substitution explicitly.
2020-04-15 12:43:35 -04:00
Louis Dionne 1a7c6b23fc [libc++] Move some .sh.cpp tests to .compile.pass.cpp
As a fly-by fix, improve/fix the comments explaining the tests. This is
a step towards removing references to the %{compile} substitution.
2020-04-15 12:27:49 -04:00
Louis Dionne 1348b53c63 [libc++] Move aligned allocation tests to .verify.cpp
Instead of being ShTests that use clang-verify (and without the proper
REQUIRES annotation), create .verify.cpp tests instead with the right
REQUIRES annotation.
2020-04-15 12:04:55 -04:00
Louis Dionne 7a6aaf9b23 [libc++] Remove workaround for .fail.cpp tests that don't have clang-verify markup
By renaming .fail.cpp tests that don't need clang-verify to .compile.fail.cpp,
the new test format will not try to compile these tests with clang-verify,
and the old test format will work just the same. However, this allows
removing a workaround that requires parsing each test looking for
clang-verify markup.

After this change, a .fail.cpp test should always have clang-verify markup.
When clang-verify is not supported by the compiler, we will just check that
these tests fail to compile. When clang-verify is supported, these tests
will be compiled with clang-verify whether they have markup or not (so
they should have markup, or they will fail).

This simplifies the test suite and also ensures that all of our .fail.cpp
tests provide clang-verify markup. If it's impossible for a test to have
clang-verify markup, it can be moved to a .compile.fail.cpp test, which
are unconditionally just checked for compilation failure.
2020-04-15 10:53:37 -04:00
Louis Dionne 35bbf3bb71 [libc++] Add .verify.cpp tests to the new format
With this patch, .verify.cpp tests explicitly require clang-verify, but
no other test types require clang-verify out of the box. This will allow
making several .fail.cpp tests that don't have any clang-verify markup
to be just .compile.fail.cpp tests, which in turn should allow removing
a long standing workaround that requires parsing tests to detect whether
they have any clang-verify markup in them.
2020-04-14 14:49:51 -04:00
Louis Dionne d58107c3bf [libc++] Remove support for .fail.mm tests
There are no such tests in the libc++ test suite, and I want to move
away from `.fail.cpp` tests (in favour of something else) too, which
require a workaround.
2020-04-14 12:20:23 -04:00
Louis Dionne 80aea8e4a8 [libc++] Simplify how with_system_cxx_lib and availability features are defined
Instead of spamming a bunch of available features that are not actually
used anywhere, only set those that are actually used in the test suite.
In the future, this should probably be based on the target triple only,
with the ability to have wildcards in the triple.
2020-04-14 08:28:05 -04:00
Louis Dionne 961914eeb9 [libc++] Mark test failing with macos < 10.13 as unsupported 2020-04-13 17:39:05 -04:00
Louis Dionne 9d8c22587b [libc++] NFC: Remove unused Lit features in the test suite
The libc++ test suite currently defines several features that are not
used anywhere in the tests, or that are redundant with other features.
For the purpose of simplifying config.py and to ease the bring up of a
new configuration, this commit removes some of these features:

- rename dylib-has-no-filesystem to c++filesystem-disabled, which exists
- rename apple-darwin to just darwin, which is already set
- remove useless setting of libstdc++, which is already set correctly
- remove libcpp-abi-unstable, which is not used anywhere
- remove the glibc-XXX features, which are not used anywhere
2020-04-13 17:19:00 -04:00
Casey Carter 470eb62d7b [libc++][test] Silence "unused variable" warning 2020-04-11 11:40:16 -07:00
Louis Dionne 7149bb7068 [libc++] NFC: Clean up a lot of old Lit features
The libc++ test suite has a lot of old Lit features used to XFAIL tests
and mark them as UNSUPPORTED. Many of them are to workaround problems on
old compilers or old platforms. As time goes by, it is good to go and
clean those up to simplify the configuration of the test suite, and also
to reflect the testing reality. It's not useful to have markup that gives
the impression that e.g. clang-3.3 is supported, when we don't really
test on it anymore (and hence several new tests probably don't have the
necessary markup on them).
2020-04-10 17:20:29 -04:00
Louis Dionne 13d07bf437 [libc++] NFC: Fix typo in Lit feature (C++14 with a capital C) 2020-04-10 16:12:01 -04:00
Eric Fiselier bf90b8fc25 [libc++] Fix failing concepts tests 2020-04-08 18:25:07 -04:00
Eric Fiselier 601f763182 [libcxx] Adds [concept.same]
Patch from Christopher Di Bella (cjdb@google.com)
Reviewed as https://reviews.llvm.org/D74291

Adds `std::same_as` to libc++. Since there aren't clang-format rules for
//requires-expressions//, I'll need to disable the formatter in certain areas.
2020-04-08 18:00:13 -04:00
zoecarver 7a0dc1a9e7 [libc++] Remove std::optional from ObjC is_scalar test.
std::optional requires C++17. Instead of only running the test above
C++14, this commit removes uses of std::optional from the test (it's
already tested in block.objc.pass.mm).
2020-04-08 09:44:49 -07:00
Dan Albert 0b43db5202 Reset more globalMemCounters.
Reviewers: EricWF, #libc

Reviewed By: EricWF, #libc

Subscribers: broadwaylamb, libcxx-commits

Tags: #libc

Differential Revision: https://reviews.llvm.org/D77681
2020-04-07 16:40:22 -07:00
Dan Albert 50280c1895 Revert "Don't expose unavailable cstdio functions."
Broke builders that emit different diagnostics. e.g.:

error: 'warning' diagnostics seen but not expected:
  Line 13: alias declarations are a C++11 extension
  Line 20: alias declarations are a C++11 extension

This reverts commit ff87813715.
2020-04-07 15:36:44 -07:00
Dan Albert ff87813715 Don't expose unavailable cstdio functions.
Summary: These aren't available on Android in all configurations.

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

Reviewed By: EricWF, #libc, ldionne

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

Tags: #libc

Differential Revision: https://reviews.llvm.org/D76093
2020-04-07 15:02:30 -07:00
Louis Dionne a092e3833b [libc++] Remove the %{not} substitution
It has never been used, and it actually doesn't really work because it
assumes that the target supports Python. Instead, it's better to just
use `!` since we're running ShTests in system shells anyway.
2020-04-07 17:12:37 -04:00
Louis Dionne f8b6529218 [libc++] Translate MODULES_DEFINES annotations to ADDITIONAL_COMPILE_FLAGS
This allows both the old and the new testing formats to handle these
tests with modules enabled.

We also include the modules flags in the %{flags} substitution, which
means that .sh.cpp tests in the old format and all tests in the new
format will use modules flags when enabled.
2020-04-07 14:40:49 -04:00
Louis Dionne 9949cfbd05 [libc++] Make sure the source file appears before link libraries when compiling tests
Otherwise, files don't link when using a GNU linker, which is more
sensitive on the order of the source file relative to the various
linked libraries. See http://c-faq.com/lib/libsearch.html for an
explanation of the problem.
2020-04-07 08:58:40 -04:00
Louis Dionne 276d2b78ce [libc++] 2/N: Enable the new libc++ testing format by default
Both test formats are equivalent, so this *should* not be a problem.
We've fixed a couple of failures uncovered by the first time we tried
making the switch, so this new attempt should go even farther.

If failures are noticed, it should be fine to revert this commit, but
please give a heads up afterwards so we know to address the issues!

Also note that it is still possible to use the old format by passing
`--param=use_old_format=True` when running Lit for the time being.
2020-04-06 18:35:17 -04:00
Louis Dionne bcf14f375e [libc++] Only support std::to_chars availability test when back-deploying 2020-04-06 18:09:34 -04:00
Louis Dionne 46c3876188 [libc++] Add availability markup for the C++20 Synchronization Library on Apple 2020-04-06 18:07:26 -04:00
Louis Dionne 8a42bf24ae [lit] Move the recursiveExpansionLimit setting to TestingConfig
The LitConfig is shared across the whole test suite. However, since
enabling recursive expansion can be a breaking change for some test
suites, it's important to confine the setting to test suites that
enable it explicitly.

Note that other issues were raised with the way recursiveExpansionLimit
operates. However, this commit simply moves the setting to the right
place -- the mechanism by which it works can be improved independently.

Differential Revision: https://reviews.llvm.org/D77415
2020-04-06 13:58:00 -04:00
Louis Dionne 7662ad67c5 [libc++] Mark two std::timed_mutex tests as flaky 2020-04-06 12:41:10 -04:00
Louis Dionne 2c1c4777a5 [libc++] Always use -fsyntax-only in .fail.cpp tests
We had a workaround because GCC 5 does not evaluate static assertions
that are dependent on template parameters. This commit removes the
workaround and marks the corresponding tests as unsupported with GCC 5.
This has the benefit of bringing the new and the old test formats closer
without having to carry a workaround for an old compiler in the new
test format.
2020-04-06 11:38:45 -04:00
Louis Dionne 4e52944ef1 [libc++] Make sure we include %{flags} when building with the new format
Otherwise, we're missing some flags like the flags that are used by
sanitizer builds and the 32-bit builds. In the long term, I think it
would be better to have only %{compile_flags} and %{link_flags}, but
for the benefit of adopting the new format by default, I think it's OK
to add %{flags} to it.
2020-04-06 11:24:04 -04:00
Louis Dionne 38e0720474 [libc++] Mark is_scalar test as unsupported in C++11 and C++14
That test requires std::optional. We never noticed that because our
test format was skipping Objective-C++ tests altogether.
2020-04-06 11:23:36 -04:00
Sergej Jaskiewicz a41cd6bb89 [libc++] [test] Add missing FILE_DEPENDENCIES to align.pass.sh.cpp
Differential Revision: https://reviews.llvm.org/D77541
2020-04-06 09:13:16 -04:00
David Zarzycki 168503773d Revert "[libc++] Enable the new libc++ testing format by default"
This reverts commit 1580c76c4a.

This causes libcxx/selftest/newformat/sh.cpp/substitutions.sh.cpp to
fail with a linker error on Fedora 31 (x86-64) release (no assert)
builds.
2020-04-05 07:16:47 -04:00
Louis Dionne 1580c76c4a [libc++] Enable the new libc++ testing format by default
Both test formats are equivalent, so this *should* not be a problem.
However, I'm taking advantage of the week-end to test this and see if
there are any failures. If so, it should be fine to revert this until
the failures have been addressed.

For the time being, it is still possible to use the old format by passing
`--param=use_old_format=True` when running Lit.
2020-04-04 16:57:16 -04:00
Eric Fiselier 62f3a9650a [libc++] Attempt to workaround module invalidation bug 2020-04-04 03:18:01 -04:00
Joerg Sonnenberger 98f77828a9 Avoid using std::max_align_t in pre-C++11 mode
Always depend on the compiler to have a correct implementation of
max_align_t in stddef.h and don't provide a fallback. For pre-C++11,
require __STDCPP_NEW_ALIGNMENT__ in <new> as provided by clang in all
standard modes. Adjust test cases to avoid testing or using max_align_t
in pre-C++11 mode and also to better deal with alignof(max_align_t)>16.
Document requirements of the alignment tests around natural alignment of
power-of-two-sized types.

Differential revision: https://reviews.llvm.org/D73245
2020-04-04 01:38:41 +02:00
Louis Dionne aaaa25e23d [libc++] Remove useless nothing_to_do.pass.cpp tests
The testing script used to test libc++ historically did not like directories
without any testing files, so these tests had been added. Since this is
not necessary anymore, we can now remove these files. This has the benefit
that the total number of tests reflects the real number of tests more
closely, and we also skip some unnecessary work (especially relevant when
running tests over SSH).

However, some nothing_to_do.pass.cpp tests actually serve the purpose of
documenting that an area of the Standard doesn't need to be tested, or is
tested elsewhere. These files are not removed by this commit.

Removal done with:

  import os
  import itertools
  for (dirpath, dirnames, filenames) in itertools.chain(os.walk('./libcxx/test'),
                                                        os.walk('./libcxxabi/test')):
      if len(filenames + dirnames) > 1 and \
         any(p == 'nothing_to_do.pass.cpp' for p in filenames):
          os.remove(os.path.join(dirpath, 'nothing_to_do.pass.cpp'))
2020-04-03 13:48:34 -04:00
Louis Dionne 80a2ddf65c [libc++] Add an alternative Lit test format
This new test format is simpler and more flexible. It creates Lit ShTests
on the fly that reuse existing substitutions (like %{cxx}) instead of
having complex logic in Python to run the tests. This has the benefit
that virtually no coding is required to customize how the test suite is
run -- one can achieve pretty much anything by defining the appropriate
substitutions in a simple lit.cfg file.

For example, in order to run the tests on an embedded device after
building with a specific SDK, one can set the %{cxx} and %{compile_flags}
substitutions to use that SDK, and the %{exec} substitution to the ssh.py
script currently used for .sh.cpp tests with a remote executor. Dealing with
the SSHExecutor becomes unnecessary, since all tests are treated like ShTests.

As a side effect of this design, configuration files for the test
suite can be as simple as:

	config.substitutions.append(('%{cxx}', '<path-to-compiler>'))
	config.substitutions.append(('%{compile_flags}', '<flags>'))
	config.substitutions.append(('%{link_flags}', '<flags>'))
	config.substitutions.append(('%{exec}', '<script-to-execute>'))

This should allow storing lit.cfg files for various configurations
directly in the repository instead of relying on complicated logic
in config.py to set up the right flags. I've found numerous problems
in that logic in the past years, and it seems like having simple and
explicit configuration files for the configurations we support is
going to solve most of these problems. Specifically, I am hoping to
store configuration files for testing other Standard Libraries in
the repository.

Improving the interaction with the test suite configuration is still a
work in progress, so for now this test format reuses the substitutions and
available features that are set up by the current config.py.

This new test format should support pretty much everything that the current
test format supports, however it will not be enabled by default at first to
make sure we're satisfied with it. For a short period of time, the new format
will require `--param=use_new_format=True` to be enabled, however it is a very
short term goal to replace the current testing format entirely and to simplify
the configuration accordingly.

Differential Revision: https://reviews.llvm.org/D77338
2020-04-03 11:35:27 -04:00
Louis Dionne 3d94f3060c [libc++] Fix is_pointer support for Objective-C++
This test regressed with 5ade17e0ca, but we never noticed it because
.pass.mm tests were skipped due to a bug in our Lit config. This commit
fixes is_pointer (by essentially reverting tha part of 5ade17e0ca) and
also adds .pass.mm tests to the list of supported test suffixes.

We can explore how to support __is_pointer with Objective-C++ qualifiers
as a follow-up -- the main goal of this commit is to fix the regression
quickly and make sure all tests of the suite are run.
2020-04-03 11:09:59 -04:00
Louis Dionne 937040d181 [libc++] Add REQUIRES for tests that need -fblocks and -fobjc-arc
AppleClang seems to support these extensions by default, but other
compilers don't.
2020-04-03 10:10:35 -04:00
Louis Dionne a6a841e0d7 [libc++] Refer to the Filesystem static test env as relative paths
Instead of hardcoding absolute paths on the build-host in the executables,
use relative paths from the current working directory. Also, use
FILE_DEPENDENCIES to mark the static test env as being required by
the relevant tests.

Given a SSH executor that copies the files to the remote host properly,
the tests can be run on that remote host.
2020-04-02 16:51:37 -04:00
Casey Carter ea3152bb3d [libc++][test] Partially revert msvc_stdlib_force_include.h _Pragma change
... keep the warning suppression, but revert the `__pragma` to `_Pragma` change because `_Pragma` interacts badly with `/Zc:preprocessor`.
2020-04-02 12:59:57 -07:00
Casey Carter 0e3a8a6f34 [libc++][test] Update _LIBCPP_SUPPRESS_DEPRECATED_(PUSH|POP)
... in `msvc_stdlib_force_include.h` to also ignore new MSVC warning C5215 "'%s' a function parameter with volatile qualified type is deprecated in C++20". Since we're touching it, also update from non-standard `__pragma(meow)` to standard `_Pragma("meow")`.
2020-04-02 08:05:57 -07:00
Louis Dionne d5fa8b1120 [libc++] Reimplement the dynamic filesystem helper without using Python
This patch reimplements the dynamic filesystem helper using Posix
functionality instead of relying on Python. The primary reason for
doing this is that it allows running the libc++ test suite on devices
that do not have Python.

Differential Revision: https://reviews.llvm.org/D77140
2020-04-02 10:46:34 -04:00
Louis Dionne df88d80337 [libc++] Add missing FILE_DEPENDENCIES markup 2020-04-01 22:17:03 -04:00
Louis Dionne 07e462526d [libc++] Allow running .sh.cpp tests with SSHExecutors
This commit adds a script that can be used as an %{exec} substitution
such that .sh.cpp tests can now run on remote hosts when using the
SSHExecutor.
2020-03-31 15:50:42 -04:00
Louis Dionne 38aebe5c04 [libc++] Move a bunch of tests from .sh.cpp to .pass.cpp
Using the ADDITIONAL_COMPILE_FLAGS annotation, it is possible to move
these tests from .sh.cpp to .pass.cpp, making them suitable for running
on remote hosts more easily.
2020-03-31 14:19:58 -04:00
Louis Dionne 89fe36d08a [libc++] Make sure substitutions are expanded inside FILE_DEPENDENCIES 2020-03-31 13:57:17 -04:00
Louis Dionne a9c22739e6 [libc++] Remove incorrect assertion in the filesystem tests
Based on the current discussion in https://llvm.org/PR45307, it seems
that it's legitimate for `temp_directory_path()` to return a path with
a trailing slash. Since `p.parent_path()` will never contain a trailing
slash, comparing it to the result of `temp_directory_path()` will fail
depending on whether `temp_directory_path()` returns a trailing slash
or not.
2020-03-31 10:07:48 -04:00
Louis Dionne b632fe5a36 [libc++] Quote the filesystem static env root in the source files instead of the command line
Otherwise, trying to reproduce a failing filesystem test by copy-pasting
the command-line used and running that in the shell won't work, because
the shell will eat quoting around the define and we'll end up with a
non-stringized path in the .cpp file.
2020-03-31 09:40:01 -04:00
Louis Dionne fb47ffc618 [libc++] Provide a method for adding compiler flags in lit.local.cfg files
That way, local lit configuration files don't have to worry about
deep-copying the compiler instance of the test format, which is
arguably an implementation detail.

We pass the config to this method even though it is not used by the
current test format because this allows replacing the current test
format by other test formats that would require the config to add
new compile flags.
2020-03-31 09:29:18 -04:00
Louis Dionne d3a729ab24 [libc++] Set filesystem test flags in a lit.local.cfg
This reduces the complexity of our already complex global lit configuration,
and also avoids cluttering the compilation commands for all tests with
things that are only relevant to the filesystem tests.

Differential Revision: https://reviews.llvm.org/D76785
2020-03-31 09:29:02 -04:00
Louis Dionne 05bc588abb [libc++] Do not rely on the environment to run filesystem tests
Previously, filesystem tests would require LIBCXX_FILESYSTEM_DYNAMIC_TEST_ROOT
to be present in the environment and to match the value provided when
compiling, as a macro. This has the problem that it only allows for the
filesystem tests to be run on the same machine they are created.

Instead, we create a temporary directory for each test. Technically,
this is tricky to do because we're relying on some of the code that
we're testing to do this. However, there's no other portable way of
creating temporary direcories in C++, so this is difficult to avoid.

Differential Revision: https://reviews.llvm.org/D76731
2020-03-31 09:03:17 -04:00
Louis Dionne 32c9efb423 [libc++] Add support for a new keyword ADDITIONAL_COMPILE_FLAGS
This allows adding compilation flags for a single test, which can help
eliminate some .sh.cpp tests and some custom handling in the libc++
test format.

It also works around the issue that .sh.cpp substitutions are _not_
equivalent to the actual compiler command lines used to compile tests,
since the compiler flags can be modified in local lit configurations,
and substitutions are frozen at that point. For example using %{compile}
in a .sh.cpp test in the coroutines subdirectory will not include the
-fcoroutines-ts flag, which is added in the local lit config, because
the %{compile} substitution is created long before we add -fcoroutines-ts
to the compiler flags (in the lit.local.cfg for coroutines).
2020-03-30 12:40:48 -04:00
Louis Dionne 67ebe5de57 [libc++] Avoid duplicating logic in the libcxx-specific filesystem local lit config
This will become more relevant as we shift more filesystem-specific
logic to the local lit configuration in test/std/input.output/filesystems.
2020-03-30 11:23:19 -04:00
Louis Dionne e9271a494f 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.

This is a re-application of f383fb40b1, wich was reverted in 04d48111b
because the build bots had not been updated yet. The build bot configurations
have now been updated not to use the deprecated targets, and I verified
that they were using the non-deprecated targets, so we should be good
unless I missed a bot.

Differential Revision: https://reviews.llvm.org/D76104
2020-03-30 09:45:21 -04:00
David Zarzycki 12f6b024f9
Revert "[libc++] NFC: Simplify substitutions by using lit recursive substitutions"
This reverts commit cd7f9751c3 which has
unintended breakage to non-libcxx projects when using the documented way
of building LLVM. (See the Getting Started guide. I.e. one big CMake setup.)
2020-03-29 21:08:42 -04:00
Louis Dionne e9a2caf34c [libc++] Use braces around %file_dependencies substitution
This one was left out from a previous commit.
2020-03-27 11:33:25 -04:00
Louis Dionne cd7f9751c3 [libc++] NFC: Simplify substitutions by using lit recursive substitutions
Since lit supports expanding substitutions recursively, we can define
substitutions in terms of other substitutions. This allows us to simplify
how libc++ substitutions are defined.

This doesn't change the substitutions at all, it only makes them simpler
to define.
2020-03-27 11:09:08 -04:00
Louis Dionne 08776defa5 [libc++/libc++abi] Properly delimit lit substitutions
lit is not very clever when it performs substitution on RUN lines. It
simply looks for a match anywhere in the line (without tokenization)
and replaces it by the expansion. This means that a RUN line containing
e.g. `-verify-ignore-unexpected=note` wouod be expanded to
`-verify-ignore-unexpected=<substitution for not>e`, which is
surprising and nonsensical.

It also means that something like `%compile_module` could be expanded
to `<substitution-for-%compile>_module` or to the correct substitution,
depending on the order in which substitutions are evaluated by lit.

To avoid such problems, it is a good habit to delimit custom substitutions
with some token. This commit does that for all substitutions used in the
libc++ and libc++abi test suites.
2020-03-27 10:27:38 -04:00
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
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
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
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 43a6d285bf [libc++] NFC: Reuse the TEST_CONCAT macro instead of reimplementing one 2020-03-24 15:28:18 -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
Eric Fiselier 90c74435d3 [libc++] tolerate missing diagnostic with modules enabled 2020-03-21 16:27:50 -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 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 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
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
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