Commit Graph

7234 Commits

Author SHA1 Message Date
Muiez Ahmed febbf68b42 [SystemZ][z/OS] Missing wchar functions libc++
The aim is to add the missing z/OS specific implementations for mbsnrtowcs and wcsnrtombs, as part of libc++.

Differential Revision: https://reviews.llvm.org/D98207
2021-03-12 15:39:31 -05:00
Christopher Di Bella 8d4af1b6e0 [libcxx] adds concept std::regular
Implements parts of:
    - P0898R3 Standard Library Concepts
    - P1754 Rename concepts to standard_case for C++20, while we still can

Depends on D97911

Reviewed By: EricWF, #libc, Quuxplusone

Differential Revision: https://reviews.llvm.org/D98154
2021-03-12 08:54:03 -08:00
David Spickett 44e36fc2b1 [libcxx] Move Linaro 32 bit armv bots to buildkite
Instead of setting mcpu like the previous bots,
set the target triple.

Each config builds either Arm only or Thumb only
code. This gives us some coverage of thumb specific
issues.

The new agents on Linaro's side are running on v8 hardware
so will report arch "armv8l" just like the v8 bots.
(and buildkite can choose any of them for v7/v8 jobs)

Reviewed By: #libc, curdeius, Mordante

Differential Revision: https://reviews.llvm.org/D98019
2021-03-12 09:47:07 +00:00
Christopher Di Bella 154395536e [libcxx] adds concept std::semiregular
Implements parts of:
    - P0898R3 Standard Library Concepts
    - P1754 Rename concepts to standard_case for C++20, while we still can

Depends on D97443

Reviewed By: Quuxplusone, EricWF, #libc

Differential Revision: https://reviews.llvm.org/D97911
2021-03-11 22:40:07 -08:00
Christopher Di Bella 8ef69c66d5 [libcxx] adds concept std::copyable
Implements parts of:
    - P0898R3 Standard Library Concepts
    - P1754 Rename concepts to standard_case for C++20, while we still can

Depends on D97359

Reviewed By: EricWF, #libc, Quuxplusone, zoecarver

Differential Revision: https://reviews.llvm.org/D97443
2021-03-11 19:30:55 -08:00
Christopher Di Bella dc9f385722 [libcxx] adds concept std::movable
Implements parts of:
    - P0898R3 Standard Library Concepts
    - P1754 Rename concepts to standard_case for C++20, while we still can

Depends on D97162

Reviewed By: EricWF, #libc, Quuxplusone

Differential Revision: https://reviews.llvm.org/D97359
2021-03-11 19:27:43 -08:00
Marek Kurdej e9ba25b59d [libc++] [docs] Add link to clang status page for C++2b and fix anchor for C++20. 2021-03-11 20:49:14 +01:00
Martin Storsjö e69c65d5c4 [libcxx] Test accessing a directory on windows that gives "access denied" errors
Fix handling of skip_permission_denied on windows; after converting
the return value of GetLastError() to a standard error_code, ec.value()
is in the standard errc range, not a native windows error code. This
was missed in 156180727d.

The directory "C:\System Volume Information" does seem to exist and
have these properties on most relevant contempory setups.

Differential Revision: https://reviews.llvm.org/D98166
2021-03-11 21:07:29 +02:00
Martin Storsjö 8ba05e1489 [libcxx] [test] Disable a test regarding error behaviour for excessively long paths on windows
Checking for the existence of an invalid long path name isn't
an error in itself on windows.

Differential Revision: https://reviews.llvm.org/D98141
2021-03-11 20:21:54 +02:00
Martin Storsjö 49173ca4db [libcxx] Avoid intermediate string objects for substrings in windows operator/=
Check that appends with a path object doesn't do allocations, even
on windows.

Suggested by Marek in D98398. The patch might apply without D98398
(depending on how much of the diff context has to match), but doesn't
make much sense until after that patch has landed.

Differential Revision: https://reviews.llvm.org/D98412
2021-03-11 19:34:59 +02:00
Martin Storsjö cb2648e6f0 [libcxx] [test] Use a string_view of the native path type in the concat test
This makes sure that no extra allocations happen on windows, fixing
earlier errors in the DisableAllocationGuard (in the second case that
is modified).

This is split out from D98398.

Differential Revision: https://reviews.llvm.org/D98406
2021-03-11 19:34:58 +02:00
Aditya Kumar 6976255faf Add noreturn attribute to non-returning functions
Differential Revision: https://reviews.llvm.org/D97308
2021-03-10 14:35:50 -08:00
Martin Storsjö e23317c9da [libcxx] [test] Adjust separator form in fs.op.absolute for libc++ on windows
This test was previously tweaked in
321f696920 to match the output of
of MS STL (except that the MS STL fails on the testcase with an
empty path).

