diff --git a/libcxx/CMakeLists.txt b/libcxx/CMakeLists.txt --- a/libcxx/CMakeLists.txt +++ b/libcxx/CMakeLists.txt @@ -48,6 +48,10 @@ include(HandleCompilerRT) # Basic options --------------------------------------------------------------- +option(LIBCXX_ENABLE_ASSERTIONS + "Enable assertions inside the compiled library, and at the same time make it the + default when compiling user code. Note that assertions can be enabled or disabled + by users in their own code regardless of this option." OFF) option(LIBCXX_ENABLE_SHARED "Build libc++ as a shared library." ON) option(LIBCXX_ENABLE_STATIC "Build libc++ as a static library." ON) option(LIBCXX_ENABLE_FILESYSTEM @@ -747,6 +751,11 @@ config_define_if_not(LIBCXX_ENABLE_UNICODE _LIBCPP_HAS_NO_UNICODE) config_define_if_not(LIBCXX_ENABLE_WIDE_CHARACTERS _LIBCPP_HAS_NO_WIDE_CHARACTERS) config_define_if_not(LIBCXX_ENABLE_VENDOR_AVAILABILITY_ANNOTATIONS _LIBCPP_HAS_NO_VENDOR_AVAILABILITY_ANNOTATIONS) +if (LIBCXX_ENABLE_ASSERTIONS) + config_define(1 _LIBCPP_ENABLE_ASSERTIONS_DEFAULT) +else() + config_define(0 _LIBCPP_ENABLE_ASSERTIONS_DEFAULT) +endif() if (LIBCXX_HARDENING_MODE STREQUAL "hardened") config_define(1 _LIBCPP_ENABLE_HARDENED_MODE_DEFAULT) config_define(0 _LIBCPP_ENABLE_DEBUG_MODE_DEFAULT) @@ -757,11 +766,6 @@ config_define(0 _LIBCPP_ENABLE_HARDENED_MODE_DEFAULT) config_define(0 _LIBCPP_ENABLE_DEBUG_MODE_DEFAULT) endif() -# TODO(LLVM 18): Remove this after branching for LLVM 17, this is a simple -# courtesy for vendors to be notified about this change. -if (LIBCXX_ENABLE_ASSERTIONS) - message(FATAL_ERROR "LIBCXX_ENABLE_ASSERTIONS has been replaced by LIBCXX_HARDENING_MODE=hardened") -endif() if (LIBCXX_PSTL_CPU_BACKEND STREQUAL "serial") config_define(1 _LIBCPP_PSTL_CPU_BACKEND_SERIAL) diff --git a/libcxx/cmake/caches/Generic-assertions.cmake b/libcxx/cmake/caches/Generic-assertions.cmake new file mode 100644 --- /dev/null +++ b/libcxx/cmake/caches/Generic-assertions.cmake @@ -0,0 +1,2 @@ +set(LIBCXX_ENABLE_ASSERTIONS ON CACHE BOOL "") +set(LIBCXXABI_ENABLE_ASSERTIONS ON CACHE BOOL "") diff --git a/libcxx/docs/BuildingLibcxx.rst b/libcxx/docs/BuildingLibcxx.rst --- a/libcxx/docs/BuildingLibcxx.rst +++ b/libcxx/docs/BuildingLibcxx.rst @@ -211,6 +211,15 @@ Toggle the installation of the libc++ headers. +.. option:: LIBCXX_ENABLE_ASSERTIONS:BOOL + + **Default**: ``OFF`` + + Build libc++ with assertions enabled in the compiled library, and enable assertions + by default when building user code as well. Assertions can be turned off by users + by defining ``_LIBCPP_ENABLE_ASSERTIONS=0``. For details, see + :ref:`the documentation `. + .. option:: LIBCXX_ENABLE_SHARED:BOOL **Default**: ``ON`` diff --git a/libcxx/docs/Hardening.rst b/libcxx/docs/Hardening.rst deleted file mode 100644 --- a/libcxx/docs/Hardening.rst +++ /dev/null @@ -1,54 +0,0 @@ -============= -Hardened Mode -============= - -.. contents:: - :local: - -.. _using-hardened-mode: - -Using the hardened mode -======================= - -The hardened mode enables a set of security-critical assertions that prevent -undefined behavior caused by violating preconditions of the standard library. -These assertions can be done with relatively little overhead in constant time -and are intended to be used in production. - -In addition to the hardened mode, libc++ also provides the debug mode which -contains all the checks from the hardened mode and additionally more expensive -checks that may affect the complexity of algorithms. The debug mode is intended -to be used for testing, not in production. - -Vendors can set the default hardening mode by using the -``LIBCXX_HARDENING_MODE`` variable at CMake configuration time. Setting -``LIBCXX_HARDENING_MODE`` to ``hardened`` enables the hardened mode, and -similarly setting the variable to ``debug`` enables the debug mode. The default -value is ``unchecked`` which doesn't enable any hardening. - -When hardening is enabled, the compiled library is built with the corresponding -mode enabled, **and** user code will be built with the same mode enabled by -default. If the mode is set to "unchecked" at the CMake configuration time, the -compiled library will not contain any assertions and the default when building -user code will be to have assertions disabled. As a user, you can consult your -vendor to know which level of hardening is enabled by default. - -Furthermore, independently of any vendor-selected default, users can always -control which level of hardening is enabled in their code by defining -``_LIBCPP_ENABLE_HARDENED_MODE=0|1`` (or ``_LIBCPP_ENABLE_DEBUG_MODE=0|1``) -before including any libc++ header (we recommend passing -``-D_LIBCPP_ENABLE_HARDENED_MODE=X`` or ``-D_LIBCPP_ENABLE_DEBUG_MODE=X`` to the -compiler). Note that if the compiled library was built by the vendor in the -unchecked mode, functions compiled inside the static or shared library won't -have any hardening enabled even if the user compiles with hardening enabled (the -same is true for the inverse case where the static or shared library was -compiled **with** hardening enabled but the user tries to disable it). However, -most of the code in libc++ is in the headers, so the user-selected value for -``_LIBCPP_ENABLE_HARDENED_MODE`` or ``_LIBCPP_ENABLE_DEBUG_MODE`` (if any) will -usually be respected. - -Enabling hardening has no impact on the ABI. - -Iterator bounds checking ------------------------- -TODO(hardening) diff --git a/libcxx/docs/ReleaseNotes/17.rst b/libcxx/docs/ReleaseNotes/17.rst --- a/libcxx/docs/ReleaseNotes/17.rst +++ b/libcxx/docs/ReleaseNotes/17.rst @@ -105,19 +105,6 @@ Anything that does not rely on having an actual filesystem available will now work, such as ``std::filesystem::path``, ``std::filesystem::perms`` and similar classes. -- The library now provides a hardened mode under which common cases of library undefined behavior will be turned into - a reliable program termination. Vendors can configure whether the hardened mode is enabled by default with the - ``LIBCXX_HARDENING_MODE`` variable at CMake configuration time. Users can control whether the hardened mode is - enabled on a per translation unit basis using the ``-D_LIBCPP_ENABLE_HARDENED_MODE=1`` macro. See - ``libcxx/docs/Hardening.rst`` for more details. - -- The library now provides a debug mode which is a superset of the hardened mode, additionally enabling more expensive - checks that are not suitable to be used in production. This replaces the legacy debug mode that was removed in this - release. Unlike the legacy debug mode, this doesn't affect the ABI and doesn't require locking. Vendors can configure - whether the debug mode is enabled by default with the ``LIBCXX_HARDENING_MODE`` variable at CMake configuration time. - Users can control whether the debug mode is enabled on a per translation unit basis using the - ``-D_LIBCPP_ENABLE_DEBUG_MODE=1`` macro. See ``libcxx/docs/Hardening.rst`` for more details. - - ASan container annotations have been extended to cover all allocators in ``std::vector``. - ASan annotations have been added to the ``std::deque`` container, to detect container overflows. @@ -128,14 +115,8 @@ Deprecations and Removals ------------------------- -- The "safe" mode is replaced by the hardened mode in this release. The ``LIBCXX_ENABLE_ASSERTIONS`` CMake variable is - deprecated and setting it will trigger an error; use ``LIBCXX_HARDENING_MODE`` instead. Similarly, the - ``_LIBCPP_ENABLE_ASSERTIONS`` macro is deprecated and setting it to ``1`` now enables the hardened mode. See - ``libcxx/docs/Hardening.rst`` for more details. - -- The legacy debug mode has been removed in this release. Setting the macro ``_LIBCPP_ENABLE_DEBUG_MODE`` to ``1`` now - enables the new debug mode which is part of hardening (see the "Improvements and New Features" section above). The - ``LIBCXX_ENABLE_DEBUG_MODE`` CMake variable has been removed. For additional context, refer to the `Discourse post +- The legacy debug mode has been removed in this release. The ``LIBCXX_ENABLE_DEBUG_MODE`` CMake variable has been + removed. For additional context, refer to the `Discourse post `_. - The ```` header has been removed in this release. The ```` header diff --git a/libcxx/docs/UsingLibcxx.rst b/libcxx/docs/UsingLibcxx.rst --- a/libcxx/docs/UsingLibcxx.rst +++ b/libcxx/docs/UsingLibcxx.rst @@ -138,17 +138,50 @@ If you would prefer to not use that flag, then you can replace ``/path/to/include-what-you-use/share/libcxx.imp``` file with the libc++-provided ``libcxx.imp`` file. +.. _assertions-mode: + +Enabling the "safe libc++" mode +=============================== + +Libc++ contains a number of assertions whose goal is to catch undefined behavior in the +library, usually caused by precondition violations. Those assertions do not aim to be +exhaustive -- instead they aim to provide a good balance between safety and performance. +In particular, these assertions do not change the complexity of algorithms. However, they +might, in some cases, interfere with compiler optimizations. + +By default, these assertions are turned off. Vendors can decide to turn them on while building +the compiled library by defining ``LIBCXX_ENABLE_ASSERTIONS=ON`` at CMake configuration time. +When ``LIBCXX_ENABLE_ASSERTIONS`` is used, the compiled library will be built with assertions +enabled, **and** user code will be built with assertions enabled by default. If +``LIBCXX_ENABLE_ASSERTIONS=OFF`` at CMake configure time, the compiled library will not contain +assertions and the default when building user code will be to have assertions disabled. +As a user, you can consult your vendor to know whether assertions are enabled by default. + +Furthermore, independently of any vendor-selected default, users can always control whether +assertions are enabled in their code by defining ``_LIBCPP_ENABLE_ASSERTIONS=0|1`` before +including any libc++ header (we recommend passing ``-D_LIBCPP_ENABLE_ASSERTIONS=X`` to the +compiler). Note that if the compiled library was built by the vendor without assertions, +functions compiled inside the static or shared library won't have assertions enabled even +if the user defines ``_LIBCPP_ENABLE_ASSERTIONS=1`` (the same is true for the inverse case +where the static or shared library was compiled **with** assertions but the user tries to +disable them). However, most of the code in libc++ is in the headers, so the user-selected +value for ``_LIBCPP_ENABLE_ASSERTIONS`` (if any) will usually be respected. + +When an assertion fails, the program is aborted through a special verbose termination function. This +behavior is customizable; see the :ref:`Overriding the default termination handler +` section for more information. + .. _termination-handler: Overriding the default termination handler ========================================== -When the library wants to terminate due to an unforeseen condition (such as a hardening assertion -failure), the program is aborted through a special verbose termination function. The library provides -a default function that prints an error message and calls ``std::abort()``. Note that this function is -provided by the static or shared library, so it is only available when deploying to a platform where -the compiled library is sufficiently recent. On older platforms, the program will terminate in an -unspecified unsuccessful manner, but the quality of diagnostics won't be great. +When the library wants to terminate due to an unforeseen condition (such as an assertion failure), +the program is aborted through a special verbose termination function. The library provides +a default function that prints an error message and calls ``std::abort()``. Note that this function +is provided by the static or shared library, so it is only available when deploying to a platform +where the compiled library is sufficiently recent. On older platforms, the program will terminate in +an unspecified unsuccessful manner, but the quality of diagnostics won't be great. However, users can also override that mechanism at two different levels. First, the mechanism can be overridden at compile time by defining the ``_LIBCPP_VERBOSE_ABORT(format, args...)`` variadic macro. @@ -191,7 +224,7 @@ int main() { std::vector v; - int& x = v[0]; // Your termination function will be called here if hardening is enabled. + int& x = v[0]; // Your termination function will be called here if _LIBCPP_ENABLE_ASSERTIONS=1 } Also note that the verbose termination function should never return. Since assertions in libc++ @@ -206,7 +239,7 @@ =========================== Libc++ provides a number of configuration macros which can be used to enable -or disable extended libc++ behavior, including enabling hardening or thread +or disable extended libc++ behavior, including enabling the safe mode or thread safety annotations. **_LIBCPP_ENABLE_THREAD_SAFETY_ANNOTATIONS**: @@ -214,12 +247,6 @@ ``std::mutex`` and ``std::lock_guard``. By default, these annotations are disabled and must be manually enabled by the user. -**_LIBCPP_ENABLE_HARDENED_MODE**: - This macro is used to enable the :ref:`hardened mode `. - -**_LIBCPP_ENABLE_DEBUG_MODE**: - This macro is used to enable the :ref:`debug mode `. - **_LIBCPP_DISABLE_VISIBILITY_ANNOTATIONS**: This macro is used to disable all visibility annotations inside libc++. Defining this macro and then building libc++ with hidden visibility gives a diff --git a/libcxx/include/__config b/libcxx/include/__config --- a/libcxx/include/__config +++ b/libcxx/include/__config @@ -208,19 +208,16 @@ // HARDENING { -// TODO(hardening): remove this in LLVM 18. -// This is for backward compatibility -- make enabling `_LIBCPP_ENABLE_ASSERTIONS` (which predates hardening modes) -// equivalent to setting the hardened mode. -# ifdef _LIBCPP_ENABLE_ASSERTIONS -# warning "_LIBCPP_ENABLE_ASSERTIONS is deprecated, please use _LIBCPP_ENABLE_HARDENED_MODE instead." -# if _LIBCPP_ENABLE_ASSERTIONS != 0 && _LIBCPP_ENABLE_ASSERTIONS != 1 -# error "_LIBCPP_ENABLE_ASSERTIONS must be set to 0 or 1" -# endif -# if _LIBCPP_ENABLE_ASSERTIONS -# define _LIBCPP_ENABLE_HARDENED_MODE 1 -# endif +# ifndef _LIBCPP_ENABLE_ASSERTIONS +# define _LIBCPP_ENABLE_ASSERTIONS _LIBCPP_ENABLE_ASSERTIONS_DEFAULT +# endif +# if _LIBCPP_ENABLE_ASSERTIONS != 0 && _LIBCPP_ENABLE_ASSERTIONS != 1 +# error "_LIBCPP_ENABLE_ASSERTIONS must be set to 0 or 1" # endif +// NOTE: These modes are experimental and are not stable yet in LLVM 17. Please refrain from using them and use the +// documented libc++ "safe" mode instead. +// // Enables the hardened mode which consists of all checks intended to be used in production. Hardened mode prioritizes // security-critical checks that can be done with relatively little overhead in constant time. Mutually exclusive with // `_LIBCPP_ENABLE_DEBUG_MODE`. @@ -275,6 +272,11 @@ # error "Only one of _LIBCPP_ENABLE_HARDENED_MODE and _LIBCPP_ENABLE_DEBUG_MODE can be enabled." # endif +# if _LIBCPP_ENABLE_ASSERTIONS && (_LIBCPP_ENABLE_HARDENED_MODE || _LIBCPP_ENABLE_DEBUG_MODE) +# error \ + "_LIBCPP_ENABLE_ASSERTIONS is mutually exclusive with _LIBCPP_ENABLE_HARDENED_MODE and _LIBCPP_ENABLE_DEBUG_MODE." +# endif + // Hardened mode checks. // clang-format off @@ -303,6 +305,18 @@ # define _LIBCPP_ASSERT_INTERNAL(expression, message) _LIBCPP_ASSERT(expression, message) # define _LIBCPP_ASSERT_UNCATEGORIZED(expression, message) _LIBCPP_ASSERT(expression, message) +// Safe mode checks. + +# elif _LIBCPP_ENABLE_ASSERTIONS + +// All checks enabled. +# define _LIBCPP_ASSERT_VALID_INPUT_RANGE(expression, message) _LIBCPP_ASSERT(expression, message) +# define _LIBCPP_ASSERT_VALID_ELEMENT_ACCESS(expression, message) _LIBCPP_ASSERT(expression, message) +# define _LIBCPP_ASSERT_NON_OVERLAPPING_RANGES(expression, message) _LIBCPP_ASSERT(expression, message) +# define _LIBCPP_ASSERT_COMPATIBLE_ALLOCATOR(expression, message) _LIBCPP_ASSERT(expression, message) +# define _LIBCPP_ASSERT_INTERNAL(expression, message) _LIBCPP_ASSERT(expression, message) +# define _LIBCPP_ASSERT_UNCATEGORIZED(expression, message) _LIBCPP_ASSERT(expression, message) + // Disable all checks if hardening is not enabled. # else diff --git a/libcxx/include/__config_site.in b/libcxx/include/__config_site.in --- a/libcxx/include/__config_site.in +++ b/libcxx/include/__config_site.in @@ -27,6 +27,7 @@ #cmakedefine _LIBCPP_HAS_NO_RANDOM_DEVICE #cmakedefine _LIBCPP_HAS_NO_LOCALIZATION #cmakedefine _LIBCPP_HAS_NO_WIDE_CHARACTERS +#cmakedefine01 _LIBCPP_ENABLE_ASSERTIONS_DEFAULT // PSTL backends #cmakedefine _LIBCPP_PSTL_CPU_BACKEND_SERIAL diff --git a/libcxx/test/CMakeLists.txt b/libcxx/test/CMakeLists.txt --- a/libcxx/test/CMakeLists.txt +++ b/libcxx/test/CMakeLists.txt @@ -24,6 +24,10 @@ serialize_lit_param(enable_rtti False) endif() +if (LIBCXX_ENABLE_ASSERTIONS) + serialize_lit_param(enable_assertions True) +endif() + serialize_lit_param(hardening_mode "\"${LIBCXX_HARDENING_MODE}\"") if (CMAKE_CXX_COMPILER_TARGET) diff --git a/libcxx/test/libcxx/algorithms/alg.sorting/assert.min.max.pass.cpp b/libcxx/test/libcxx/algorithms/alg.sorting/assert.min.max.pass.cpp --- a/libcxx/test/libcxx/algorithms/alg.sorting/assert.min.max.pass.cpp +++ b/libcxx/test/libcxx/algorithms/alg.sorting/assert.min.max.pass.cpp @@ -10,7 +10,7 @@ // REQUIRES: has-unix-headers // UNSUPPORTED: c++03, c++11, c++14, c++17 -// UNSUPPORTED: !libcpp-has-debug-mode +// UNSUPPORTED: !libcpp-has-debug-mode && !libcpp-has-assertions // XFAIL: availability-verbose_abort-missing #include diff --git a/libcxx/test/libcxx/assertions/modes/unchecked.pass.cpp b/libcxx/test/libcxx/assertions/assertions_disabled.pass.cpp copy from libcxx/test/libcxx/assertions/modes/unchecked.pass.cpp copy to libcxx/test/libcxx/assertions/assertions_disabled.pass.cpp --- a/libcxx/test/libcxx/assertions/modes/unchecked.pass.cpp +++ b/libcxx/test/libcxx/assertions/assertions_disabled.pass.cpp @@ -6,10 +6,12 @@ // //===----------------------------------------------------------------------===// -// This test checks that if no hardening mode is defined (i.e., in the unchecked mode), by default assertions aren't -// triggered. +// Test that _LIBCPP_ASSERT doesn't do anything when assertions are disabled. +// We need to use -Wno-macro-redefined because the test suite defines +// _LIBCPP_ENABLE_ASSERTIONS=1 under some configurations. -// UNSUPPORTED: libcpp-has-hardened-mode, libcpp-has-debug-mode +// XFAIL: libcpp-hardening-mode={{hardened|debug}} +// ADDITIONAL_COMPILE_FLAGS: -Wno-macro-redefined -D_LIBCPP_ENABLE_ASSERTIONS=0 #include @@ -17,10 +19,7 @@ bool f() { executed_condition = true; return false; } int main(int, char**) { - _LIBCPP_ASSERT_UNCATEGORIZED(true, "Should not fire"); - _LIBCPP_ASSERT_UNCATEGORIZED(false, "Also should not fire"); - _LIBCPP_ASSERT_UNCATEGORIZED(f(), "Should not execute anything"); - assert(!executed_condition); // Really make sure we did not execute anything. - + _LIBCPP_ASSERT_VALID_ELEMENT_ACCESS(f(), "message"); // should not execute anything + assert(!executed_condition); // really make sure we did not execute anything at all return 0; } diff --git a/libcxx/test/libcxx/assertions/modes/debug.pass.cpp b/libcxx/test/libcxx/assertions/modes/debug.pass.cpp --- a/libcxx/test/libcxx/assertions/modes/debug.pass.cpp +++ b/libcxx/test/libcxx/assertions/modes/debug.pass.cpp @@ -9,7 +9,7 @@ // This test ensures that assertions trigger without the user having to do anything when the debug mode has been enabled // by default. -// UNSUPPORTED: !libcpp-has-debug-mode +// REQUIRES: libcpp-has-debug-mode // `check_assertion.h` is only available starting from C++11. // UNSUPPORTED: c++03 // `check_assertion.h` requires Unix headers. diff --git a/libcxx/test/libcxx/assertions/modes/debug_mode_disabled_in_tu.pass.cpp b/libcxx/test/libcxx/assertions/modes/debug_mode_disabled_in_tu.pass.cpp --- a/libcxx/test/libcxx/assertions/modes/debug_mode_disabled_in_tu.pass.cpp +++ b/libcxx/test/libcxx/assertions/modes/debug_mode_disabled_in_tu.pass.cpp @@ -8,7 +8,7 @@ // This test ensures that we can disable the debug mode on a per-TU basis regardless of how the library was built. -// UNSUPPORTED: libcpp-has-hardened-mode +// REQUIRES: libcpp-has-debug-mode // ADDITIONAL_COMPILE_FLAGS: -Wno-macro-redefined -D_LIBCPP_ENABLE_DEBUG_MODE=0 #include diff --git a/libcxx/test/libcxx/assertions/modes/debug_mode_enabled_in_tu.pass.cpp b/libcxx/test/libcxx/assertions/modes/debug_mode_enabled_in_tu.pass.cpp --- a/libcxx/test/libcxx/assertions/modes/debug_mode_enabled_in_tu.pass.cpp +++ b/libcxx/test/libcxx/assertions/modes/debug_mode_enabled_in_tu.pass.cpp @@ -9,7 +9,7 @@ // This test ensures that we can enable the debug mode on a per-TU basis regardless of how the library was built. // Hardened mode would additionally trigger the error that hardened and debug modes are mutually exclusive. -// UNSUPPORTED: libcpp-has-hardened-mode +// REQUIRES: libcpp-hardening-mode=unchecked // `check_assertion.h` is only available starting from C++11 and requires Unix headers. // UNSUPPORTED: c++03, !has-unix-headers // The ability to set a custom abort message is required to compare the assertion message. diff --git a/libcxx/test/libcxx/assertions/modes/debug_mode_not_1_or_0.verify.cpp b/libcxx/test/libcxx/assertions/modes/debug_mode_not_1_or_0.verify.cpp --- a/libcxx/test/libcxx/assertions/modes/debug_mode_not_1_or_0.verify.cpp +++ b/libcxx/test/libcxx/assertions/modes/debug_mode_not_1_or_0.verify.cpp @@ -9,7 +9,7 @@ // This test verifies that setting the debug mode to a value other than `0` or `1` triggers a compile-time error. // Hardened mode would additionally trigger the error that hardened and debug modes are mutually exclusive. -// UNSUPPORTED: libcpp-has-hardened-mode +// REQUIRES: libcpp-hardening-mode=unchecked // Modules build produces a different error ("Could not build module 'std'"). // UNSUPPORTED: modules-build // ADDITIONAL_COMPILE_FLAGS: -Wno-macro-redefined -D_LIBCPP_ENABLE_DEBUG_MODE=2 diff --git a/libcxx/test/libcxx/assertions/modes/hardened_and_debug_mutually_exclusive.verify.cpp b/libcxx/test/libcxx/assertions/modes/enable_assertions_and_debug_mutually_exclusive.verify.cpp copy from libcxx/test/libcxx/assertions/modes/hardened_and_debug_mutually_exclusive.verify.cpp copy to libcxx/test/libcxx/assertions/modes/enable_assertions_and_debug_mutually_exclusive.verify.cpp --- a/libcxx/test/libcxx/assertions/modes/hardened_and_debug_mutually_exclusive.verify.cpp +++ b/libcxx/test/libcxx/assertions/modes/enable_assertions_and_debug_mutually_exclusive.verify.cpp @@ -6,12 +6,13 @@ // //===----------------------------------------------------------------------===// -// This test verifies that `_LIBCPP_ENABLE_HARDENED_MODE` and `_LIBCPP_ENABLE_DEBUG_MODE` are mutually exclusive. +// This test verifies that `_LIBCPP_ENABLE_ASSERTIONS` and `_LIBCPP_ENABLE_DEBUG_MODE` are mutually exclusive. // Modules build produces a different error ("Could not build module 'std'"). // UNSUPPORTED: modules-build -// ADDITIONAL_COMPILE_FLAGS: -Wno-macro-redefined -D_LIBCPP_ENABLE_HARDENED_MODE=1 -D_LIBCPP_ENABLE_DEBUG_MODE=1 +// REQUIRES: libcpp-hardening-mode=unchecked +// ADDITIONAL_COMPILE_FLAGS: -Wno-macro-redefined -D_LIBCPP_ENABLE_ASSERTIONS=1 -D_LIBCPP_ENABLE_DEBUG_MODE=1 #include -// expected-error@*:* {{Only one of _LIBCPP_ENABLE_HARDENED_MODE and _LIBCPP_ENABLE_DEBUG_MODE can be enabled.}} +// expected-error@*:* {{_LIBCPP_ENABLE_ASSERTIONS is mutually exclusive with _LIBCPP_ENABLE_HARDENED_MODE and _LIBCPP_ENABLE_DEBUG_MODE.}} diff --git a/libcxx/test/libcxx/assertions/modes/hardened_and_debug_mutually_exclusive.verify.cpp b/libcxx/test/libcxx/assertions/modes/enable_assertions_and_hardened_mutually_exclusive.verify.cpp copy from libcxx/test/libcxx/assertions/modes/hardened_and_debug_mutually_exclusive.verify.cpp copy to libcxx/test/libcxx/assertions/modes/enable_assertions_and_hardened_mutually_exclusive.verify.cpp --- a/libcxx/test/libcxx/assertions/modes/hardened_and_debug_mutually_exclusive.verify.cpp +++ b/libcxx/test/libcxx/assertions/modes/enable_assertions_and_hardened_mutually_exclusive.verify.cpp @@ -6,12 +6,13 @@ // //===----------------------------------------------------------------------===// -// This test verifies that `_LIBCPP_ENABLE_HARDENED_MODE` and `_LIBCPP_ENABLE_DEBUG_MODE` are mutually exclusive. +// This test verifies that `_LIBCPP_ENABLE_ASSERTIONS` and `_LIBCPP_ENABLE_HARDENED_MODE` are mutually exclusive. // Modules build produces a different error ("Could not build module 'std'"). // UNSUPPORTED: modules-build -// ADDITIONAL_COMPILE_FLAGS: -Wno-macro-redefined -D_LIBCPP_ENABLE_HARDENED_MODE=1 -D_LIBCPP_ENABLE_DEBUG_MODE=1 +// REQUIRES: libcpp-hardening-mode=unchecked +// ADDITIONAL_COMPILE_FLAGS: -Wno-macro-redefined -D_LIBCPP_ENABLE_ASSERTIONS=1 -D_LIBCPP_ENABLE_HARDENED_MODE=1 #include -// expected-error@*:* {{Only one of _LIBCPP_ENABLE_HARDENED_MODE and _LIBCPP_ENABLE_DEBUG_MODE can be enabled.}} +// expected-error@*:* {{_LIBCPP_ENABLE_ASSERTIONS is mutually exclusive with _LIBCPP_ENABLE_HARDENED_MODE and _LIBCPP_ENABLE_DEBUG_MODE.}} diff --git a/libcxx/test/libcxx/assertions/modes/enabling_assertions_enables_hardened_mode.pass.cpp b/libcxx/test/libcxx/assertions/modes/enabling_assertions_enables_hardened_mode.pass.cpp deleted file mode 100644 --- a/libcxx/test/libcxx/assertions/modes/enabling_assertions_enables_hardened_mode.pass.cpp +++ /dev/null @@ -1,33 +0,0 @@ -//===----------------------------------------------------------------------===// -// -// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. -// See https://llvm.org/LICENSE.txt for license information. -// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception -// -//===----------------------------------------------------------------------===// - -// TODO(hardening): remove in LLVM 18. -// This test ensures that enabling assertions now enables the hardened mode. - -// `check_assertion.h` is only available starting from C++11 and requires Unix headers. -// UNSUPPORTED: c++03, !has-unix-headers -// The ability to set a custom abort message is required to compare the assertion message. -// XFAIL: availability-verbose_abort-missing -// Debug mode is mutually exclusive with hardened mode. -// UNSUPPORTED: libcpp-has-debug-mode -// Ignore the warning about `_LIBCPP_ENABLE_ASSERTIONS` being deprecated. -// ADDITIONAL_COMPILE_FLAGS: -Wno-error -D_LIBCPP_ENABLE_ASSERTIONS=1 - -#include -#include "check_assertion.h" - -int main(int, char**) { - static_assert(_LIBCPP_ENABLE_HARDENED_MODE == 1, "Hardened mode should be implicitly enabled"); - - _LIBCPP_ASSERT_VALID_ELEMENT_ACCESS(true, "Should not fire"); - TEST_LIBCPP_ASSERT_FAILURE([] { - _LIBCPP_ASSERT_VALID_ELEMENT_ACCESS(false, "Should fire"); - }(), "Should fire"); - - return 0; -} diff --git a/libcxx/test/libcxx/assertions/modes/hardened.pass.cpp b/libcxx/test/libcxx/assertions/modes/hardened.pass.cpp --- a/libcxx/test/libcxx/assertions/modes/hardened.pass.cpp +++ b/libcxx/test/libcxx/assertions/modes/hardened.pass.cpp @@ -9,7 +9,7 @@ // This test ensures that assertions trigger without the user having to do anything when the hardened mode has been // enabled by default. -// UNSUPPORTED: !libcpp-has-hardened-mode +// REQUIRES: libcpp-has-hardened-mode // `check_assertion.h` is only available starting from C++11. // UNSUPPORTED: c++03 // `check_assertion.h` requires Unix headers. diff --git a/libcxx/test/libcxx/assertions/modes/hardened_and_debug_mutually_exclusive.verify.cpp b/libcxx/test/libcxx/assertions/modes/hardened_and_debug_mutually_exclusive.verify.cpp --- a/libcxx/test/libcxx/assertions/modes/hardened_and_debug_mutually_exclusive.verify.cpp +++ b/libcxx/test/libcxx/assertions/modes/hardened_and_debug_mutually_exclusive.verify.cpp @@ -10,6 +10,8 @@ // Modules build produces a different error ("Could not build module 'std'"). // UNSUPPORTED: modules-build +// If `_LIBCPP_ENABLE_ASSERTIONS` is defined, it would additionally produce a different error. +// UNSUPPORTED: libcpp-has-assertions // ADDITIONAL_COMPILE_FLAGS: -Wno-macro-redefined -D_LIBCPP_ENABLE_HARDENED_MODE=1 -D_LIBCPP_ENABLE_DEBUG_MODE=1 #include diff --git a/libcxx/test/libcxx/assertions/modes/hardened_mode_disabled_in_tu.pass.cpp b/libcxx/test/libcxx/assertions/modes/hardened_mode_disabled_in_tu.pass.cpp --- a/libcxx/test/libcxx/assertions/modes/hardened_mode_disabled_in_tu.pass.cpp +++ b/libcxx/test/libcxx/assertions/modes/hardened_mode_disabled_in_tu.pass.cpp @@ -8,7 +8,7 @@ // This test ensures that we can disable the hardened mode on a per-TU basis regardless of how the library was built. -// UNSUPPORTED: libcpp-has-debug-mode +// REQUIRES: libcpp-has-hardened-mode // ADDITIONAL_COMPILE_FLAGS: -Wno-macro-redefined -D_LIBCPP_ENABLE_HARDENED_MODE=0 #include diff --git a/libcxx/test/libcxx/assertions/modes/hardened_mode_enabled_in_tu.pass.cpp b/libcxx/test/libcxx/assertions/modes/hardened_mode_enabled_in_tu.pass.cpp --- a/libcxx/test/libcxx/assertions/modes/hardened_mode_enabled_in_tu.pass.cpp +++ b/libcxx/test/libcxx/assertions/modes/hardened_mode_enabled_in_tu.pass.cpp @@ -9,7 +9,7 @@ // This test ensures that we can enable the hardened mode on a per-TU basis regardless of how the library was built. // Debug mode would additionally trigger the error that hardened and debug modes are mutually exclusive. -// UNSUPPORTED: libcpp-has-debug-mode +// REQUIRES: libcpp-hardening-mode=unchecked // `check_assertion.h` is only available starting from C++11. // UNSUPPORTED: c++03 // `check_assertion.h` requires Unix headers. diff --git a/libcxx/test/libcxx/assertions/modes/hardened_mode_not_1_or_0.verify.cpp b/libcxx/test/libcxx/assertions/modes/hardened_mode_not_1_or_0.verify.cpp --- a/libcxx/test/libcxx/assertions/modes/hardened_mode_not_1_or_0.verify.cpp +++ b/libcxx/test/libcxx/assertions/modes/hardened_mode_not_1_or_0.verify.cpp @@ -9,7 +9,7 @@ // This test verifies that setting the hardened mode to a value other than `0` or `1` triggers a compile-time error. // Debug mode would additionally trigger the error that hardened and debug modes are mutually exclusive. -// UNSUPPORTED: libcpp-has-debug-mode +// REQUIRES: libcpp-hardening-mode=unchecked // Modules build produces a different error ("Could not build module 'std'"). // UNSUPPORTED: modules-build // ADDITIONAL_COMPILE_FLAGS: -Wno-macro-redefined -D_LIBCPP_ENABLE_HARDENED_MODE=2 diff --git a/libcxx/test/libcxx/assertions/modes/unchecked.pass.cpp b/libcxx/test/libcxx/assertions/modes/unchecked.pass.cpp --- a/libcxx/test/libcxx/assertions/modes/unchecked.pass.cpp +++ b/libcxx/test/libcxx/assertions/modes/unchecked.pass.cpp @@ -9,7 +9,7 @@ // This test checks that if no hardening mode is defined (i.e., in the unchecked mode), by default assertions aren't // triggered. -// UNSUPPORTED: libcpp-has-hardened-mode, libcpp-has-debug-mode +// REQUIRES: libcpp-hardening-mode=unchecked && !libcpp-has-assertions #include diff --git a/libcxx/test/libcxx/containers/sequences/array/array.zero/assert.back.pass.cpp b/libcxx/test/libcxx/containers/sequences/array/array.zero/assert.back.pass.cpp --- a/libcxx/test/libcxx/containers/sequences/array/array.zero/assert.back.pass.cpp +++ b/libcxx/test/libcxx/containers/sequences/array/array.zero/assert.back.pass.cpp @@ -8,7 +8,7 @@ // REQUIRES: has-unix-headers // UNSUPPORTED: c++03 -// UNSUPPORTED: !libcpp-has-hardened-mode && !libcpp-has-debug-mode +// UNSUPPORTED: !libcpp-has-hardened-mode && !libcpp-has-debug-mode && !libcpp-has-assertions // XFAIL: availability-verbose_abort-missing // test that array::back() triggers an assertion diff --git a/libcxx/test/libcxx/containers/sequences/array/array.zero/assert.front.pass.cpp b/libcxx/test/libcxx/containers/sequences/array/array.zero/assert.front.pass.cpp --- a/libcxx/test/libcxx/containers/sequences/array/array.zero/assert.front.pass.cpp +++ b/libcxx/test/libcxx/containers/sequences/array/array.zero/assert.front.pass.cpp @@ -8,7 +8,7 @@ // REQUIRES: has-unix-headers // UNSUPPORTED: c++03 -// UNSUPPORTED: !libcpp-has-hardened-mode && !libcpp-has-debug-mode +// UNSUPPORTED: !libcpp-has-hardened-mode && !libcpp-has-debug-mode && !libcpp-has-assertions // XFAIL: availability-verbose_abort-missing // test that array::back() triggers an assertion diff --git a/libcxx/test/libcxx/containers/sequences/array/array.zero/assert.subscript.pass.cpp b/libcxx/test/libcxx/containers/sequences/array/array.zero/assert.subscript.pass.cpp --- a/libcxx/test/libcxx/containers/sequences/array/array.zero/assert.subscript.pass.cpp +++ b/libcxx/test/libcxx/containers/sequences/array/array.zero/assert.subscript.pass.cpp @@ -8,7 +8,7 @@ // REQUIRES: has-unix-headers // UNSUPPORTED: c++03 -// UNSUPPORTED: !libcpp-has-hardened-mode && !libcpp-has-debug-mode +// UNSUPPORTED: !libcpp-has-hardened-mode && !libcpp-has-debug-mode && !libcpp-has-assertions // XFAIL: availability-verbose_abort-missing // test that array::operator[] triggers an assertion diff --git a/libcxx/test/libcxx/containers/sequences/deque/assert.pop_back.empty.pass.cpp b/libcxx/test/libcxx/containers/sequences/deque/assert.pop_back.empty.pass.cpp --- a/libcxx/test/libcxx/containers/sequences/deque/assert.pop_back.empty.pass.cpp +++ b/libcxx/test/libcxx/containers/sequences/deque/assert.pop_back.empty.pass.cpp @@ -12,7 +12,7 @@ // REQUIRES: has-unix-headers // UNSUPPORTED: c++03 -// UNSUPPORTED: !libcpp-has-hardened-mode && !libcpp-has-debug-mode +// UNSUPPORTED: !libcpp-has-hardened-mode && !libcpp-has-debug-mode && !libcpp-has-assertions // XFAIL: availability-verbose_abort-missing #include diff --git a/libcxx/test/libcxx/containers/sequences/list/list.modifiers/assert.erase_iter.end.pass.cpp b/libcxx/test/libcxx/containers/sequences/list/list.modifiers/assert.erase_iter.end.pass.cpp --- a/libcxx/test/libcxx/containers/sequences/list/list.modifiers/assert.erase_iter.end.pass.cpp +++ b/libcxx/test/libcxx/containers/sequences/list/list.modifiers/assert.erase_iter.end.pass.cpp @@ -12,7 +12,7 @@ // REQUIRES: has-unix-headers // UNSUPPORTED: c++03 -// UNSUPPORTED: !libcpp-has-hardened-mode && !libcpp-has-debug-mode +// UNSUPPORTED: !libcpp-has-hardened-mode && !libcpp-has-debug-mode && !libcpp-has-assertions // XFAIL: availability-verbose_abort-missing #include diff --git a/libcxx/test/libcxx/containers/sequences/list/list.modifiers/assert.pop_back.empty.pass.cpp b/libcxx/test/libcxx/containers/sequences/list/list.modifiers/assert.pop_back.empty.pass.cpp --- a/libcxx/test/libcxx/containers/sequences/list/list.modifiers/assert.pop_back.empty.pass.cpp +++ b/libcxx/test/libcxx/containers/sequences/list/list.modifiers/assert.pop_back.empty.pass.cpp @@ -12,7 +12,7 @@ // REQUIRES: has-unix-headers // UNSUPPORTED: c++03 -// UNSUPPORTED: !libcpp-has-hardened-mode && !libcpp-has-debug-mode +// UNSUPPORTED: !libcpp-has-hardened-mode && !libcpp-has-debug-mode && !libcpp-has-assertions // XFAIL: availability-verbose_abort-missing #include diff --git a/libcxx/test/libcxx/containers/sequences/vector/assert.back.empty.pass.cpp b/libcxx/test/libcxx/containers/sequences/vector/assert.back.empty.pass.cpp --- a/libcxx/test/libcxx/containers/sequences/vector/assert.back.empty.pass.cpp +++ b/libcxx/test/libcxx/containers/sequences/vector/assert.back.empty.pass.cpp @@ -12,7 +12,7 @@ // REQUIRES: has-unix-headers // UNSUPPORTED: c++03 -// UNSUPPORTED: !libcpp-has-hardened-mode && !libcpp-has-debug-mode +// UNSUPPORTED: !libcpp-has-hardened-mode && !libcpp-has-debug-mode && !libcpp-has-assertions // XFAIL: availability-verbose_abort-missing #include diff --git a/libcxx/test/libcxx/containers/sequences/vector/assert.cback.empty.pass.cpp b/libcxx/test/libcxx/containers/sequences/vector/assert.cback.empty.pass.cpp --- a/libcxx/test/libcxx/containers/sequences/vector/assert.cback.empty.pass.cpp +++ b/libcxx/test/libcxx/containers/sequences/vector/assert.cback.empty.pass.cpp @@ -12,7 +12,7 @@ // REQUIRES: has-unix-headers // UNSUPPORTED: c++03 -// UNSUPPORTED: !libcpp-has-hardened-mode && !libcpp-has-debug-mode +// UNSUPPORTED: !libcpp-has-hardened-mode && !libcpp-has-debug-mode && !libcpp-has-assertions // XFAIL: availability-verbose_abort-missing #include diff --git a/libcxx/test/libcxx/containers/sequences/vector/assert.cfront.empty.pass.cpp b/libcxx/test/libcxx/containers/sequences/vector/assert.cfront.empty.pass.cpp --- a/libcxx/test/libcxx/containers/sequences/vector/assert.cfront.empty.pass.cpp +++ b/libcxx/test/libcxx/containers/sequences/vector/assert.cfront.empty.pass.cpp @@ -12,7 +12,7 @@ // REQUIRES: has-unix-headers // UNSUPPORTED: c++03 -// UNSUPPORTED: !libcpp-has-hardened-mode && !libcpp-has-debug-mode +// UNSUPPORTED: !libcpp-has-hardened-mode && !libcpp-has-debug-mode && !libcpp-has-assertions // XFAIL: availability-verbose_abort-missing #include diff --git a/libcxx/test/libcxx/containers/sequences/vector/assert.cindex.oob.pass.cpp b/libcxx/test/libcxx/containers/sequences/vector/assert.cindex.oob.pass.cpp --- a/libcxx/test/libcxx/containers/sequences/vector/assert.cindex.oob.pass.cpp +++ b/libcxx/test/libcxx/containers/sequences/vector/assert.cindex.oob.pass.cpp @@ -12,7 +12,7 @@ // REQUIRES: has-unix-headers // UNSUPPORTED: c++03 -// UNSUPPORTED: !libcpp-has-hardened-mode && !libcpp-has-debug-mode +// UNSUPPORTED: !libcpp-has-hardened-mode && !libcpp-has-debug-mode && !libcpp-has-assertions // XFAIL: availability-verbose_abort-missing #include diff --git a/libcxx/test/libcxx/containers/sequences/vector/assert.front.empty.pass.cpp b/libcxx/test/libcxx/containers/sequences/vector/assert.front.empty.pass.cpp --- a/libcxx/test/libcxx/containers/sequences/vector/assert.front.empty.pass.cpp +++ b/libcxx/test/libcxx/containers/sequences/vector/assert.front.empty.pass.cpp @@ -12,7 +12,7 @@ // REQUIRES: has-unix-headers // UNSUPPORTED: c++03 -// UNSUPPORTED: !libcpp-has-hardened-mode && !libcpp-has-debug-mode +// UNSUPPORTED: !libcpp-has-hardened-mode && !libcpp-has-debug-mode && !libcpp-has-assertions // XFAIL: availability-verbose_abort-missing #include diff --git a/libcxx/test/libcxx/containers/sequences/vector/assert.index.oob.pass.cpp b/libcxx/test/libcxx/containers/sequences/vector/assert.index.oob.pass.cpp --- a/libcxx/test/libcxx/containers/sequences/vector/assert.index.oob.pass.cpp +++ b/libcxx/test/libcxx/containers/sequences/vector/assert.index.oob.pass.cpp @@ -12,7 +12,7 @@ // REQUIRES: has-unix-headers // UNSUPPORTED: c++03 -// UNSUPPORTED: !libcpp-has-hardened-mode && !libcpp-has-debug-mode +// UNSUPPORTED: !libcpp-has-hardened-mode && !libcpp-has-debug-mode && !libcpp-has-assertions // XFAIL: availability-verbose_abort-missing #include diff --git a/libcxx/test/libcxx/containers/sequences/vector/assert.pop_back.empty.pass.cpp b/libcxx/test/libcxx/containers/sequences/vector/assert.pop_back.empty.pass.cpp --- a/libcxx/test/libcxx/containers/sequences/vector/assert.pop_back.empty.pass.cpp +++ b/libcxx/test/libcxx/containers/sequences/vector/assert.pop_back.empty.pass.cpp @@ -12,7 +12,7 @@ // REQUIRES: has-unix-headers // UNSUPPORTED: c++03 -// UNSUPPORTED: !libcpp-has-hardened-mode && !libcpp-has-debug-mode +// UNSUPPORTED: !libcpp-has-hardened-mode && !libcpp-has-debug-mode && !libcpp-has-assertions // XFAIL: availability-verbose_abort-missing #include diff --git a/libcxx/test/libcxx/containers/unord/unord.map/assert.bucket.pass.cpp b/libcxx/test/libcxx/containers/unord/unord.map/assert.bucket.pass.cpp --- a/libcxx/test/libcxx/containers/unord/unord.map/assert.bucket.pass.cpp +++ b/libcxx/test/libcxx/containers/unord/unord.map/assert.bucket.pass.cpp @@ -12,7 +12,7 @@ // REQUIRES: has-unix-headers // UNSUPPORTED: c++03 -// UNSUPPORTED: !libcpp-has-debug-mode +// UNSUPPORTED: !libcpp-has-debug-mode && !libcpp-has-assertions // XFAIL: availability-verbose_abort-missing #include diff --git a/libcxx/test/libcxx/containers/unord/unord.map/assert.bucket_size.pass.cpp b/libcxx/test/libcxx/containers/unord/unord.map/assert.bucket_size.pass.cpp --- a/libcxx/test/libcxx/containers/unord/unord.map/assert.bucket_size.pass.cpp +++ b/libcxx/test/libcxx/containers/unord/unord.map/assert.bucket_size.pass.cpp @@ -16,7 +16,7 @@ // REQUIRES: has-unix-headers // UNSUPPORTED: c++03 -// UNSUPPORTED: !libcpp-has-debug-mode +// UNSUPPORTED: !libcpp-has-debug-mode && !libcpp-has-assertions // XFAIL: availability-verbose_abort-missing #include diff --git a/libcxx/test/libcxx/containers/unord/unord.map/assert.max_load_factor.pass.cpp b/libcxx/test/libcxx/containers/unord/unord.map/assert.max_load_factor.pass.cpp --- a/libcxx/test/libcxx/containers/unord/unord.map/assert.max_load_factor.pass.cpp +++ b/libcxx/test/libcxx/containers/unord/unord.map/assert.max_load_factor.pass.cpp @@ -17,7 +17,7 @@ // REQUIRES: has-unix-headers // UNSUPPORTED: c++03 -// UNSUPPORTED: !libcpp-has-debug-mode +// UNSUPPORTED: !libcpp-has-debug-mode && !libcpp-has-assertions // XFAIL: availability-verbose_abort-missing #include diff --git a/libcxx/test/libcxx/containers/unord/unord.multimap/assert.bucket.pass.cpp b/libcxx/test/libcxx/containers/unord/unord.multimap/assert.bucket.pass.cpp --- a/libcxx/test/libcxx/containers/unord/unord.multimap/assert.bucket.pass.cpp +++ b/libcxx/test/libcxx/containers/unord/unord.multimap/assert.bucket.pass.cpp @@ -16,7 +16,7 @@ // REQUIRES: has-unix-headers // UNSUPPORTED: c++03 -// UNSUPPORTED: !libcpp-has-debug-mode +// UNSUPPORTED: !libcpp-has-debug-mode && !libcpp-has-assertions // XFAIL: availability-verbose_abort-missing #include diff --git a/libcxx/test/libcxx/containers/unord/unord.multimap/assert.bucket_size.pass.cpp b/libcxx/test/libcxx/containers/unord/unord.multimap/assert.bucket_size.pass.cpp --- a/libcxx/test/libcxx/containers/unord/unord.multimap/assert.bucket_size.pass.cpp +++ b/libcxx/test/libcxx/containers/unord/unord.multimap/assert.bucket_size.pass.cpp @@ -16,7 +16,7 @@ // REQUIRES: has-unix-headers // UNSUPPORTED: c++03 -// UNSUPPORTED: !libcpp-has-debug-mode +// UNSUPPORTED: !libcpp-has-debug-mode && !libcpp-has-assertions // XFAIL: availability-verbose_abort-missing #include diff --git a/libcxx/test/libcxx/containers/unord/unord.multimap/assert.max_load_factor.pass.cpp b/libcxx/test/libcxx/containers/unord/unord.multimap/assert.max_load_factor.pass.cpp --- a/libcxx/test/libcxx/containers/unord/unord.multimap/assert.max_load_factor.pass.cpp +++ b/libcxx/test/libcxx/containers/unord/unord.multimap/assert.max_load_factor.pass.cpp @@ -17,7 +17,7 @@ // REQUIRES: has-unix-headers // UNSUPPORTED: c++03 -// UNSUPPORTED: !libcpp-has-debug-mode +// UNSUPPORTED: !libcpp-has-debug-mode && !libcpp-has-assertions // XFAIL: availability-verbose_abort-missing #include diff --git a/libcxx/test/libcxx/containers/unord/unord.multiset/assert.bucket.pass.cpp b/libcxx/test/libcxx/containers/unord/unord.multiset/assert.bucket.pass.cpp --- a/libcxx/test/libcxx/containers/unord/unord.multiset/assert.bucket.pass.cpp +++ b/libcxx/test/libcxx/containers/unord/unord.multiset/assert.bucket.pass.cpp @@ -16,7 +16,7 @@ // REQUIRES: has-unix-headers // UNSUPPORTED: c++03 -// UNSUPPORTED: !libcpp-has-debug-mode +// UNSUPPORTED: !libcpp-has-debug-mode && !libcpp-has-assertions // XFAIL: availability-verbose_abort-missing #include diff --git a/libcxx/test/libcxx/containers/unord/unord.multiset/assert.bucket_size.pass.cpp b/libcxx/test/libcxx/containers/unord/unord.multiset/assert.bucket_size.pass.cpp --- a/libcxx/test/libcxx/containers/unord/unord.multiset/assert.bucket_size.pass.cpp +++ b/libcxx/test/libcxx/containers/unord/unord.multiset/assert.bucket_size.pass.cpp @@ -16,7 +16,7 @@ // REQUIRES: has-unix-headers // UNSUPPORTED: c++03 -// UNSUPPORTED: !libcpp-has-debug-mode +// UNSUPPORTED: !libcpp-has-debug-mode && !libcpp-has-assertions // XFAIL: availability-verbose_abort-missing #include diff --git a/libcxx/test/libcxx/containers/unord/unord.multiset/assert.max_load_factor.pass.cpp b/libcxx/test/libcxx/containers/unord/unord.multiset/assert.max_load_factor.pass.cpp --- a/libcxx/test/libcxx/containers/unord/unord.multiset/assert.max_load_factor.pass.cpp +++ b/libcxx/test/libcxx/containers/unord/unord.multiset/assert.max_load_factor.pass.cpp @@ -17,7 +17,7 @@ // REQUIRES: has-unix-headers // UNSUPPORTED: c++03 -// UNSUPPORTED: !libcpp-has-debug-mode +// UNSUPPORTED: !libcpp-has-debug-mode && !libcpp-has-assertions // XFAIL: availability-verbose_abort-missing #include diff --git a/libcxx/test/libcxx/containers/unord/unord.set/assert.bucket.pass.cpp b/libcxx/test/libcxx/containers/unord/unord.set/assert.bucket.pass.cpp --- a/libcxx/test/libcxx/containers/unord/unord.set/assert.bucket.pass.cpp +++ b/libcxx/test/libcxx/containers/unord/unord.set/assert.bucket.pass.cpp @@ -16,7 +16,7 @@ // REQUIRES: has-unix-headers // UNSUPPORTED: c++03 -// UNSUPPORTED: !libcpp-has-debug-mode +// UNSUPPORTED: !libcpp-has-debug-mode && !libcpp-has-assertions // XFAIL: availability-verbose_abort-missing #include diff --git a/libcxx/test/libcxx/containers/unord/unord.set/assert.bucket_size.pass.cpp b/libcxx/test/libcxx/containers/unord/unord.set/assert.bucket_size.pass.cpp --- a/libcxx/test/libcxx/containers/unord/unord.set/assert.bucket_size.pass.cpp +++ b/libcxx/test/libcxx/containers/unord/unord.set/assert.bucket_size.pass.cpp @@ -16,7 +16,7 @@ // REQUIRES: has-unix-headers // UNSUPPORTED: c++03 -// UNSUPPORTED: !libcpp-has-debug-mode +// UNSUPPORTED: !libcpp-has-debug-mode && !libcpp-has-assertions // XFAIL: availability-verbose_abort-missing #include diff --git a/libcxx/test/libcxx/containers/unord/unord.set/assert.max_load_factor.pass.cpp b/libcxx/test/libcxx/containers/unord/unord.set/assert.max_load_factor.pass.cpp --- a/libcxx/test/libcxx/containers/unord/unord.set/assert.max_load_factor.pass.cpp +++ b/libcxx/test/libcxx/containers/unord/unord.set/assert.max_load_factor.pass.cpp @@ -17,7 +17,7 @@ // REQUIRES: has-unix-headers // UNSUPPORTED: c++03 -// UNSUPPORTED: !libcpp-has-debug-mode +// UNSUPPORTED: !libcpp-has-debug-mode && !libcpp-has-assertions // XFAIL: availability-verbose_abort-missing #include diff --git a/libcxx/test/libcxx/containers/views/mdspan/extents/assert.conversion.pass.cpp b/libcxx/test/libcxx/containers/views/mdspan/extents/assert.conversion.pass.cpp --- a/libcxx/test/libcxx/containers/views/mdspan/extents/assert.conversion.pass.cpp +++ b/libcxx/test/libcxx/containers/views/mdspan/extents/assert.conversion.pass.cpp @@ -6,7 +6,7 @@ //===----------------------------------------------------------------------===// // REQUIRES: has-unix-headers // UNSUPPORTED: c++03, c++11, c++14, c++17, c++20 -// UNSUPPORTED: !libcpp-has-hardened-mode && !libcpp-has-debug-mode +// UNSUPPORTED: !libcpp-has-hardened-mode && !libcpp-has-debug-mode && !libcpp-has-assertions // XFAIL: availability-verbose_abort-missing // diff --git a/libcxx/test/libcxx/containers/views/mdspan/extents/assert.ctor_from_array.pass.cpp b/libcxx/test/libcxx/containers/views/mdspan/extents/assert.ctor_from_array.pass.cpp --- a/libcxx/test/libcxx/containers/views/mdspan/extents/assert.ctor_from_array.pass.cpp +++ b/libcxx/test/libcxx/containers/views/mdspan/extents/assert.ctor_from_array.pass.cpp @@ -6,7 +6,7 @@ //===----------------------------------------------------------------------===// // REQUIRES: has-unix-headers // UNSUPPORTED: c++03, c++11, c++14, c++17, c++20 -// UNSUPPORTED: !libcpp-has-hardened-mode && !libcpp-has-debug-mode +// UNSUPPORTED: !libcpp-has-hardened-mode && !libcpp-has-debug-mode && !libcpp-has-assertions // XFAIL: availability-verbose_abort-missing // diff --git a/libcxx/test/libcxx/containers/views/mdspan/extents/assert.ctor_from_integral.pass.cpp b/libcxx/test/libcxx/containers/views/mdspan/extents/assert.ctor_from_integral.pass.cpp --- a/libcxx/test/libcxx/containers/views/mdspan/extents/assert.ctor_from_integral.pass.cpp +++ b/libcxx/test/libcxx/containers/views/mdspan/extents/assert.ctor_from_integral.pass.cpp @@ -6,7 +6,7 @@ //===----------------------------------------------------------------------===// // REQUIRES: has-unix-headers // UNSUPPORTED: c++03, c++11, c++14, c++17, c++20 -// UNSUPPORTED: !libcpp-has-hardened-mode && !libcpp-has-debug-mode +// UNSUPPORTED: !libcpp-has-hardened-mode && !libcpp-has-debug-mode && !libcpp-has-assertions // XFAIL: availability-verbose_abort-missing // diff --git a/libcxx/test/libcxx/containers/views/mdspan/extents/assert.ctor_from_span.pass.cpp b/libcxx/test/libcxx/containers/views/mdspan/extents/assert.ctor_from_span.pass.cpp --- a/libcxx/test/libcxx/containers/views/mdspan/extents/assert.ctor_from_span.pass.cpp +++ b/libcxx/test/libcxx/containers/views/mdspan/extents/assert.ctor_from_span.pass.cpp @@ -6,7 +6,7 @@ //===----------------------------------------------------------------------===// // REQUIRES: has-unix-headers // UNSUPPORTED: c++03, c++11, c++14, c++17, c++20 -// UNSUPPORTED: !libcpp-has-hardened-mode && !libcpp-has-debug-mode +// UNSUPPORTED: !libcpp-has-hardened-mode && !libcpp-has-debug-mode && !libcpp-has-assertions // XFAIL: availability-verbose_abort-missing // Test construction from span: diff --git a/libcxx/test/libcxx/containers/views/mdspan/extents/assert.obs.pass.cpp b/libcxx/test/libcxx/containers/views/mdspan/extents/assert.obs.pass.cpp --- a/libcxx/test/libcxx/containers/views/mdspan/extents/assert.obs.pass.cpp +++ b/libcxx/test/libcxx/containers/views/mdspan/extents/assert.obs.pass.cpp @@ -6,7 +6,7 @@ //===----------------------------------------------------------------------===// // REQUIRES: has-unix-headers // UNSUPPORTED: c++03, c++11, c++14, c++17, c++20 -// UNSUPPORTED: !libcpp-has-hardened-mode && !libcpp-has-debug-mode +// UNSUPPORTED: !libcpp-has-hardened-mode && !libcpp-has-debug-mode && !libcpp-has-assertions // XFAIL: availability-verbose_abort-missing // diff --git a/libcxx/test/libcxx/containers/views/mdspan/layout_left/assert.conversion.pass.cpp b/libcxx/test/libcxx/containers/views/mdspan/layout_left/assert.conversion.pass.cpp --- a/libcxx/test/libcxx/containers/views/mdspan/layout_left/assert.conversion.pass.cpp +++ b/libcxx/test/libcxx/containers/views/mdspan/layout_left/assert.conversion.pass.cpp @@ -8,7 +8,7 @@ // REQUIRES: has-unix-headers // UNSUPPORTED: c++03, c++11, c++14, c++17, c++20 -// UNSUPPORTED: !libcpp-has-hardened-mode && !libcpp-has-debug-mode +// UNSUPPORTED: !libcpp-has-hardened-mode && !libcpp-has-debug-mode && !libcpp-has-assertions // XFAIL: availability-verbose_abort-missing // diff --git a/libcxx/test/libcxx/containers/views/mdspan/layout_left/assert.ctor.extents.pass.cpp b/libcxx/test/libcxx/containers/views/mdspan/layout_left/assert.ctor.extents.pass.cpp --- a/libcxx/test/libcxx/containers/views/mdspan/layout_left/assert.ctor.extents.pass.cpp +++ b/libcxx/test/libcxx/containers/views/mdspan/layout_left/assert.ctor.extents.pass.cpp @@ -8,7 +8,7 @@ // REQUIRES: has-unix-headers // UNSUPPORTED: c++03, c++11, c++14, c++17, c++20 -// UNSUPPORTED: !libcpp-has-hardened-mode && !libcpp-has-debug-mode +// UNSUPPORTED: !libcpp-has-hardened-mode && !libcpp-has-debug-mode && !libcpp-has-assertions // XFAIL: availability-verbose_abort-missing // diff --git a/libcxx/test/libcxx/containers/views/mdspan/layout_left/assert.ctor.layout_right.pass.cpp b/libcxx/test/libcxx/containers/views/mdspan/layout_left/assert.ctor.layout_right.pass.cpp --- a/libcxx/test/libcxx/containers/views/mdspan/layout_left/assert.ctor.layout_right.pass.cpp +++ b/libcxx/test/libcxx/containers/views/mdspan/layout_left/assert.ctor.layout_right.pass.cpp @@ -8,7 +8,7 @@ // REQUIRES: has-unix-headers // UNSUPPORTED: c++03, c++11, c++14, c++17, c++20 -// UNSUPPORTED: !libcpp-has-hardened-mode && !libcpp-has-debug-mode +// UNSUPPORTED: !libcpp-has-hardened-mode && !libcpp-has-debug-mode && !libcpp-has-assertions // XFAIL: availability-verbose_abort-missing // diff --git a/libcxx/test/libcxx/containers/views/mdspan/layout_left/assert.index_operator.pass.cpp b/libcxx/test/libcxx/containers/views/mdspan/layout_left/assert.index_operator.pass.cpp --- a/libcxx/test/libcxx/containers/views/mdspan/layout_left/assert.index_operator.pass.cpp +++ b/libcxx/test/libcxx/containers/views/mdspan/layout_left/assert.index_operator.pass.cpp @@ -8,7 +8,7 @@ // REQUIRES: has-unix-headers // UNSUPPORTED: c++03, c++11, c++14, c++17, c++20 -// UNSUPPORTED: !libcpp-has-debug-mode +// UNSUPPORTED: !libcpp-has-debug-mode && !libcpp-has-assertions // XFAIL: availability-verbose_abort-missing // diff --git a/libcxx/test/libcxx/containers/views/mdspan/layout_left/assert.stride.pass.cpp b/libcxx/test/libcxx/containers/views/mdspan/layout_left/assert.stride.pass.cpp --- a/libcxx/test/libcxx/containers/views/mdspan/layout_left/assert.stride.pass.cpp +++ b/libcxx/test/libcxx/containers/views/mdspan/layout_left/assert.stride.pass.cpp @@ -8,7 +8,7 @@ // REQUIRES: has-unix-headers // UNSUPPORTED: c++03, c++11, c++14, c++17, c++20 -// UNSUPPORTED: !libcpp-has-hardened-mode && !libcpp-has-debug-mode +// UNSUPPORTED: !libcpp-has-hardened-mode && !libcpp-has-debug-mode && !libcpp-has-assertions // XFAIL: availability-verbose_abort-missing // diff --git a/libcxx/test/libcxx/containers/views/mdspan/layout_right/assert.conversion.pass.cpp b/libcxx/test/libcxx/containers/views/mdspan/layout_right/assert.conversion.pass.cpp --- a/libcxx/test/libcxx/containers/views/mdspan/layout_right/assert.conversion.pass.cpp +++ b/libcxx/test/libcxx/containers/views/mdspan/layout_right/assert.conversion.pass.cpp @@ -8,7 +8,7 @@ // REQUIRES: has-unix-headers // UNSUPPORTED: c++03, c++11, c++14, c++17, c++20 -// UNSUPPORTED: !libcpp-has-hardened-mode && !libcpp-has-debug-mode +// UNSUPPORTED: !libcpp-has-hardened-mode && !libcpp-has-debug-mode && !libcpp-has-assertions // XFAIL: availability-verbose_abort-missing // diff --git a/libcxx/test/libcxx/containers/views/mdspan/layout_right/assert.ctor.extents.pass.cpp b/libcxx/test/libcxx/containers/views/mdspan/layout_right/assert.ctor.extents.pass.cpp --- a/libcxx/test/libcxx/containers/views/mdspan/layout_right/assert.ctor.extents.pass.cpp +++ b/libcxx/test/libcxx/containers/views/mdspan/layout_right/assert.ctor.extents.pass.cpp @@ -8,7 +8,7 @@ // REQUIRES: has-unix-headers // UNSUPPORTED: c++03, c++11, c++14, c++17, c++20 -// UNSUPPORTED: !libcpp-has-hardened-mode && !libcpp-has-debug-mode +// UNSUPPORTED: !libcpp-has-hardened-mode && !libcpp-has-debug-mode && !libcpp-has-assertions // XFAIL: availability-verbose_abort-missing // diff --git a/libcxx/test/libcxx/containers/views/mdspan/layout_right/assert.ctor.layout_left.pass.cpp b/libcxx/test/libcxx/containers/views/mdspan/layout_right/assert.ctor.layout_left.pass.cpp --- a/libcxx/test/libcxx/containers/views/mdspan/layout_right/assert.ctor.layout_left.pass.cpp +++ b/libcxx/test/libcxx/containers/views/mdspan/layout_right/assert.ctor.layout_left.pass.cpp @@ -8,7 +8,7 @@ // REQUIRES: has-unix-headers // UNSUPPORTED: c++03, c++11, c++14, c++17, c++20 -// UNSUPPORTED: !libcpp-has-hardened-mode && !libcpp-has-debug-mode +// UNSUPPORTED: !libcpp-has-hardened-mode && !libcpp-has-debug-mode && !libcpp-has-assertions // XFAIL: availability-verbose_abort-missing // diff --git a/libcxx/test/libcxx/containers/views/mdspan/layout_right/assert.index_operator.pass.cpp b/libcxx/test/libcxx/containers/views/mdspan/layout_right/assert.index_operator.pass.cpp --- a/libcxx/test/libcxx/containers/views/mdspan/layout_right/assert.index_operator.pass.cpp +++ b/libcxx/test/libcxx/containers/views/mdspan/layout_right/assert.index_operator.pass.cpp @@ -8,7 +8,7 @@ // REQUIRES: has-unix-headers // UNSUPPORTED: c++03, c++11, c++14, c++17, c++20 -// UNSUPPORTED: !libcpp-has-debug-mode +// UNSUPPORTED: !libcpp-has-debug-mode && !libcpp-has-assertions // XFAIL: availability-verbose_abort-missing // diff --git a/libcxx/test/libcxx/containers/views/mdspan/layout_right/assert.stride.pass.cpp b/libcxx/test/libcxx/containers/views/mdspan/layout_right/assert.stride.pass.cpp --- a/libcxx/test/libcxx/containers/views/mdspan/layout_right/assert.stride.pass.cpp +++ b/libcxx/test/libcxx/containers/views/mdspan/layout_right/assert.stride.pass.cpp @@ -8,7 +8,7 @@ // REQUIRES: has-unix-headers // UNSUPPORTED: c++03, c++11, c++14, c++17, c++20 -// UNSUPPORTED: !libcpp-has-hardened-mode && !libcpp-has-debug-mode +// UNSUPPORTED: !libcpp-has-hardened-mode && !libcpp-has-debug-mode && !libcpp-has-assertions // XFAIL: availability-verbose_abort-missing // diff --git a/libcxx/test/libcxx/containers/views/mdspan/mdspan/assert.conversion.pass.cpp b/libcxx/test/libcxx/containers/views/mdspan/mdspan/assert.conversion.pass.cpp --- a/libcxx/test/libcxx/containers/views/mdspan/mdspan/assert.conversion.pass.cpp +++ b/libcxx/test/libcxx/containers/views/mdspan/mdspan/assert.conversion.pass.cpp @@ -6,7 +6,7 @@ //===----------------------------------------------------------------------===// // REQUIRES: has-unix-headers // UNSUPPORTED: c++03, c++11, c++14, c++17, c++20 -// UNSUPPORTED: !libcpp-has-hardened-mode && !libcpp-has-debug-mode +// UNSUPPORTED: !libcpp-has-hardened-mode && !libcpp-has-debug-mode && !libcpp-has-assertions // XFAIL: availability-verbose_abort-missing // diff --git a/libcxx/test/libcxx/containers/views/mdspan/mdspan/assert.index_operator.pass.cpp b/libcxx/test/libcxx/containers/views/mdspan/mdspan/assert.index_operator.pass.cpp --- a/libcxx/test/libcxx/containers/views/mdspan/mdspan/assert.index_operator.pass.cpp +++ b/libcxx/test/libcxx/containers/views/mdspan/mdspan/assert.index_operator.pass.cpp @@ -8,7 +8,7 @@ // REQUIRES: has-unix-headers // UNSUPPORTED: c++03, c++11, c++14, c++17, c++20 -// UNSUPPORTED: !libcpp-has-hardened-mode && !libcpp-has-debug-mode +// UNSUPPORTED: !libcpp-has-hardened-mode && !libcpp-has-debug-mode && !libcpp-has-assertions // XFAIL: availability-verbose_abort-missing // diff --git a/libcxx/test/libcxx/containers/views/mdspan/mdspan/assert.size.pass.cpp b/libcxx/test/libcxx/containers/views/mdspan/mdspan/assert.size.pass.cpp --- a/libcxx/test/libcxx/containers/views/mdspan/mdspan/assert.size.pass.cpp +++ b/libcxx/test/libcxx/containers/views/mdspan/mdspan/assert.size.pass.cpp @@ -6,7 +6,7 @@ //===----------------------------------------------------------------------===// // REQUIRES: has-unix-headers // UNSUPPORTED: c++03, c++11, c++14, c++17, c++20 -// UNSUPPORTED: !libcpp-has-debug-mode +// UNSUPPORTED: !libcpp-has-debug-mode && !libcpp-has-assertions // XFAIL: availability-verbose_abort-missing // diff --git a/libcxx/test/libcxx/containers/views/views.span/span.cons/assert.iter_sent.pass.cpp b/libcxx/test/libcxx/containers/views/views.span/span.cons/assert.iter_sent.pass.cpp --- a/libcxx/test/libcxx/containers/views/views.span/span.cons/assert.iter_sent.pass.cpp +++ b/libcxx/test/libcxx/containers/views/views.span/span.cons/assert.iter_sent.pass.cpp @@ -19,7 +19,7 @@ // Check that we ensure that `[it, sent)` is a valid range. // REQUIRES: has-unix-headers -// UNSUPPORTED: !libcpp-has-hardened-mode && !libcpp-has-debug-mode +// UNSUPPORTED: !libcpp-has-hardened-mode && !libcpp-has-debug-mode && !libcpp-has-assertions // XFAIL: availability-verbose_abort-missing #include diff --git a/libcxx/test/libcxx/containers/views/views.span/span.cons/assert.iter_size.pass.cpp b/libcxx/test/libcxx/containers/views/views.span/span.cons/assert.iter_size.pass.cpp --- a/libcxx/test/libcxx/containers/views/views.span/span.cons/assert.iter_size.pass.cpp +++ b/libcxx/test/libcxx/containers/views/views.span/span.cons/assert.iter_size.pass.cpp @@ -16,7 +16,7 @@ // dynamic_extent version. // REQUIRES: has-unix-headers -// UNSUPPORTED: !libcpp-has-hardened-mode && !libcpp-has-debug-mode +// UNSUPPORTED: !libcpp-has-hardened-mode && !libcpp-has-debug-mode && !libcpp-has-assertions // XFAIL: availability-verbose_abort-missing #include diff --git a/libcxx/test/libcxx/containers/views/views.span/span.cons/assert.other_span.pass.cpp b/libcxx/test/libcxx/containers/views/views.span/span.cons/assert.other_span.pass.cpp --- a/libcxx/test/libcxx/containers/views/views.span/span.cons/assert.other_span.pass.cpp +++ b/libcxx/test/libcxx/containers/views/views.span/span.cons/assert.other_span.pass.cpp @@ -14,7 +14,7 @@ // Check that we ensure `other.size() == Extent`. // REQUIRES: has-unix-headers -// UNSUPPORTED: !libcpp-has-hardened-mode && !libcpp-has-debug-mode +// UNSUPPORTED: !libcpp-has-hardened-mode && !libcpp-has-debug-mode && !libcpp-has-assertions // XFAIL: availability-verbose_abort-missing #include diff --git a/libcxx/test/libcxx/containers/views/views.span/span.cons/assert.range.pass.cpp b/libcxx/test/libcxx/containers/views/views.span/span.cons/assert.range.pass.cpp --- a/libcxx/test/libcxx/containers/views/views.span/span.cons/assert.range.pass.cpp +++ b/libcxx/test/libcxx/containers/views/views.span/span.cons/assert.range.pass.cpp @@ -14,7 +14,7 @@ // Check that we ensure `size(r) == Extent`. // REQUIRES: has-unix-headers -// UNSUPPORTED: !libcpp-has-hardened-mode && !libcpp-has-debug-mode +// UNSUPPORTED: !libcpp-has-hardened-mode && !libcpp-has-debug-mode && !libcpp-has-assertions // XFAIL: availability-verbose_abort-missing #include diff --git a/libcxx/test/libcxx/containers/views/views.span/span.elem/assert.back.pass.cpp b/libcxx/test/libcxx/containers/views/views.span/span.elem/assert.back.pass.cpp --- a/libcxx/test/libcxx/containers/views/views.span/span.elem/assert.back.pass.cpp +++ b/libcxx/test/libcxx/containers/views/views.span/span.elem/assert.back.pass.cpp @@ -14,7 +14,7 @@ // Make sure that accessing a span out-of-bounds triggers an assertion. // REQUIRES: has-unix-headers -// UNSUPPORTED: !libcpp-has-hardened-mode && !libcpp-has-debug-mode +// UNSUPPORTED: !libcpp-has-hardened-mode && !libcpp-has-debug-mode && !libcpp-has-assertions // XFAIL: availability-verbose_abort-missing #include diff --git a/libcxx/test/libcxx/containers/views/views.span/span.elem/assert.front.pass.cpp b/libcxx/test/libcxx/containers/views/views.span/span.elem/assert.front.pass.cpp --- a/libcxx/test/libcxx/containers/views/views.span/span.elem/assert.front.pass.cpp +++ b/libcxx/test/libcxx/containers/views/views.span/span.elem/assert.front.pass.cpp @@ -14,7 +14,7 @@ // Make sure that accessing a span out-of-bounds triggers an assertion. // REQUIRES: has-unix-headers -// UNSUPPORTED: !libcpp-has-hardened-mode && !libcpp-has-debug-mode +// UNSUPPORTED: !libcpp-has-hardened-mode && !libcpp-has-debug-mode && !libcpp-has-assertions // XFAIL: availability-verbose_abort-missing #include diff --git a/libcxx/test/libcxx/containers/views/views.span/span.elem/assert.op_idx.pass.cpp b/libcxx/test/libcxx/containers/views/views.span/span.elem/assert.op_idx.pass.cpp --- a/libcxx/test/libcxx/containers/views/views.span/span.elem/assert.op_idx.pass.cpp +++ b/libcxx/test/libcxx/containers/views/views.span/span.elem/assert.op_idx.pass.cpp @@ -14,7 +14,7 @@ // Make sure that accessing a span out-of-bounds triggers an assertion. // REQUIRES: has-unix-headers -// UNSUPPORTED: !libcpp-has-hardened-mode && !libcpp-has-debug-mode +// UNSUPPORTED: !libcpp-has-hardened-mode && !libcpp-has-debug-mode && !libcpp-has-assertions // XFAIL: availability-verbose_abort-missing #include diff --git a/libcxx/test/libcxx/containers/views/views.span/span.sub/assert.first.pass.cpp b/libcxx/test/libcxx/containers/views/views.span/span.sub/assert.first.pass.cpp --- a/libcxx/test/libcxx/containers/views/views.span/span.sub/assert.first.pass.cpp +++ b/libcxx/test/libcxx/containers/views/views.span/span.sub/assert.first.pass.cpp @@ -14,7 +14,7 @@ // Make sure that creating a sub-span with an incorrect number of elements triggers an assertion. // REQUIRES: has-unix-headers -// UNSUPPORTED: !libcpp-has-hardened-mode && !libcpp-has-debug-mode +// UNSUPPORTED: !libcpp-has-hardened-mode && !libcpp-has-debug-mode && !libcpp-has-assertions // XFAIL: availability-verbose_abort-missing #include diff --git a/libcxx/test/libcxx/containers/views/views.span/span.sub/assert.last.pass.cpp b/libcxx/test/libcxx/containers/views/views.span/span.sub/assert.last.pass.cpp --- a/libcxx/test/libcxx/containers/views/views.span/span.sub/assert.last.pass.cpp +++ b/libcxx/test/libcxx/containers/views/views.span/span.sub/assert.last.pass.cpp @@ -14,7 +14,7 @@ // Make sure that creating a sub-span with an incorrect number of elements triggers an assertion. // REQUIRES: has-unix-headers -// UNSUPPORTED: !libcpp-has-hardened-mode && !libcpp-has-debug-mode +// UNSUPPORTED: !libcpp-has-hardened-mode && !libcpp-has-debug-mode && !libcpp-has-assertions // XFAIL: availability-verbose_abort-missing #include diff --git a/libcxx/test/libcxx/containers/views/views.span/span.sub/assert.subspan.pass.cpp b/libcxx/test/libcxx/containers/views/views.span/span.sub/assert.subspan.pass.cpp --- a/libcxx/test/libcxx/containers/views/views.span/span.sub/assert.subspan.pass.cpp +++ b/libcxx/test/libcxx/containers/views/views.span/span.sub/assert.subspan.pass.cpp @@ -22,7 +22,7 @@ // Make sure that creating a sub-span with an incorrect number of elements triggers an assertion. // REQUIRES: has-unix-headers -// UNSUPPORTED: !libcpp-has-hardened-mode && !libcpp-has-debug-mode +// UNSUPPORTED: !libcpp-has-hardened-mode && !libcpp-has-debug-mode && !libcpp-has-assertions // XFAIL: availability-verbose_abort-missing #include diff --git a/libcxx/test/libcxx/experimental/memory/memory.polymorphic.allocator.class/memory.polymorphic.allocator.mem/assert.deallocate.pass.cpp b/libcxx/test/libcxx/experimental/memory/memory.polymorphic.allocator.class/memory.polymorphic.allocator.mem/assert.deallocate.pass.cpp --- a/libcxx/test/libcxx/experimental/memory/memory.polymorphic.allocator.class/memory.polymorphic.allocator.mem/assert.deallocate.pass.cpp +++ b/libcxx/test/libcxx/experimental/memory/memory.polymorphic.allocator.class/memory.polymorphic.allocator.mem/assert.deallocate.pass.cpp @@ -14,7 +14,7 @@ // REQUIRES: has-unix-headers // UNSUPPORTED: c++03 -// UNSUPPORTED: !libcpp-has-debug-mode +// UNSUPPORTED: !libcpp-has-debug-mode && !libcpp-has-assertions // XFAIL: availability-verbose_abort-missing // ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DISABLE_DEPRECATION_WARNINGS diff --git a/libcxx/test/libcxx/experimental/memory/memory.resource.adaptor/memory.resource.adaptor.mem/assert.deallocate.pass.cpp b/libcxx/test/libcxx/experimental/memory/memory.resource.adaptor/memory.resource.adaptor.mem/assert.deallocate.pass.cpp --- a/libcxx/test/libcxx/experimental/memory/memory.resource.adaptor/memory.resource.adaptor.mem/assert.deallocate.pass.cpp +++ b/libcxx/test/libcxx/experimental/memory/memory.resource.adaptor/memory.resource.adaptor.mem/assert.deallocate.pass.cpp @@ -14,7 +14,7 @@ // REQUIRES: has-unix-headers // UNSUPPORTED: c++03 -// UNSUPPORTED: !libcpp-has-debug-mode +// UNSUPPORTED: !libcpp-has-debug-mode && !libcpp-has-assertions // XFAIL: availability-verbose_abort-missing // ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DISABLE_DEPRECATION_WARNINGS diff --git a/libcxx/test/libcxx/input.output/filesystems/class.path/path.itr/assert.iterator.pass.cpp b/libcxx/test/libcxx/input.output/filesystems/class.path/path.itr/assert.iterator.pass.cpp --- a/libcxx/test/libcxx/input.output/filesystems/class.path/path.itr/assert.iterator.pass.cpp +++ b/libcxx/test/libcxx/input.output/filesystems/class.path/path.itr/assert.iterator.pass.cpp @@ -8,7 +8,7 @@ // REQUIRES: has-unix-headers // UNSUPPORTED: c++03 -// UNSUPPORTED: !libcpp-has-debug-mode +// UNSUPPORTED: !libcpp-has-debug-mode && !libcpp-has-assertions // XFAIL: availability-verbose_abort-missing // diff --git a/libcxx/test/libcxx/iterators/assert.advance.pass.cpp b/libcxx/test/libcxx/iterators/assert.advance.pass.cpp --- a/libcxx/test/libcxx/iterators/assert.advance.pass.cpp +++ b/libcxx/test/libcxx/iterators/assert.advance.pass.cpp @@ -8,7 +8,7 @@ // REQUIRES: has-unix-headers // UNSUPPORTED: c++03 -// UNSUPPORTED: !libcpp-has-debug-mode +// UNSUPPORTED: !libcpp-has-debug-mode && !libcpp-has-assertions // XFAIL: availability-verbose_abort-missing // diff --git a/libcxx/test/libcxx/iterators/assert.next.pass.cpp b/libcxx/test/libcxx/iterators/assert.next.pass.cpp --- a/libcxx/test/libcxx/iterators/assert.next.pass.cpp +++ b/libcxx/test/libcxx/iterators/assert.next.pass.cpp @@ -8,7 +8,7 @@ // REQUIRES: has-unix-headers // UNSUPPORTED: c++03 -// UNSUPPORTED: !libcpp-has-debug-mode +// UNSUPPORTED: !libcpp-has-debug-mode && !libcpp-has-assertions // XFAIL: availability-verbose_abort-missing // diff --git a/libcxx/test/libcxx/iterators/assert.prev.pass.cpp b/libcxx/test/libcxx/iterators/assert.prev.pass.cpp --- a/libcxx/test/libcxx/iterators/assert.prev.pass.cpp +++ b/libcxx/test/libcxx/iterators/assert.prev.pass.cpp @@ -8,7 +8,7 @@ // REQUIRES: has-unix-headers // UNSUPPORTED: c++03 -// UNSUPPORTED: !libcpp-has-debug-mode +// UNSUPPORTED: !libcpp-has-debug-mode && !libcpp-has-assertions // XFAIL: availability-verbose_abort-missing // diff --git a/libcxx/test/libcxx/iterators/bounded_iter/dereference.pass.cpp b/libcxx/test/libcxx/iterators/bounded_iter/dereference.pass.cpp --- a/libcxx/test/libcxx/iterators/bounded_iter/dereference.pass.cpp +++ b/libcxx/test/libcxx/iterators/bounded_iter/dereference.pass.cpp @@ -13,7 +13,7 @@ // REQUIRES: has-unix-headers // UNSUPPORTED: c++03 -// UNSUPPORTED: !libcpp-has-hardened-mode && !libcpp-has-debug-mode +// UNSUPPORTED: !libcpp-has-hardened-mode && !libcpp-has-debug-mode && !libcpp-has-assertions // XFAIL: availability-verbose_abort-missing #include diff --git a/libcxx/test/libcxx/ranges/range.adaptors/range.drop.while/assert.begin.pass.cpp b/libcxx/test/libcxx/ranges/range.adaptors/range.drop.while/assert.begin.pass.cpp --- a/libcxx/test/libcxx/ranges/range.adaptors/range.drop.while/assert.begin.pass.cpp +++ b/libcxx/test/libcxx/ranges/range.adaptors/range.drop.while/assert.begin.pass.cpp @@ -13,7 +13,7 @@ // REQUIRES: has-unix-headers // UNSUPPORTED: c++03, c++11, c++14, c++17 // UNSUPPORTED: no-exceptions -// UNSUPPORTED: !libcpp-has-debug-mode +// UNSUPPORTED: !libcpp-has-debug-mode && !libcpp-has-assertions // XFAIL: availability-verbose_abort-missing #include diff --git a/libcxx/test/libcxx/ranges/range.adaptors/range.lazy.split/range.lazy.split.inner/assert.equal.pass.cpp b/libcxx/test/libcxx/ranges/range.adaptors/range.lazy.split/range.lazy.split.inner/assert.equal.pass.cpp --- a/libcxx/test/libcxx/ranges/range.adaptors/range.lazy.split/range.lazy.split.inner/assert.equal.pass.cpp +++ b/libcxx/test/libcxx/ranges/range.adaptors/range.lazy.split/range.lazy.split.inner/assert.equal.pass.cpp @@ -8,7 +8,7 @@ // REQUIRES: has-unix-headers // UNSUPPORTED: c++03, c++11, c++14, c++17 -// UNSUPPORTED: !libcpp-has-debug-mode +// UNSUPPORTED: !libcpp-has-debug-mode && !libcpp-has-assertions // XFAIL: availability-verbose_abort-missing // diff --git a/libcxx/test/libcxx/ranges/range.adaptors/range.lazy.split/range.lazy.split.outer/assert.equal.pass.cpp b/libcxx/test/libcxx/ranges/range.adaptors/range.lazy.split/range.lazy.split.outer/assert.equal.pass.cpp --- a/libcxx/test/libcxx/ranges/range.adaptors/range.lazy.split/range.lazy.split.outer/assert.equal.pass.cpp +++ b/libcxx/test/libcxx/ranges/range.adaptors/range.lazy.split/range.lazy.split.outer/assert.equal.pass.cpp @@ -8,7 +8,7 @@ // REQUIRES: has-unix-headers // UNSUPPORTED: c++03, c++11, c++14, c++17 -// UNSUPPORTED: !libcpp-has-debug-mode +// UNSUPPORTED: !libcpp-has-debug-mode && !libcpp-has-assertions // XFAIL: availability-verbose_abort-missing // diff --git a/libcxx/test/libcxx/ranges/range.factories/range.repeat.view/ctor.piecewise.pass.cpp b/libcxx/test/libcxx/ranges/range.factories/range.repeat.view/ctor.piecewise.pass.cpp --- a/libcxx/test/libcxx/ranges/range.factories/range.repeat.view/ctor.piecewise.pass.cpp +++ b/libcxx/test/libcxx/ranges/range.factories/range.repeat.view/ctor.piecewise.pass.cpp @@ -7,7 +7,7 @@ //===----------------------------------------------------------------------===// // UNSUPPORTED: c++03, c++11, c++14, c++17, c++20 -// UNSUPPORTED: !libcpp-has-debug-mode +// UNSUPPORTED: !libcpp-has-debug-mode && !libcpp-has-assertions // REQUIRES: has-unix-headers // XFAIL: availability-verbose_abort-missing diff --git a/libcxx/test/libcxx/ranges/range.factories/range.repeat.view/ctor.value.bound.pass.cpp b/libcxx/test/libcxx/ranges/range.factories/range.repeat.view/ctor.value.bound.pass.cpp --- a/libcxx/test/libcxx/ranges/range.factories/range.repeat.view/ctor.value.bound.pass.cpp +++ b/libcxx/test/libcxx/ranges/range.factories/range.repeat.view/ctor.value.bound.pass.cpp @@ -7,7 +7,7 @@ //===----------------------------------------------------------------------===// // UNSUPPORTED: c++03, c++11, c++14, c++17, c++20 -// UNSUPPORTED: !libcpp-has-debug-mode +// UNSUPPORTED: !libcpp-has-debug-mode && !libcpp-has-assertions // REQUIRES: has-unix-headers // XFAIL: availability-verbose_abort-missing diff --git a/libcxx/test/libcxx/strings/basic.string/string.access/assert.back.pass.cpp b/libcxx/test/libcxx/strings/basic.string/string.access/assert.back.pass.cpp --- a/libcxx/test/libcxx/strings/basic.string/string.access/assert.back.pass.cpp +++ b/libcxx/test/libcxx/strings/basic.string/string.access/assert.back.pass.cpp @@ -12,7 +12,7 @@ // REQUIRES: has-unix-headers // UNSUPPORTED: c++03 -// UNSUPPORTED: !libcpp-has-hardened-mode && !libcpp-has-debug-mode +// UNSUPPORTED: !libcpp-has-hardened-mode && !libcpp-has-debug-mode && !libcpp-has-assertions // XFAIL: availability-verbose_abort-missing #include diff --git a/libcxx/test/libcxx/strings/basic.string/string.access/assert.cback.pass.cpp b/libcxx/test/libcxx/strings/basic.string/string.access/assert.cback.pass.cpp --- a/libcxx/test/libcxx/strings/basic.string/string.access/assert.cback.pass.cpp +++ b/libcxx/test/libcxx/strings/basic.string/string.access/assert.cback.pass.cpp @@ -12,7 +12,7 @@ // REQUIRES: has-unix-headers // UNSUPPORTED: c++03 -// UNSUPPORTED: !libcpp-has-hardened-mode && !libcpp-has-debug-mode +// UNSUPPORTED: !libcpp-has-hardened-mode && !libcpp-has-debug-mode && !libcpp-has-assertions // XFAIL: availability-verbose_abort-missing #include diff --git a/libcxx/test/libcxx/strings/basic.string/string.access/assert.cfront.pass.cpp b/libcxx/test/libcxx/strings/basic.string/string.access/assert.cfront.pass.cpp --- a/libcxx/test/libcxx/strings/basic.string/string.access/assert.cfront.pass.cpp +++ b/libcxx/test/libcxx/strings/basic.string/string.access/assert.cfront.pass.cpp @@ -12,7 +12,7 @@ // REQUIRES: has-unix-headers // UNSUPPORTED: c++03 -// UNSUPPORTED: !libcpp-has-hardened-mode && !libcpp-has-debug-mode +// UNSUPPORTED: !libcpp-has-hardened-mode && !libcpp-has-debug-mode && !libcpp-has-assertions // XFAIL: availability-verbose_abort-missing #include diff --git a/libcxx/test/libcxx/strings/basic.string/string.access/assert.cindex.pass.cpp b/libcxx/test/libcxx/strings/basic.string/string.access/assert.cindex.pass.cpp --- a/libcxx/test/libcxx/strings/basic.string/string.access/assert.cindex.pass.cpp +++ b/libcxx/test/libcxx/strings/basic.string/string.access/assert.cindex.pass.cpp @@ -12,7 +12,7 @@ // REQUIRES: has-unix-headers // UNSUPPORTED: c++03 -// UNSUPPORTED: !libcpp-has-hardened-mode && !libcpp-has-debug-mode +// UNSUPPORTED: !libcpp-has-hardened-mode && !libcpp-has-debug-mode && !libcpp-has-assertions // XFAIL: availability-verbose_abort-missing #include diff --git a/libcxx/test/libcxx/strings/basic.string/string.access/assert.front.pass.cpp b/libcxx/test/libcxx/strings/basic.string/string.access/assert.front.pass.cpp --- a/libcxx/test/libcxx/strings/basic.string/string.access/assert.front.pass.cpp +++ b/libcxx/test/libcxx/strings/basic.string/string.access/assert.front.pass.cpp @@ -12,7 +12,7 @@ // REQUIRES: has-unix-headers // UNSUPPORTED: c++03 -// UNSUPPORTED: !libcpp-has-hardened-mode && !libcpp-has-debug-mode +// UNSUPPORTED: !libcpp-has-hardened-mode && !libcpp-has-debug-mode && !libcpp-has-assertions // XFAIL: availability-verbose_abort-missing #include diff --git a/libcxx/test/libcxx/strings/basic.string/string.access/assert.index.pass.cpp b/libcxx/test/libcxx/strings/basic.string/string.access/assert.index.pass.cpp --- a/libcxx/test/libcxx/strings/basic.string/string.access/assert.index.pass.cpp +++ b/libcxx/test/libcxx/strings/basic.string/string.access/assert.index.pass.cpp @@ -12,7 +12,7 @@ // REQUIRES: has-unix-headers // UNSUPPORTED: c++03 -// UNSUPPORTED: !libcpp-has-hardened-mode && !libcpp-has-debug-mode +// UNSUPPORTED: !libcpp-has-hardened-mode && !libcpp-has-debug-mode && !libcpp-has-assertions // XFAIL: availability-verbose_abort-missing #include diff --git a/libcxx/test/libcxx/strings/basic.string/string.modifiers/assert.erase_iter.null.pass.cpp b/libcxx/test/libcxx/strings/basic.string/string.modifiers/assert.erase_iter.null.pass.cpp --- a/libcxx/test/libcxx/strings/basic.string/string.modifiers/assert.erase_iter.null.pass.cpp +++ b/libcxx/test/libcxx/strings/basic.string/string.modifiers/assert.erase_iter.null.pass.cpp @@ -12,7 +12,7 @@ // REQUIRES: has-unix-headers // UNSUPPORTED: c++03 -// UNSUPPORTED: !libcpp-has-hardened-mode && !libcpp-has-debug-mode +// UNSUPPORTED: !libcpp-has-hardened-mode && !libcpp-has-debug-mode && !libcpp-has-assertions // XFAIL: availability-verbose_abort-missing #include diff --git a/libcxx/test/libcxx/strings/basic.string/string.modifiers/assert.pop_back.pass.cpp b/libcxx/test/libcxx/strings/basic.string/string.modifiers/assert.pop_back.pass.cpp --- a/libcxx/test/libcxx/strings/basic.string/string.modifiers/assert.pop_back.pass.cpp +++ b/libcxx/test/libcxx/strings/basic.string/string.modifiers/assert.pop_back.pass.cpp @@ -12,7 +12,7 @@ // REQUIRES: has-unix-headers // UNSUPPORTED: c++03 -// UNSUPPORTED: !libcpp-has-hardened-mode && !libcpp-has-debug-mode +// UNSUPPORTED: !libcpp-has-hardened-mode && !libcpp-has-debug-mode && !libcpp-has-assertions // XFAIL: availability-verbose_abort-missing #include diff --git a/libcxx/test/libcxx/strings/string.view/assert.ctor.length.pass.cpp b/libcxx/test/libcxx/strings/string.view/assert.ctor.length.pass.cpp --- a/libcxx/test/libcxx/strings/string.view/assert.ctor.length.pass.cpp +++ b/libcxx/test/libcxx/strings/string.view/assert.ctor.length.pass.cpp @@ -9,7 +9,7 @@ // REQUIRES: has-unix-headers // UNSUPPORTED: c++03, c++11 -// UNSUPPORTED: !libcpp-has-debug-mode +// UNSUPPORTED: !libcpp-has-debug-mode && !libcpp-has-assertions // XFAIL: availability-verbose_abort-missing // Construct a string_view from an invalid length diff --git a/libcxx/test/libcxx/strings/string.view/assert.ctor.pointer.pass.cpp b/libcxx/test/libcxx/strings/string.view/assert.ctor.pointer.pass.cpp --- a/libcxx/test/libcxx/strings/string.view/assert.ctor.pointer.pass.cpp +++ b/libcxx/test/libcxx/strings/string.view/assert.ctor.pointer.pass.cpp @@ -8,7 +8,7 @@ // REQUIRES: has-unix-headers // UNSUPPORTED: c++03, c++11, c++14 -// UNSUPPORTED: !libcpp-has-debug-mode +// UNSUPPORTED: !libcpp-has-debug-mode && !libcpp-has-assertions // XFAIL: availability-verbose_abort-missing // Construct a string_view from a null pointer diff --git a/libcxx/test/libcxx/thread/futures/futures.promise/assert.set_exception.pass.cpp b/libcxx/test/libcxx/thread/futures/futures.promise/assert.set_exception.pass.cpp --- a/libcxx/test/libcxx/thread/futures/futures.promise/assert.set_exception.pass.cpp +++ b/libcxx/test/libcxx/thread/futures/futures.promise/assert.set_exception.pass.cpp @@ -8,7 +8,7 @@ // REQUIRES: has-unix-headers // UNSUPPORTED: c++03, no-threads -// UNSUPPORTED: !libcpp-has-debug-mode +// UNSUPPORTED: !libcpp-has-debug-mode && !libcpp-has-assertions // XFAIL: availability-verbose_abort-missing // diff --git a/libcxx/test/libcxx/thread/futures/futures.promise/assert.set_exception_at_thread_exit.pass.cpp b/libcxx/test/libcxx/thread/futures/futures.promise/assert.set_exception_at_thread_exit.pass.cpp --- a/libcxx/test/libcxx/thread/futures/futures.promise/assert.set_exception_at_thread_exit.pass.cpp +++ b/libcxx/test/libcxx/thread/futures/futures.promise/assert.set_exception_at_thread_exit.pass.cpp @@ -8,7 +8,7 @@ // REQUIRES: has-unix-headers // UNSUPPORTED: c++03, no-threads -// UNSUPPORTED: !libcpp-has-debug-mode +// UNSUPPORTED: !libcpp-has-debug-mode && !libcpp-has-assertions // XFAIL: availability-verbose_abort-missing // diff --git a/libcxx/test/libcxx/thread/thread.barrier/assert.arrive.pass.cpp b/libcxx/test/libcxx/thread/thread.barrier/assert.arrive.pass.cpp --- a/libcxx/test/libcxx/thread/thread.barrier/assert.arrive.pass.cpp +++ b/libcxx/test/libcxx/thread/thread.barrier/assert.arrive.pass.cpp @@ -7,7 +7,7 @@ //===----------------------------------------------------------------------===// // UNSUPPORTED: no-threads // UNSUPPORTED: c++03, c++11, c++14, c++17 -// UNSUPPORTED: !libcpp-has-debug-mode +// UNSUPPORTED: !libcpp-has-debug-mode && !libcpp-has-assertions // XFAIL: availability-verbose_abort-missing diff --git a/libcxx/test/libcxx/thread/thread.barrier/assert.ctor.pass.cpp b/libcxx/test/libcxx/thread/thread.barrier/assert.ctor.pass.cpp --- a/libcxx/test/libcxx/thread/thread.barrier/assert.ctor.pass.cpp +++ b/libcxx/test/libcxx/thread/thread.barrier/assert.ctor.pass.cpp @@ -7,7 +7,7 @@ //===----------------------------------------------------------------------===// // UNSUPPORTED: no-threads // UNSUPPORTED: c++03, c++11, c++14, c++17 -// UNSUPPORTED: !libcpp-has-debug-mode +// UNSUPPORTED: !libcpp-has-debug-mode && !libcpp-has-assertions // XFAIL: availability-verbose_abort-missing diff --git a/libcxx/test/libcxx/thread/thread.latch/assert.arrive_and_wait.pass.cpp b/libcxx/test/libcxx/thread/thread.latch/assert.arrive_and_wait.pass.cpp --- a/libcxx/test/libcxx/thread/thread.latch/assert.arrive_and_wait.pass.cpp +++ b/libcxx/test/libcxx/thread/thread.latch/assert.arrive_and_wait.pass.cpp @@ -17,7 +17,7 @@ // Make sure that calling arrive_and_wait with a negative value triggers an assertion. // REQUIRES: has-unix-headers -// UNSUPPORTED: !libcpp-has-debug-mode +// UNSUPPORTED: !libcpp-has-debug-mode && !libcpp-has-assertions // XFAIL: availability-verbose_abort-missing #include diff --git a/libcxx/test/libcxx/thread/thread.latch/assert.count_down.pass.cpp b/libcxx/test/libcxx/thread/thread.latch/assert.count_down.pass.cpp --- a/libcxx/test/libcxx/thread/thread.latch/assert.count_down.pass.cpp +++ b/libcxx/test/libcxx/thread/thread.latch/assert.count_down.pass.cpp @@ -18,7 +18,7 @@ // higher than the internal counter triggers an assertion. // REQUIRES: has-unix-headers -// UNSUPPORTED: !libcpp-has-debug-mode +// UNSUPPORTED: !libcpp-has-debug-mode && !libcpp-has-assertions // XFAIL: availability-verbose_abort-missing #include diff --git a/libcxx/test/libcxx/thread/thread.latch/assert.ctor.pass.cpp b/libcxx/test/libcxx/thread/thread.latch/assert.ctor.pass.cpp --- a/libcxx/test/libcxx/thread/thread.latch/assert.ctor.pass.cpp +++ b/libcxx/test/libcxx/thread/thread.latch/assert.ctor.pass.cpp @@ -17,7 +17,7 @@ // Make sure that calling latch with a negative value triggers an assertion // REQUIRES: has-unix-headers -// UNSUPPORTED: !libcpp-has-debug-mode +// UNSUPPORTED: !libcpp-has-debug-mode && !libcpp-has-assertions // XFAIL: availability-verbose_abort-missing #include diff --git a/libcxx/test/libcxx/thread/thread.semaphore/assert.ctor.pass.cpp b/libcxx/test/libcxx/thread/thread.semaphore/assert.ctor.pass.cpp --- a/libcxx/test/libcxx/thread/thread.semaphore/assert.ctor.pass.cpp +++ b/libcxx/test/libcxx/thread/thread.semaphore/assert.ctor.pass.cpp @@ -7,7 +7,7 @@ //===----------------------------------------------------------------------===// // UNSUPPORTED: no-threads // UNSUPPORTED: c++03, c++11, c++14, c++17 -// UNSUPPORTED: !libcpp-has-debug-mode +// UNSUPPORTED: !libcpp-has-debug-mode && !libcpp-has-assertions // XFAIL: availability-verbose_abort-missing diff --git a/libcxx/test/libcxx/thread/thread.semaphore/assert.release.pass.cpp b/libcxx/test/libcxx/thread/thread.semaphore/assert.release.pass.cpp --- a/libcxx/test/libcxx/thread/thread.semaphore/assert.release.pass.cpp +++ b/libcxx/test/libcxx/thread/thread.semaphore/assert.release.pass.cpp @@ -7,7 +7,7 @@ //===----------------------------------------------------------------------===// // UNSUPPORTED: no-threads // UNSUPPORTED: c++03, c++11, c++14, c++17 -// UNSUPPORTED: !libcpp-has-debug-mode +// UNSUPPORTED: !libcpp-has-debug-mode && !libcpp-has-assertions // XFAIL: availability-verbose_abort-missing diff --git a/libcxx/test/libcxx/utilities/assert.exception_guard.no_exceptions.pass.cpp b/libcxx/test/libcxx/utilities/assert.exception_guard.no_exceptions.pass.cpp --- a/libcxx/test/libcxx/utilities/assert.exception_guard.no_exceptions.pass.cpp +++ b/libcxx/test/libcxx/utilities/assert.exception_guard.no_exceptions.pass.cpp @@ -8,7 +8,7 @@ // REQUIRES: has-unix-headers // UNSUPPORTED: c++03 -// UNSUPPORTED: !libcpp-has-debug-mode +// UNSUPPORTED: !libcpp-has-debug-mode && !libcpp-has-assertions // XFAIL: availability-verbose_abort-missing // ADDITIONAL_COMPILE_FLAGS: -fno-exceptions diff --git a/libcxx/test/libcxx/utilities/expected/expected.expected/assert.arrow.pass.cpp b/libcxx/test/libcxx/utilities/expected/expected.expected/assert.arrow.pass.cpp --- a/libcxx/test/libcxx/utilities/expected/expected.expected/assert.arrow.pass.cpp +++ b/libcxx/test/libcxx/utilities/expected/expected.expected/assert.arrow.pass.cpp @@ -8,7 +8,7 @@ // REQUIRES: has-unix-headers // UNSUPPORTED: c++03, c++11, c++14, c++17, c++20 -// UNSUPPORTED: !libcpp-has-hardened-mode && !libcpp-has-debug-mode +// UNSUPPORTED: !libcpp-has-hardened-mode && !libcpp-has-debug-mode && !libcpp-has-assertions // XFAIL: availability-verbose_abort-missing // constexpr const T* operator->() const noexcept; diff --git a/libcxx/test/libcxx/utilities/expected/expected.expected/assert.deref.pass.cpp b/libcxx/test/libcxx/utilities/expected/expected.expected/assert.deref.pass.cpp --- a/libcxx/test/libcxx/utilities/expected/expected.expected/assert.deref.pass.cpp +++ b/libcxx/test/libcxx/utilities/expected/expected.expected/assert.deref.pass.cpp @@ -8,7 +8,7 @@ // REQUIRES: has-unix-headers // UNSUPPORTED: c++03, c++11, c++14, c++17, c++20 -// UNSUPPORTED: !libcpp-has-hardened-mode && !libcpp-has-debug-mode +// UNSUPPORTED: !libcpp-has-hardened-mode && !libcpp-has-debug-mode && !libcpp-has-assertions // XFAIL: availability-verbose_abort-missing // constexpr const T& operator*() const & noexcept; diff --git a/libcxx/test/libcxx/utilities/expected/expected.expected/assert.error.pass.cpp b/libcxx/test/libcxx/utilities/expected/expected.expected/assert.error.pass.cpp --- a/libcxx/test/libcxx/utilities/expected/expected.expected/assert.error.pass.cpp +++ b/libcxx/test/libcxx/utilities/expected/expected.expected/assert.error.pass.cpp @@ -8,7 +8,7 @@ // REQUIRES: has-unix-headers // UNSUPPORTED: c++03, c++11, c++14, c++17, c++20 -// UNSUPPORTED: !libcpp-has-hardened-mode && !libcpp-has-debug-mode +// UNSUPPORTED: !libcpp-has-hardened-mode && !libcpp-has-debug-mode && !libcpp-has-assertions // XFAIL: availability-verbose_abort-missing // constexpr const E& error() const & noexcept; diff --git a/libcxx/test/libcxx/utilities/expected/expected.void/assert.deref.pass.cpp b/libcxx/test/libcxx/utilities/expected/expected.void/assert.deref.pass.cpp --- a/libcxx/test/libcxx/utilities/expected/expected.void/assert.deref.pass.cpp +++ b/libcxx/test/libcxx/utilities/expected/expected.void/assert.deref.pass.cpp @@ -8,7 +8,7 @@ // REQUIRES: has-unix-headers // UNSUPPORTED: c++03, c++11, c++14, c++17, c++20 -// UNSUPPORTED: !libcpp-has-hardened-mode && !libcpp-has-debug-mode +// UNSUPPORTED: !libcpp-has-hardened-mode && !libcpp-has-debug-mode && !libcpp-has-assertions // XFAIL: availability-verbose_abort-missing // constexpr void operator*() const noexcept; diff --git a/libcxx/test/libcxx/utilities/expected/expected.void/assert.error.pass.cpp b/libcxx/test/libcxx/utilities/expected/expected.void/assert.error.pass.cpp --- a/libcxx/test/libcxx/utilities/expected/expected.void/assert.error.pass.cpp +++ b/libcxx/test/libcxx/utilities/expected/expected.void/assert.error.pass.cpp @@ -8,7 +8,7 @@ // REQUIRES: has-unix-headers // UNSUPPORTED: c++03, c++11, c++14, c++17, c++20 -// UNSUPPORTED: !libcpp-has-hardened-mode && !libcpp-has-debug-mode +// UNSUPPORTED: !libcpp-has-hardened-mode && !libcpp-has-debug-mode && !libcpp-has-assertions // XFAIL: availability-verbose_abort-missing // constexpr const E& error() const & noexcept; diff --git a/libcxx/test/libcxx/utilities/optional/optional.object/optional.object.observe/assert.dereference.pass.cpp b/libcxx/test/libcxx/utilities/optional/optional.object/optional.object.observe/assert.dereference.pass.cpp --- a/libcxx/test/libcxx/utilities/optional/optional.object/optional.object.observe/assert.dereference.pass.cpp +++ b/libcxx/test/libcxx/utilities/optional/optional.object/optional.object.observe/assert.dereference.pass.cpp @@ -15,7 +15,7 @@ // REQUIRES: has-unix-headers // UNSUPPORTED: c++03, c++11, c++14 -// UNSUPPORTED: !libcpp-has-hardened-mode && !libcpp-has-debug-mode +// UNSUPPORTED: !libcpp-has-hardened-mode && !libcpp-has-debug-mode && !libcpp-has-assertions // XFAIL: availability-verbose_abort-missing #include diff --git a/libcxx/test/libcxx/utilities/optional/optional.object/optional.object.observe/assert.op_arrow.pass.cpp b/libcxx/test/libcxx/utilities/optional/optional.object/optional.object.observe/assert.op_arrow.pass.cpp --- a/libcxx/test/libcxx/utilities/optional/optional.object/optional.object.observe/assert.op_arrow.pass.cpp +++ b/libcxx/test/libcxx/utilities/optional/optional.object/optional.object.observe/assert.op_arrow.pass.cpp @@ -13,7 +13,7 @@ // REQUIRES: has-unix-headers // UNSUPPORTED: c++03, c++11, c++14 -// UNSUPPORTED: !libcpp-has-hardened-mode && !libcpp-has-debug-mode +// UNSUPPORTED: !libcpp-has-hardened-mode && !libcpp-has-debug-mode && !libcpp-has-assertions // XFAIL: availability-verbose_abort-missing #include diff --git a/libcxx/test/std/algorithms/alg.sorting/alg.heap.operations/pop.heap/assert.pop_heap.pass.cpp b/libcxx/test/std/algorithms/alg.sorting/alg.heap.operations/pop.heap/assert.pop_heap.pass.cpp --- a/libcxx/test/std/algorithms/alg.sorting/alg.heap.operations/pop.heap/assert.pop_heap.pass.cpp +++ b/libcxx/test/std/algorithms/alg.sorting/alg.heap.operations/pop.heap/assert.pop_heap.pass.cpp @@ -8,7 +8,7 @@ // REQUIRES: has-unix-headers // UNSUPPORTED: c++03 -// UNSUPPORTED: !libcpp-has-debug-mode +// UNSUPPORTED: !libcpp-has-debug-mode && !libcpp-has-assertions // XFAIL: availability-verbose_abort-missing // diff --git a/libcxx/test/std/algorithms/alg.sorting/alg.heap.operations/pop.heap/assert.ranges_pop_heap.pass.cpp b/libcxx/test/std/algorithms/alg.sorting/alg.heap.operations/pop.heap/assert.ranges_pop_heap.pass.cpp --- a/libcxx/test/std/algorithms/alg.sorting/alg.heap.operations/pop.heap/assert.ranges_pop_heap.pass.cpp +++ b/libcxx/test/std/algorithms/alg.sorting/alg.heap.operations/pop.heap/assert.ranges_pop_heap.pass.cpp @@ -8,7 +8,7 @@ // REQUIRES: has-unix-headers // UNSUPPORTED: c++03, c++11, c++14, c++17 -// UNSUPPORTED: !libcpp-has-debug-mode +// UNSUPPORTED: !libcpp-has-debug-mode && !libcpp-has-assertions // XFAIL: availability-verbose_abort-missing // diff --git a/libcxx/test/std/algorithms/alg.sorting/alg.clamp/assert.ranges_clamp.pass.cpp b/libcxx/test/std/algorithms/alg.sorting/alg.clamp/assert.ranges_clamp.pass.cpp --- a/libcxx/test/std/algorithms/alg.sorting/alg.clamp/assert.ranges_clamp.pass.cpp +++ b/libcxx/test/std/algorithms/alg.sorting/alg.clamp/assert.ranges_clamp.pass.cpp @@ -8,7 +8,7 @@ // REQUIRES: has-unix-headers // UNSUPPORTED: c++03, c++11, c++14, c++17 -// UNSUPPORTED: !libcpp-has-debug-mode +// UNSUPPORTED: !libcpp-has-debug-mode && !libcpp-has-assertions // XFAIL: availability-verbose_abort-missing // diff --git a/libcxx/test/std/utilities/utility/utility.unreachable/assert.unreachable.pass.cpp b/libcxx/test/std/utilities/utility/utility.unreachable/assert.unreachable.pass.cpp --- a/libcxx/test/std/utilities/utility/utility.unreachable/assert.unreachable.pass.cpp +++ b/libcxx/test/std/utilities/utility/utility.unreachable/assert.unreachable.pass.cpp @@ -8,7 +8,7 @@ // REQUIRES: has-unix-headers // UNSUPPORTED: c++03, c++11, c++14, c++17, c++20 -// UNSUPPORTED: !libcpp-has-debug-mode +// UNSUPPORTED: !libcpp-has-debug-mode && !libcpp-has-assertions // XFAIL: availability-verbose_abort-missing // Make sure that reaching std::unreachable() with assertions enabled triggers an assertion. diff --git a/libcxx/test/support/test.support/test_check_assertion.pass.cpp b/libcxx/test/support/test.support/test_check_assertion.pass.cpp --- a/libcxx/test/support/test.support/test_check_assertion.pass.cpp +++ b/libcxx/test/support/test.support/test_check_assertion.pass.cpp @@ -8,7 +8,7 @@ // REQUIRES: has-unix-headers // UNSUPPORTED: c++03 -// UNSUPPORTED: !libcpp-has-hardened-mode && !libcpp-has-debug-mode +// UNSUPPORTED: !libcpp-has-hardened-mode && !libcpp-has-debug-mode && !libcpp-has-assertions // XFAIL: availability-verbose_abort-missing #include diff --git a/libcxx/utils/ci/buildkite-pipeline.yml b/libcxx/utils/ci/buildkite-pipeline.yml --- a/libcxx/utils/ci/buildkite-pipeline.yml +++ b/libcxx/utils/ci/buildkite-pipeline.yml @@ -468,6 +468,24 @@ limit: 2 timeout_in_minutes: 120 + - label: "Assertions enabled" + command: "libcxx/utils/ci/run-buildbot generic-assertions" + artifact_paths: + - "**/test-results.xml" + - "**/*.abilist" + env: + CC: "clang-${LLVM_HEAD_VERSION}" + CXX: "clang++-${LLVM_HEAD_VERSION}" + ENABLE_CLANG_TIDY: "On" + agents: + queue: "libcxx-builders" + os: "linux" + retry: + automatic: + - exit_status: -1 # Agent was lost + limit: 2 + timeout_in_minutes: 120 + - label: "Hardened mode" command: "libcxx/utils/ci/run-buildbot generic-hardened-mode" artifact_paths: @@ -912,6 +930,21 @@ # limit: 2 # timeout_in_minutes: 120 + - label: "Apple back-deployment with assertions enabled" + command: "libcxx/utils/ci/run-buildbot apple-system-backdeployment-assertions-11.0" + artifact_paths: + - "**/test-results.xml" + - "**/*.abilist" + agents: + queue: "libcxx-builders" + os: "macos" + arch: "x86_64" # TODO: Remove this once we are able to run back-deployment on arm64 again, since this isn't x86_64 specific + retry: + automatic: + - exit_status: -1 # Agent was lost + limit: 2 + timeout_in_minutes: 120 + - label: "Apple back-deployment with hardening enabled" command: "libcxx/utils/ci/run-buildbot apple-system-backdeployment-hardened-11.0" artifact_paths: diff --git a/libcxx/utils/ci/run-buildbot b/libcxx/utils/ci/run-buildbot --- a/libcxx/utils/ci/run-buildbot +++ b/libcxx/utils/ci/run-buildbot @@ -382,6 +382,12 @@ -DLIBUNWIND_TEST_CONFIG="llvm-libunwind-merged.cfg.in" check-runtimes ;; +generic-assertions) + clean + generate-cmake -C "${MONOREPO_ROOT}/libcxx/cmake/caches/Generic-assertions.cmake" + check-runtimes + check-abi-list +;; generic-hardened-mode) clean generate-cmake -C "${MONOREPO_ROOT}/libcxx/cmake/caches/Generic-hardened-mode.cmake" @@ -489,6 +495,44 @@ # TODO: It would be better to run the tests against the fake-installed version of libc++ instead xcrun --sdk macosx ninja -vC "${BUILD_DIR}/${arch}" check-cxx check-cxxabi check-cxx-abilist ;; +apple-system-backdeployment-assertions--*) + clean + + if [[ "${OSX_ROOTS}" == "" ]]; then + echo "--- Downloading previous macOS dylibs" + PREVIOUS_DYLIBS_URL="https://dl.dropboxusercontent.com/s/gmcfxwgl9f9n6pu/libcxx-roots.tar.gz" + OSX_ROOTS="${BUILD_DIR}/macos-roots" + mkdir -p "${OSX_ROOTS}" + curl "${PREVIOUS_DYLIBS_URL}" | tar -xz --strip-components=1 -C "${OSX_ROOTS}" + fi + + DEPLOYMENT_TARGET="${BUILDER#apple-system-backdeployment-assertions-}" + + # TODO: On Apple platforms, we never produce libc++abi.1.dylib or libunwind.1.dylib, + # only libc++abi.dylib and libunwind.dylib. Fix that in the build so that the + # tests stop searching for @rpath/libc++abi.1.dylib and @rpath/libunwind.1.dylib. + cp "${OSX_ROOTS}/macOS/libc++abi/${DEPLOYMENT_TARGET}/libc++abi.dylib" \ + "${OSX_ROOTS}/macOS/libc++abi/${DEPLOYMENT_TARGET}/libc++abi.1.dylib" + cp "${OSX_ROOTS}/macOS/libunwind/${DEPLOYMENT_TARGET}/libunwind.dylib" \ + "${OSX_ROOTS}/macOS/libunwind/${DEPLOYMENT_TARGET}/libunwind.1.dylib" + + arch="$(uname -m)" + PARAMS="target_triple=${arch}-apple-macosx${DEPLOYMENT_TARGET}" + PARAMS+=";cxx_runtime_root=${OSX_ROOTS}/macOS/libc++/${DEPLOYMENT_TARGET}" + PARAMS+=";abi_runtime_root=${OSX_ROOTS}/macOS/libc++abi/${DEPLOYMENT_TARGET}" + PARAMS+=";unwind_runtime_root=${OSX_ROOTS}/macOS/libunwind/${DEPLOYMENT_TARGET}" + PARAMS+=";enable_assertions=True" + + generate-cmake -C "${MONOREPO_ROOT}/libcxx/cmake/caches/Apple.cmake" \ + -DLIBCXX_TEST_CONFIG="apple-libc++-backdeployment.cfg.in" \ + -DLIBCXXABI_TEST_CONFIG="apple-libc++abi-backdeployment.cfg.in" \ + -DLIBUNWIND_TEST_CONFIG="apple-libunwind-backdeployment.cfg.in" \ + -DLIBCXX_TEST_PARAMS="${PARAMS}" \ + -DLIBCXXABI_TEST_PARAMS="${PARAMS}" \ + -DLIBUNWIND_TEST_PARAMS="${PARAMS}" + + check-runtimes +;; apple-system-backdeployment-hardened-*) clean diff --git a/libcxx/utils/libcxx/test/params.py b/libcxx/utils/libcxx/test/params.py --- a/libcxx/utils/libcxx/test/params.py +++ b/libcxx/utils/libcxx/test/params.py @@ -299,6 +299,18 @@ help="Whether to enable tests that take longer to run. This can be useful when running on a very slow device.", actions=lambda enabled: [] if not enabled else [AddFeature("long_tests")], ), + Parameter( + name="enable_assertions", + choices=[True, False], + type=bool, + default=False, + help="Whether to enable assertions when compiling the test suite. This is only meaningful when " + "running the tests against libc++.", + actions=lambda assertions: [] if not assertions else [ + AddCompileFlag("-D_LIBCPP_ENABLE_ASSERTIONS=1"), + AddFeature("libcpp-has-assertions"), + ], + ), Parameter( name="hardening_mode", choices=["unchecked", "hardened", "debug"],