I was trying to fix something else and I stumbled upon several methods
that are not used anymore in target_info.py.
Differential Revision: https://reviews.llvm.org/D98896
This seems to be a documented quirk in libc++'s implementation of
weakly_canonical (in a comment in the weakly_canonical test).
Together with a difference between windows and posix regarding whether
paths can go through nonexistent dirs, this results in a difference in
a trailing slash.
Just document this as expected, and degrade the comment from fixme to
a note, as MS STL and libstdc++ behave in the same way.
Differential Revision: https://reviews.llvm.org/D98642
This came out of my review comments on D97283.
This patch re-enables the use of `__is_fundamental`, `__is_signed`, etc.
on non-Clang compilers. Previously, when we found that a builtin didn't
work on old Clangs, we had been reacting by limiting its use to new Clangs
(i.e., we'd also stop using it on new GCCs and new MSVCs, just because of
the old Clang bug). I claim that this was unintentional.
Notice that on Apple Clang, `_LIBCPP_COMPILER_CLANG` is defined and
`_LIBCPP_CLANG_VER` is not defined (therefore `0` in arithmetic expressions).
We assume that Apple Clang has all the bugs of all the Clangs.
Differential Revision: https://reviews.llvm.org/D98720
Prior to e0d01294bc, all tests used a
random directory name, but now it is deterministic, based on the
test name. This change was done under the assumption that the filename
portion of the cwd is unique across tests that use the filesystem
test temporary directories.
When running tests locally, the cwd of the test is something like
"<build-dir>/test/<test path>/Output/copy_assign.pass.cpp.dir",
and the filename portion, "copy_assign.pass.cpp.dir", is used as
base for the temp directory names.
The change noted that there's a risk for race conditions if multiple
threads within one test try to create temp directories in parallel, but
that doesn't really happen in practice.
However, if running tests with a large number of parallel workers,
multiple tests with the same filename portion, e.g. "copy_assign.pass.cpp.dir",
can run in parallel, leading to race conditions across processes.
Therefore, add a hash of the full cwd to distinguish such cases
from each other.
Secondly, don't use two separate levels of temporary directories
(<base>/static_env.0). When cleaning up, only the individual
directory is removed, leaving the empty intermediate directory
behind littering the temp directory.
Differential Revision: https://reviews.llvm.org/D98703
The aim is to use the correct vasprintf implementation for z/OS libc++, where a copy of va_list ap is needed. In particular, it avoids the potential that the initial internal call to vsnprintf will modify ap and the subsequent call to vsnprintf will use that modified ap.
Differential Revision: https://reviews.llvm.org/D97473
Both libc++ and libc++abi have options of merging with another archive. In the case of libc++abi, libunwind can be merged into it and in the case of libc++, libc++abi can be merged into it.
This is realized using add_custom_command with POST_BUILD and the usage of the CMake generator expression TARGET_LINKER_FILE in the arguments. For such generator expressions CMake doc states: "This target-level dependency does NOT add a file-level dependency that would cause the custom command to re-run whenever the executable is recompiled" [1]
This patch adds a DEPENDS argument to both add_custom_command invocations so that the archives also have a file-level dependency on the target they are merging with. That way, changes in say, libunwind source code, will be updated in the libc++abi and/or libc++ static libraries as well.
[1] https://cmake.org/cmake/help/v3.20/command/add_custom_command.html
Differential Revision: https://reviews.llvm.org/D98129
`__cpp_lib_default_template_type_for_algorithm_values` is 52 characters long,
which is enough to reduce the multiplier to less-than-zero, producing an empty
string between the name of the macro and its numeric value. Ensure there's
always a space between the name of the macro and its value.
Differential Revision: https://reviews.llvm.org/D98869
Also fix a comment typo, and remove a superfluous "std::" qualififcation
in __libcpp_semaphore_wait_timed for consistency.
This mirrors what was suggested in review of
1773eec692.
Differential Revision: https://reviews.llvm.org/D98015
This is my attempt to merge D98077 (bugfix the format strings for
Windows paths, which use wchar_t not char)
and D96986 (replace C++ variadic templates with C-style varargs so that
`__attribute__((format(printf)))` can be applied, for better safety)
and D98065 (remove an unused function overload).
The one intentional functional change here is in `__create_what`.
It now prints path1 and path2 in square-brackets _and_ double-quotes,
rather than just square-brackets. Prior to this patch, it would
print either path double-quoted if-and-only-if it was the empty
string. Now the double-quotes are always present. I doubt anybody's
code is relying on the current format, right?
Differential Revision: https://reviews.llvm.org/D98097
In previous versions of clang, __is_signed and __is_unsigned builtins did not
correspond to is_signed and is_unsigned behaviour for enums. The builtins were
fixed in D67897 and D98104.
* Disable the fast path of is_unsigned for clang versions < 13
* Add more tests for is_signed, is_unsigned and is_arithmetic
Differential Revision: https://reviews.llvm.org/D97283
Check a different set of env vars, don't check the exact value
of the fallback path. (GetTempPath falls back to returning the Windows
folder if nothing better is available in env vars.)
The test still fails one check on windows (due to relying on perms::none),
which will be addressed separately.
Differential Revision: https://reviews.llvm.org/D98139
Add the missing includes for getting the defines and functions used
in the mingw version of get_temp_file_name().
This fixes 31 tests when built in a mingw configuration.
Also remove a redundant ifdef; _WIN32 is defined in mingw targets too.
Differential Revision: https://reviews.llvm.org/D97456
On windows, the path internal representation is wchar_t, and
input/output often goes through utf8 inbetween, which causes extra
allocations.
MS STL also fails a number of strict allocation checks, so this
shouldn't be a standards compliance issue.
Differential Revision: https://reviews.llvm.org/D98398
Refresh the existing paragraphs on building in MSVC configurations,
add a sample of one working configuration for MinGW, and add more
details on what's necessary to run the tests these days.
Differential Revision: https://reviews.llvm.org/D97166
The aim is to define _LIBCPP_ELAST for z/OS libc++ since strerror/strerror_r can't handle out-of-range errno values.
Differential Revision: https://reviews.llvm.org/D98541
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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.
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