libc++ doesn't produce paths with all normalized separators (and the
spec doesn't mandate it to either).

Tweak the test reference to match exactly what libc++ produces. If
testing with a non-libc++ library, do a relaxed comparison that allows
the separators to differ.

Differential Revision: https://reviews.llvm.org/D98215
2021-03-09 16:57:26 +02:00
Muiez Ahmed ebe6161c54 [SystemZ][z/OS] Missing locale functions libc++
The aim is to add the missing z/OS specific locale functions for libc++ (newlocale, freelocale and uselocale).

Reviewed By: ldionne, #libc, curdeius

Differential Revision: https://reviews.llvm.org/D98044
2021-03-08 19:32:33 +00:00
Martin Storsjö b9f169fb7d [libcxx] Document windows specifics regarding file_type and perms. NFC.
This was requested in the review of D98138.

Differential Revision: https://reviews.llvm.org/D98155
2021-03-08 15:27:07 +02:00
Arthur O'Dwyer ab49f50ad0 [libc++] Fix typos in the synopsis of bit_xor, bit_not, etc. NFC. 2021-03-07 20:22:50 -05:00
Martin Storsjö 3a11a41795 [libcxx] [test] Don't test CharFile (/dev/null) on windows
Also clarify a nearby comment regarding block devices.

Differential Revision: https://reviews.llvm.org/D98138
2021-03-07 23:26:41 +02:00
Martin Storsjö 52c5f5ad5f [libcxx] [test] Fix building create_directory in MSVC configurations
Don't use the mode_t type - the official windows sdk doesn't have that type.
(Mingw headers does have such a typedef though.) The umask function returns
int on windows, in both header variants.

Thus just use auto to deduce the umask return type automatically.

Differential Revision: https://reviews.llvm.org/D98140
2021-03-07 23:26:41 +02:00
Martin Storsjö 4d571cf4e9 [libcxx] [test] Clarify and improve consistency in lexically_relative_and_proximate.pass.cpp. NFC.
Use "expect" instead of "output" for generating "proximate_expected",
pass the arguments to PathEq in the same order as above, rename the
"proximate_expected" variable to be consistent with the naming of the
earlier "expect", use .empty() instead of .native().empty().

Differential Revision: https://reviews.llvm.org/D98127
2021-03-07 23:15:05 +02:00
Martin Storsjö ab67fd39fc [libcxx] [test] Fix path.modifiers remove_filename and replace_filename for windows
Also fix the synopsis in the replace_filename test, while touching
that file.

Differential Revision: https://reviews.llvm.org/D98108
2021-03-07 10:37:13 +02:00
Martin Storsjö d601edf0b0 [libcxx] [test] Fix lexically_normal and lexically_relative_and_proximate for windows
Convert the expected result path to preferred separators, add exceptions
to the test results where needed (due to some cases being interpreted
as a root name).

Differential Revision: https://reviews.llvm.org/D98106
2021-03-06 22:42:38 +02:00
Martin Storsjö 15fdd536f9 [libcxx] [test] Fix path.itr/iterator.pass.cpp for windows
Differential Revision: https://reviews.llvm.org/D98107
2021-03-06 19:27:14 +02:00
David Zarzycki f4059cc352 Partially revert "[runtimes] Use add_lit_testsuite to register lit testsuites"
This partially reverts commit e1173c8794
until we find out why libcxx tests are failing under runtimes build.
2021-03-06 06:06:55 -05:00
Martin Storsjö 714644a36c [libcxx] [test] Move the is_<platform> functions down to subclasses
If cross testing (and manually specifying a LIBCXX_TARGET_INFO in the
cmake configuration, as the default is to match the build platform),
we want the accessors for querying the target platform, is_windows,
is_darwin, to return the right value depending on which target info
class is used, not based on what platform is running the build and
driving the tests.

When LIBCXX_TARGET_INFO isn't defined, the right target info class
is chosen automatically based on the platform one is running on, so
this shouldn't make any practical difference for such setups.

Differential Revision: https://reviews.llvm.org/D98045
2021-03-06 08:52:34 +02:00
Christopher Di Bella c744332793 [libcxx] adds std::ranges::swap, std::swappable, and std::swappable_with
Implements parts of:
    - P0898R3 Standard Library Concepts
    - P1754 Rename concepts to standard_case for C++20, while we still can

Depends on D96742

