Commit Graph

6776 Commits

Author SHA1 Message Date
Louis Dionne 9f4b888c32 [libc++] NFC: Remove unused includes from the test suite
- <iostream> include from a <chrono> test
- <regex> include from the filesystem tests
2020-10-23 15:51:54 -04:00
Louis Dionne cb9f6c4c8c [libc++] Clean up unused CI files
Those were useful during CI experimentation, but are not used anymore.
2020-10-23 15:21:04 -04:00
Louis Dionne 2f8dd2687f [libc++] Refactor the run-buildbot script to make it more modular, and run the benchmarks
As a fly-by fix, unbreak the benchmarks on Apple platforms.

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

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

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

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

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

Reviewed-by: ldionne

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

This fixes an error with libstdc++ on linux.

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

This only applies the change on the filesystem test subdir.

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

Reviewed By: #libc, ldionne

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

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

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

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

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

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

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

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

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

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

Use the right value_type in a few places.

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

Differential Revision: https://reviews.llvm.org/D89537
2020-10-16 21:04:23 +03:00