Differential Revision: https://reviews.llvm.org/D97162
2021-03-05 19:03:57 -08:00
Jessica Clarke 5d6e0e474e [benchmark] Replace references to M680x0 with M68k
The former was the old unusual name of the out-of-tree backend but it
was renamed to M68k during the code review process to conform with how
almost everything refers to the Motorola 68000 family of processors.
Thus, update the comments to avoid confusion when the backend lands.
2021-03-06 01:04:36 +00:00
Martin Storsjö 9e29852f5c [libcxx] [test] Fix detection of clang-cl when cross compiling
When cross compiling, the compiler tool doesn't have a .exe suffix.

Differential Revision: https://reviews.llvm.org/D98026
2021-03-06 00:49:26 +02:00
Martin Storsjö 1540646dbd [libcxx] Don't add -Wall when building in MSVC mode
The MSVC -Wall (or /Wall) option maps (in clang-cl) to the GCC style
option -Weverything, which we don't really want. Instead use -W4 which
is the corresponding MSVC option.

This silences the build with clang-cl, which previously used to
output 100 warnings per translation unit.

Differential Revision: https://reviews.llvm.org/D98035
2021-03-05 23:48:02 +02:00
Martin Storsjö 24a176b107 [libcxx] Apply pragma for silencing warning when building with clang-cl too
This silences warnings about unused functions (in an anonymous
namespace).

Differential Revision: https://reviews.llvm.org/D98036
2021-03-05 21:36:54 +02:00
Petr Hosek e1173c8794 [runtimes] Use add_lit_testsuite to register lit testsuites
The runtimes build uses variables set by add_lit_testsuite to collect
testsuites from all the runtimes.

Differential Revision: https://reviews.llvm.org/D97913
2021-03-05 10:37:21 -08:00
Martin Storsjö 232fec941d [libcxx] [test] Add an option to ssh.py for using a different temp path
If cross testing on Windows via WSL (at least with WSL 1), the Windows
executables can't be executed if they are in WSL specific directories
(like /tmp).

Differential Revision: https://reviews.llvm.org/D98028
2021-03-05 19:37:31 +02:00
Martin Storsjö 1adaf48d23 [libcxx] [test] Fix path.decompose for windows
Add ifdefs to the test reference tables for cases where paths are
interpreted differently (paths that contain a root name).

Fix test assumptions regarding has_root_name() and is_absolute() and
add logic to verify the results of is_absolute() for the test cases in
the table.

Also add a testcase for the path "//net/", which seemed like an
omission.

Differential Revision: https://reviews.llvm.org/D89943
2021-03-05 19:37:31 +02:00
Marek Kurdej 43e4214173 [libc++] [C++2b] [P1682] Add to_underlying.
* https://wg21.link/P1682

Reviewed By: ldionne, Mordante, #libc

Differential Revision: https://reviews.llvm.org/D97365
2021-03-05 10:31:21 +01:00
Martin Storsjö 29012ce986 [libcxx] Map ERROR_BAD_PATHNAME to errc::no_such_file_or_directory on windows
Opening a path like \\server (without a trailing share name and
path) produces this error, while opening e.g. \\server\share
(for a nonexistent server/share) produces ERROR_BAD_NETPATH (which
already is mapped).

This happens in some testcases (in fs.op.proximate); as proximate()
calls weakly_canonical() on the inputs, weakly_canonical() checks
whether the path exists or not. When the error code wasn't recognized
(it mapped to errc::invalid_argument), the stat operation wasn't
conclusive and weakly_canonical() errored out. With the proper error
code mapping, this isn't considered an error, just a nonexistent
path, and weakly_canonical() can proceed.

This roughly matches what MS STL does - it doesn't have
ERROR_BAD_PATHNAME in its error code mapping table, but it
checks for this error code specifically in the return of their
correspondence of the stat function.

Differential Revision: https://reviews.llvm.org/D97619
2021-03-05 10:49:03 +02:00
Martin Storsjö 99c7b53294 [libcxx] Avoid infinite recursion in create_directories, if the root directory doesn't exist
Differential Revision: https://reviews.llvm.org/D97618
2021-03-05 10:49:01 +02:00
Martin Storsjö 1773eec692 [libcxx] Implement semaphores for windows
Also add WIN32_LEAN_AND_MEAN before including windows.h, for consistency
with other sources.

Differential Revision: https://reviews.llvm.org/D97539
2021-03-05 10:48:59 +02:00
Christopher Di Bella 6eb5d55c55 [libcxx] fixes up some [concepts]-related code
* moves `std::copy_constructible` so it comes before
  `std::equality_comparable_with`
* replaces a few uses of `auto`
2021-03-04 22:09:43 -08:00
Christopher Di Bella e63ddcccf8 [libcxx] adds concepts std::equality_comparable[_with]
Implements parts of:
    - P0898R3 Standard Library Concepts
    - P1754 Rename concepts to standard_case for C++20, while we still can

Depends on D96660

Reviewed By: ldionne, #libc, Quuxplusone

Differential Revision: https://reviews.llvm.org/D97176
2021-03-04 18:24:04 -08:00
Martin Storsjö 53d7c63657 [libcxx] [test] Use separate references for windows in the path.append test
Differential Revision: https://reviews.llvm.org/D89945
2021-03-04 23:21:02 +02:00
Louis Dionne c7f244b897 [libc++] Properly pick up the Ninja from Xcode in the CI script 2021-03-04 16:03:39 -05:00
Muiez Ahmed 53c8587dcd [SystemZ][z/OS] Missing non-posix functions libc++
The aim is to add missing non-posix functions for z/OS libc++ (strtod_l and strtof_l).

Reviewed By: #libc, ldionne

Differential Revision: https://reviews.llvm.org/D97051
2021-03-04 15:23:21 +00:00
David Spickett 6e5342a6b0 [libcxx] Move Linaro AArch64 buildbots to buildkite
Reviewed By: #libc, ldionne

Differential Revision: https://reviews.llvm.org/D96267
2021-03-04 10:22:17 +00:00
Martin Storsjö c793f68d9b [libcxx] Don't use dllimport for a static member in a template
This fixes clang warnings (that are treated as errors when running
the test suite):

libcxx/include/string:4409:59: error: definition of dllimport static field [-Werror,-Wdllimport-static-field-def]
               basic_string<_CharT, _Traits, _Allocator>::npos;

The warning is normally not visible as long as the libc++ headers
are treated as system headers.

The same construct is always an error in MSVC.

(One _LIBCPP_FUNC_VIS was added in
2d8f23f571, which broke DLL builds.
59919c4d6b fixed this by adding another
_LIBCPP_FUNC_VIS on the declaration for consistency, but the underlying
issue remained, that one can't use dllimport here.)

Differential Revision: https://reviews.llvm.org/D97168
2021-03-04 08:55:27 +02:00
Christopher Di Bella 647af31e74 [libcxx] adds concept `std::assignable_from`
Implements parts of:
    - P0898R3 Standard Library Concepts
    - P1754 Rename concepts to standard_case for C++20, while we still can

Depends on D96660

Reviewed By: ldionne, #libc

Differential Revision: https://reviews.llvm.org/D96742
2021-03-03 22:41:55 -08:00
Christopher Di Bella f893312c1a [libcxx] adds concept `std::common_with`
Implements parts of:
    - P0898R3 Standard Library Concepts
    - P1754 Rename concepts to standard_case for C++20, while we still can

Depends on D96660

Reviewed By: ldionne, #libc

Differential Revision: https://reviews.llvm.org/D96683
2021-03-03 20:01:11 -08:00
Arthur O'Dwyer 09fa1d0e50 [libc++] Introduce __identity_t<T>. NFCI.
This is just a shorter synonym for `__identity<T>::type`.
Use it consistently throughout, where possible.

There is still some metaprogramming in <memory> and <variant>
where `__identity` is being used _without_ immediately calling
`::type` on it; but this is the unusual case, and it will become
even less usual as we start deliberately protecting certain types
against deduction (e.g. D97742).

Differential Revision: https://reviews.llvm.org/D97862
2021-03-03 22:23:14 -05:00
Christopher Di Bella 3f5438c46c [libcxx] adds concept `std::common_reference_with`
Implements parts of:
    - P0898R3 Standard Library Concepts
    - P1754 Rename concepts to standard_case for C++20, while we still can

Depends on D96657

Reviewed By: ldionne, Mordante, #libc

Differential Revision: https://reviews.llvm.org/D96660
2021-03-03 17:52:41 -08:00
Louis Dionne 460953ad9a [libc++] Temporary hack: disable Apple back-deployment testing
Apple back-deployment testing is currently failing because Green Dragon
is down. To avoid stalling the whole CI pipeline because of that, I am
temporarily disabling those jobs until Green Dragon is back, or even
better we have found a different way to store those small artifacts.
2021-03-03 17:02:48 -05:00
Louis Dionne 3c62198c61 [libc++] NFC: Normalize links to bug reports 2021-03-03 13:45:29 -05:00
Louis Dionne 5034d7115d [libc++] Use generator expression to simplify the CMake code
A comment was left for when we would require CMake >= 3, which we do now.
I expect this should be a NFC.

Differential Revision: https://reviews.llvm.org/D97341
2021-03-03 12:59:51 -05:00