From 58780b811c23df3d928d8452ee21c862dde754a2 Mon Sep 17 00:00:00 2001 From: Konstantin Varlamov Date: Fri, 19 Jan 2024 13:48:13 -0800 Subject: [PATCH] [libc++][hardening] In production hardening modes, trap rather than abort (#78561) In the hardening modes that can be used in production (`fast` and `extensive`), make a failed assertion invoke a trap instruction rather than calling verbose abort. In the debug mode, still keep calling verbose abort to provide a better user experience and to allow us to keep our existing testing infrastructure for verifying assertion messages. Since the debug mode by definition enables all assertions, we can be sure that we still check all the assertion messages in the library when running the test suite in the debug mode. The main motivation to use trapping in production is to achieve better code generation and reduce the binary size penalty. This way, the assertion handler can compile to a single instruction, whereas the existing mechanism with verbose abort results in generating a function call that in general cannot be optimized away (made worse by the fact that it's a variadic function, imposing an additional penalty). See the [RFC](https://discourse.llvm.org/t/rfc-hardening-in-libc/73925) for more details. Note that this mechanism can now be completely [overridden at CMake configuration time](https://github.com/llvm/llvm-project/pull/77883). This patch also significantly refactors `check_assertion.h` and expands its test coverage. The main changes: - when overriding `verbose_abort`, don't do matching inside the function -- just print the error message to `stderr`. This removes the need to set a global matcher and allows to do matching in the parent process after the child finishes; - remove unused logic for matching source locations and for using wildcards; - make matchers simple functors; - introduce `DeathTestResult` that keeps data about the test run, primarily to make it easier to test. In addition to the refactoring, `check_assertion.h` can now recognize when a process exits due to a trap. --- libcxx/docs/BuildingLibcxx.rst | 41 +- libcxx/docs/ReleaseNotes/18.rst | 21 +- .../alg.sorting/assert.min.max.pass.cpp | 2 +- .../assert.sort.invalid_comparator.pass.cpp | 2 +- ...tomize_verbose_abort.compile-time.pass.cpp | 2 +- ...customize_verbose_abort.link-time.pass.cpp | 2 +- .../assertions/default_verbose_abort.pass.cpp | 4 +- ...assertions_enables_extensive_mode.pass.cpp | 5 +- .../assertions/modes/extensive.pass.cpp | 1 - .../libcxx/assertions/modes/fast.pass.cpp | 1 - .../override_with_extensive_mode.pass.cpp | 5 +- .../modes/override_with_fast_mode.pass.cpp | 5 +- .../array/array.zero/assert.back.pass.cpp | 2 +- .../array/array.zero/assert.front.pass.cpp | 2 +- .../array.zero/assert.subscript.pass.cpp | 2 +- .../deque/assert.pop_back.empty.pass.cpp | 2 +- .../assert.erase_iter.end.pass.cpp | 2 +- .../assert.pop_back.empty.pass.cpp | 2 +- .../vector/assert.back.empty.pass.cpp | 2 +- .../vector/assert.cback.empty.pass.cpp | 2 +- .../vector/assert.cfront.empty.pass.cpp | 2 +- .../vector/assert.cindex.oob.pass.cpp | 2 +- .../vector/assert.front.empty.pass.cpp | 2 +- .../vector/assert.index.oob.pass.cpp | 2 +- .../vector/assert.pop_back.empty.pass.cpp | 2 +- .../unord/unord.map/assert.bucket.pass.cpp | 2 +- .../unord.map/assert.bucket_size.pass.cpp | 2 +- .../unord.map/assert.max_load_factor.pass.cpp | 2 +- .../unord.multimap/assert.bucket.pass.cpp | 2 +- .../assert.bucket_size.pass.cpp | 2 +- .../assert.max_load_factor.pass.cpp | 2 +- .../unord.multiset/assert.bucket.pass.cpp | 2 +- .../assert.bucket_size.pass.cpp | 2 +- .../assert.max_load_factor.pass.cpp | 2 +- .../unord/unord.set/assert.bucket.pass.cpp | 2 +- .../unord.set/assert.bucket_size.pass.cpp | 2 +- .../unord.set/assert.max_load_factor.pass.cpp | 2 +- .../mdspan/extents/assert.conversion.pass.cpp | 2 +- .../extents/assert.ctor_from_array.pass.cpp | 2 +- .../assert.ctor_from_integral.pass.cpp | 2 +- .../extents/assert.ctor_from_span.pass.cpp | 2 +- .../views/mdspan/extents/assert.obs.pass.cpp | 2 +- .../layout_left/assert.conversion.pass.cpp | 2 +- .../layout_left/assert.ctor.extents.pass.cpp | 2 +- .../assert.ctor.layout_right.pass.cpp | 2 +- .../assert.ctor.layout_stride.pass.cpp | 2 +- .../assert.index_operator.pass.cpp | 2 +- .../mdspan/layout_left/assert.stride.pass.cpp | 2 +- .../layout_right/assert.conversion.pass.cpp | 2 +- .../layout_right/assert.ctor.extents.pass.cpp | 2 +- .../assert.ctor.layout_left.pass.cpp | 2 +- .../assert.ctor.layout_stride.pass.cpp | 2 +- .../assert.index_operator.pass.cpp | 2 +- .../layout_right/assert.stride.pass.cpp | 2 +- .../layout_stride/assert.conversion.pass.cpp | 2 +- ...ert.ctor.extents_array.non_unique.pass.cpp | 2 +- .../assert.ctor.extents_array.pass.cpp | 2 +- ...sert.ctor.extents_span.non_unique.pass.cpp | 2 +- .../assert.ctor.extents_span.pass.cpp | 2 +- .../assert.index_operator.pass.cpp | 2 +- .../layout_stride/assert.stride.pass.cpp | 2 +- .../mdspan/mdspan/assert.conversion.pass.cpp | 2 +- .../mdspan/assert.index_operator.pass.cpp | 2 +- .../views/mdspan/mdspan/assert.size.pass.cpp | 2 +- .../span.cons/assert.iter_sent.pass.cpp | 2 +- .../span.cons/assert.iter_size.pass.cpp | 2 +- .../span.cons/assert.other_span.pass.cpp | 2 +- .../span.cons/assert.range.pass.cpp | 2 +- .../views.span/span.elem/assert.back.pass.cpp | 2 +- .../span.elem/assert.front.pass.cpp | 2 +- .../span.elem/assert.op_idx.pass.cpp | 2 +- .../views.span/span.sub/assert.first.pass.cpp | 2 +- .../views.span/span.sub/assert.last.pass.cpp | 2 +- .../span.sub/assert.subspan.pass.cpp | 2 +- .../path.itr/assert.iterator.pass.cpp | 2 +- .../libcxx/iterators/assert.advance.pass.cpp | 2 +- .../libcxx/iterators/assert.next.pass.cpp | 2 +- .../libcxx/iterators/assert.prev.pass.cpp | 2 +- .../bounded_iter/dereference.pass.cpp | 2 +- .../counted.iterator/assert.pass.cpp | 2 +- .../iterators.common/assert.pass.cpp | 2 +- .../range.chunk.by/assert.begin.pass.cpp | 2 +- .../range.chunk.by/assert.find-next.pass.cpp | 2 +- .../range.chunk.by/assert.find-prev.pass.cpp | 2 +- .../range.chunk.by.iter/assert.deref.pass.cpp | 2 +- .../assert.increment.pass.cpp | 2 +- .../range.drop.while/assert.begin.pass.cpp | 2 +- .../assert.equal.pass.cpp | 2 +- .../assert.equal.pass.cpp | 2 +- .../string.access/assert.back.pass.cpp | 2 +- .../string.access/assert.cback.pass.cpp | 2 +- .../string.access/assert.cfront.pass.cpp | 2 +- .../string.access/assert.cindex.pass.cpp | 2 +- .../string.access/assert.front.pass.cpp | 2 +- .../string.access/assert.index.pass.cpp | 2 +- .../assert.erase_iter.null.pass.cpp | 2 +- .../string.modifiers/assert.pop_back.pass.cpp | 2 +- .../string.view/assert.ctor.length.pass.cpp | 2 +- .../string.view/assert.ctor.pointer.pass.cpp | 2 +- .../assert.set_exception.pass.cpp | 2 +- ...sert.set_exception_at_thread_exit.pass.cpp | 2 +- .../thread.barrier/assert.arrive.pass.cpp | 2 +- .../thread.barrier/assert.ctor.pass.cpp | 2 +- .../assert.arrive_and_wait.pass.cpp | 2 +- .../thread.latch/assert.count_down.pass.cpp | 2 +- .../thread/thread.latch/assert.ctor.pass.cpp | 2 +- .../thread.semaphore/assert.ctor.pass.cpp | 2 +- .../thread.semaphore/assert.release.pass.cpp | 2 +- ...ert.exception_guard.no_exceptions.pass.cpp | 2 +- .../expected.expected/assert.arrow.pass.cpp | 2 +- .../expected.expected/assert.deref.pass.cpp | 2 +- .../expected.expected/assert.error.pass.cpp | 2 +- .../expected.void/assert.deref.pass.cpp | 2 +- .../expected.void/assert.error.pass.cpp | 2 +- .../assert.dereference.pass.cpp | 2 +- .../assert.op_arrow.pass.cpp | 2 +- libcxx/test/support/check_assertion.h | 399 ++++++++++-------- .../test_check_assertion.pass.cpp | 127 ++++-- .../vendor/llvm/default_assertion_handler.in | 12 +- 119 files changed, 483 insertions(+), 354 deletions(-) diff --git a/libcxx/docs/BuildingLibcxx.rst b/libcxx/docs/BuildingLibcxx.rst index 11e250e3f3735a..dcd05a28f36d18 100644 --- a/libcxx/docs/BuildingLibcxx.rst +++ b/libcxx/docs/BuildingLibcxx.rst @@ -485,28 +485,25 @@ LLVM-specific options .. _assertion-handler: Overriding the default assertion 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. - -However, vendors can also override that mechanism at CMake configuration time. -When a hardening assertion fails, the library invokes the -``_LIBCPP_ASSERTION_HANDLER`` macro. A vendor may provide a header that contains -a custom definition of this macro and specify the path to the header via the -``LIBCXX_ASSERTION_HANDLER_FILE`` CMake variable. If provided, this header will -be included by the library and replace the default implementation. The header -must not include any standard library headers (directly or transitively) because -doing so will almost always create a circular dependency. The -``_LIBCPP_ASSERTION_HANDLER(message)`` macro takes a single parameter that -contains an error message explaining the hardening failure and some details -about the source location that triggered it. +======================================== + +When the library wants to terminate due to a hardening assertion failure, the +program is aborted by invoking a trap instruction (or in debug mode, by +a special verbose termination function that prints an error message and calls +``std::abort()``). This is done to minimize the code size impact of enabling +hardening in the library. However, vendors can also override that mechanism at +CMake configuration time. + +Under the hood, a hardening assertion will invoke the +``_LIBCPP_ASSERTION_HANDLER`` macro upon failure. A vendor may provide a header +that contains a custom definition of this macro and specify the path to the +header via the ``LIBCXX_ASSERTION_HANDLER_FILE`` CMake variable. If provided, +this header will be included by the library and replace the default +implementation. The header must not include any standard library headers +(directly or transitively) because doing so will almost always create a circular +dependency. The ``_LIBCPP_ASSERTION_HANDLER(message)`` macro takes a single +parameter that contains an error message explaining the hardening failure and +some details about the source location that triggered it. When a hardening assertion fails, it means that the program is about to invoke library undefined behavior. For this reason, the custom assertion handler is diff --git a/libcxx/docs/ReleaseNotes/18.rst b/libcxx/docs/ReleaseNotes/18.rst index 983363af54e735..37f2a77ca4f854 100644 --- a/libcxx/docs/ReleaseNotes/18.rst +++ b/libcxx/docs/ReleaseNotes/18.rst @@ -107,13 +107,18 @@ Deprecations and Removals macro is provided to restore the previous behavior, and it will be supported in the LLVM 18 release only. In LLVM 19 and beyond, ``_LIBCPP_ENABLE_NARROWING_CONVERSIONS_IN_VARIANT`` will not be honored anymore. -- The only supported way to customize the assertion handler that gets invoked when a hardening assertion fails - is now by setting the ``LIBCXX_ASSERTION_HANDLER_FILE`` CMake variable and providing a custom header. See - the documentation on overriding the default assertion handler for details. +- Overriding `__libcpp_verbose_abort` no longer has any effect on library assertions. The only supported way + to customize the assertion handler that gets invoked when a hardening assertion fails is now by setting the + ``LIBCXX_ASSERTION_HANDLER_FILE`` CMake variable and providing a custom header. See the documentation on + overriding the default assertion handler for details. The ability to override `__libcpp_verbose_abort` will + be removed in an upcoming release in favor of the new overriding mechanism. + +- In safe mode (which is now equivalent to the ``extensive`` hardening mode), a failed assertion will now + generate a trap rather than a call to verbose abort. - The ``_LIBCPP_AVAILABILITY_CUSTOM_VERBOSE_ABORT_PROVIDED`` macro is not honored anymore in LLVM 18. - Please see the updated documentation about the hardening modes in libc++ and in particular the - ``_LIBCPP_VERBOSE_ABORT`` macro for details. + Please see the updated documentation about the hardening modes in libc++ and in particular on + overriding the default assertion handler. - The headers ````, ````, ````, ````, ````, ````, ````, @@ -136,13 +141,15 @@ Deprecations and Removals Upcoming Deprecations and Removals ---------------------------------- +- The ability to override ``__libcpp_verbose_abort`` will be removed in an upcoming release. + LLVM 19 ~~~~~~~ - The ``LIBCXX_ENABLE_ASSERTIONS`` CMake variable that was used to enable the safe mode will be deprecated and setting it will trigger an error; use the ``LIBCXX_HARDENING_MODE`` variable with the value ``extensive`` instead. Similarly, - the ``_LIBCPP_ENABLE_ASSERTIONS`` macro will be deprecated (setting it to ``1`` still enables the extensive mode the - LLVM 19 release while also issuing a deprecation warning). See :ref:`the hardening documentation + the ``_LIBCPP_ENABLE_ASSERTIONS`` macro will be deprecated (setting it to ``1`` still enables the extensive mode in + the LLVM 19 release while also issuing a deprecation warning). See :ref:`the hardening documentation ` for more details. - The base template for ``std::char_traits`` has been marked as deprecated and will be removed in LLVM 19. If you 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 index bd9dfd4549c4e2..7e765d7e846834 100644 --- a/libcxx/test/libcxx/algorithms/alg.sorting/assert.min.max.pass.cpp +++ b/libcxx/test/libcxx/algorithms/alg.sorting/assert.min.max.pass.cpp @@ -11,7 +11,7 @@ // REQUIRES: has-unix-headers // UNSUPPORTED: c++03, c++11, c++14, c++17 // UNSUPPORTED: libcpp-hardening-mode=none -// XFAIL: availability-verbose_abort-missing +// XFAIL: libcpp-hardening-mode=debug && availability-verbose_abort-missing #include #include diff --git a/libcxx/test/libcxx/algorithms/alg.sorting/assert.sort.invalid_comparator.pass.cpp b/libcxx/test/libcxx/algorithms/alg.sorting/assert.sort.invalid_comparator.pass.cpp index 96c2821c4a654c..f90e2a3a1a71fd 100644 --- a/libcxx/test/libcxx/algorithms/alg.sorting/assert.sort.invalid_comparator.pass.cpp +++ b/libcxx/test/libcxx/algorithms/alg.sorting/assert.sort.invalid_comparator.pass.cpp @@ -11,7 +11,7 @@ // REQUIRES: has-unix-headers // UNSUPPORTED: c++03, c++11, c++14, c++17 // UNSUPPORTED: !libcpp-hardening-mode=debug -// XFAIL: availability-verbose_abort-missing +// XFAIL: libcpp-hardening-mode=debug && availability-verbose_abort-missing // ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DEBUG_STRICT_WEAK_ORDERING_CHECK // When the debug mode is enabled, this test fails because we actually catch on the fly that the comparator is not // a strict-weak ordering before we catch that we'd dereference out-of-bounds inside std::sort, which leads to different diff --git a/libcxx/test/libcxx/assertions/customize_verbose_abort.compile-time.pass.cpp b/libcxx/test/libcxx/assertions/customize_verbose_abort.compile-time.pass.cpp index d09881e8cecb9f..69154c3f7eaffa 100644 --- a/libcxx/test/libcxx/assertions/customize_verbose_abort.compile-time.pass.cpp +++ b/libcxx/test/libcxx/assertions/customize_verbose_abort.compile-time.pass.cpp @@ -22,6 +22,6 @@ void my_abort(char const*, ...) { } int main(int, char**) { - _LIBCPP_ASSERT(false, "message"); + _LIBCPP_VERBOSE_ABORT("%s", "message"); return EXIT_FAILURE; } diff --git a/libcxx/test/libcxx/assertions/customize_verbose_abort.link-time.pass.cpp b/libcxx/test/libcxx/assertions/customize_verbose_abort.link-time.pass.cpp index 219c43874e77db..585ab73f2cb261 100644 --- a/libcxx/test/libcxx/assertions/customize_verbose_abort.link-time.pass.cpp +++ b/libcxx/test/libcxx/assertions/customize_verbose_abort.link-time.pass.cpp @@ -19,6 +19,6 @@ void std::__libcpp_verbose_abort(char const*, ...) { } int main(int, char**) { - _LIBCPP_ASSERT(false, "message"); + std::__libcpp_verbose_abort("%s", "message"); return EXIT_FAILURE; } diff --git a/libcxx/test/libcxx/assertions/default_verbose_abort.pass.cpp b/libcxx/test/libcxx/assertions/default_verbose_abort.pass.cpp index 870f43da4b8f02..0cc4b1e0052267 100644 --- a/libcxx/test/libcxx/assertions/default_verbose_abort.pass.cpp +++ b/libcxx/test/libcxx/assertions/default_verbose_abort.pass.cpp @@ -7,7 +7,9 @@ //===----------------------------------------------------------------------===// // Test that the default verbose termination function aborts the program. +// XFAIL: availability-verbose_abort-missing +#include <__verbose_abort> #include #include @@ -19,6 +21,6 @@ void signal_handler(int signal) { int main(int, char**) { if (std::signal(SIGABRT, signal_handler) != SIG_ERR) - _LIBCPP_ASSERT(false, "foo"); + std::__libcpp_verbose_abort("%s", "foo"); return EXIT_FAILURE; } diff --git a/libcxx/test/libcxx/assertions/modes/enabling_assertions_enables_extensive_mode.pass.cpp b/libcxx/test/libcxx/assertions/modes/enabling_assertions_enables_extensive_mode.pass.cpp index a40ae84fa8e85d..a91ba041763749 100644 --- a/libcxx/test/libcxx/assertions/modes/enabling_assertions_enables_extensive_mode.pass.cpp +++ b/libcxx/test/libcxx/assertions/modes/enabling_assertions_enables_extensive_mode.pass.cpp @@ -12,8 +12,9 @@ // `check_assertion.h` is only available starting from C++11 and requires Unix headers and regex support. // UNSUPPORTED: c++03, !has-unix-headers, no-localization -// The ability to set a custom abort message is required to compare the assertion message. -// XFAIL: availability-verbose_abort-missing +// The ability to set a custom abort message is required to compare the assertion message (which only happens in the +// debug mode). +// XFAIL: libcpp-hardening-mode=debug && availability-verbose_abort-missing // Note that GCC doesn't support `-Wno-macro-redefined`. // ADDITIONAL_COMPILE_FLAGS: -U_LIBCPP_HARDENING_MODE -D_LIBCPP_ENABLE_ASSERTIONS=1 diff --git a/libcxx/test/libcxx/assertions/modes/extensive.pass.cpp b/libcxx/test/libcxx/assertions/modes/extensive.pass.cpp index e9e494eae341b4..5743f95e472d70 100644 --- a/libcxx/test/libcxx/assertions/modes/extensive.pass.cpp +++ b/libcxx/test/libcxx/assertions/modes/extensive.pass.cpp @@ -14,7 +14,6 @@ // UNSUPPORTED: c++03 // `check_assertion.h` requires Unix headers. // REQUIRES: has-unix-headers -// XFAIL: availability-verbose_abort-missing #include #include "check_assertion.h" diff --git a/libcxx/test/libcxx/assertions/modes/fast.pass.cpp b/libcxx/test/libcxx/assertions/modes/fast.pass.cpp index 33377f03fe870f..85181859fdad0d 100644 --- a/libcxx/test/libcxx/assertions/modes/fast.pass.cpp +++ b/libcxx/test/libcxx/assertions/modes/fast.pass.cpp @@ -14,7 +14,6 @@ // UNSUPPORTED: c++03 // `check_assertion.h` requires Unix headers. // REQUIRES: has-unix-headers -// XFAIL: availability-verbose_abort-missing #include #include "check_assertion.h" diff --git a/libcxx/test/libcxx/assertions/modes/override_with_extensive_mode.pass.cpp b/libcxx/test/libcxx/assertions/modes/override_with_extensive_mode.pass.cpp index f5323c671c9b1f..f78d5d70e58904 100644 --- a/libcxx/test/libcxx/assertions/modes/override_with_extensive_mode.pass.cpp +++ b/libcxx/test/libcxx/assertions/modes/override_with_extensive_mode.pass.cpp @@ -10,8 +10,9 @@ // `check_assertion.h` is only available starting from C++11 and requires Unix headers and regex support. // UNSUPPORTED: c++03, !has-unix-headers, no-localization -// The ability to set a custom abort message is required to compare the assertion message. -// XFAIL: availability-verbose_abort-missing +// The ability to set a custom abort message is required to compare the assertion message (which only happens in the +// debug mode). +// XFAIL: libcpp-hardening-mode=debug && availability-verbose_abort-missing // ADDITIONAL_COMPILE_FLAGS: -U_LIBCPP_HARDENING_MODE -D_LIBCPP_HARDENING_MODE=_LIBCPP_HARDENING_MODE_EXTENSIVE #include diff --git a/libcxx/test/libcxx/assertions/modes/override_with_fast_mode.pass.cpp b/libcxx/test/libcxx/assertions/modes/override_with_fast_mode.pass.cpp index 5ee22cc45f3bf0..27542ee32bef94 100644 --- a/libcxx/test/libcxx/assertions/modes/override_with_fast_mode.pass.cpp +++ b/libcxx/test/libcxx/assertions/modes/override_with_fast_mode.pass.cpp @@ -10,8 +10,9 @@ // `check_assertion.h` is only available starting from C++11 and requires Unix headers and regex support. // UNSUPPORTED: c++03, !has-unix-headers, no-localization -// The ability to set a custom abort message is required to compare the assertion message. -// XFAIL: availability-verbose_abort-missing +// The ability to set a custom abort message is required to compare the assertion message (which only happens in the +// debug mode). +// XFAIL: libcpp-hardening-mode=debug && availability-verbose_abort-missing // ADDITIONAL_COMPILE_FLAGS: -U_LIBCPP_HARDENING_MODE -D_LIBCPP_HARDENING_MODE=_LIBCPP_HARDENING_MODE_FAST #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 index 7bd399fca7e0be..c20b0c9a804f26 100644 --- 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 @@ -9,7 +9,7 @@ // REQUIRES: has-unix-headers // UNSUPPORTED: c++03 // UNSUPPORTED: libcpp-hardening-mode=none -// XFAIL: availability-verbose_abort-missing +// XFAIL: libcpp-hardening-mode=debug && 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 index fcfb26ff42726f..1ea0035ee4cc50 100644 --- 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 @@ -9,7 +9,7 @@ // REQUIRES: has-unix-headers // UNSUPPORTED: c++03 // UNSUPPORTED: libcpp-hardening-mode=none -// XFAIL: availability-verbose_abort-missing +// XFAIL: libcpp-hardening-mode=debug && 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 index e221e361405adc..ab65ce223f7c54 100644 --- 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 @@ -9,7 +9,7 @@ // REQUIRES: has-unix-headers // UNSUPPORTED: c++03 // UNSUPPORTED: libcpp-hardening-mode=none -// XFAIL: availability-verbose_abort-missing +// XFAIL: libcpp-hardening-mode=debug && 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 index e0f102b3cc1f82..19cd41f4cf3a2a 100644 --- 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 @@ -13,7 +13,7 @@ // REQUIRES: has-unix-headers // UNSUPPORTED: c++03 // UNSUPPORTED: libcpp-hardening-mode=none -// XFAIL: availability-verbose_abort-missing +// XFAIL: libcpp-hardening-mode=debug && 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 index a6471f7389b871..531dd8de399deb 100644 --- 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 @@ -13,7 +13,7 @@ // REQUIRES: has-unix-headers // UNSUPPORTED: c++03 // UNSUPPORTED: libcpp-hardening-mode=none -// XFAIL: availability-verbose_abort-missing +// XFAIL: libcpp-hardening-mode=debug && 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 index 04e933430a7b05..d7c69991622704 100644 --- 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 @@ -13,7 +13,7 @@ // REQUIRES: has-unix-headers // UNSUPPORTED: c++03 // UNSUPPORTED: libcpp-hardening-mode=none -// XFAIL: availability-verbose_abort-missing +// XFAIL: libcpp-hardening-mode=debug && availability-verbose_abort-missing #include #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 index b68b5dece68404..169ad1def9e6f6 100644 --- a/libcxx/test/libcxx/containers/sequences/vector/assert.back.empty.pass.cpp +++ b/libcxx/test/libcxx/containers/sequences/vector/assert.back.empty.pass.cpp @@ -13,7 +13,7 @@ // REQUIRES: has-unix-headers // UNSUPPORTED: c++03 // UNSUPPORTED: libcpp-hardening-mode=none -// XFAIL: availability-verbose_abort-missing +// XFAIL: libcpp-hardening-mode=debug && availability-verbose_abort-missing #include #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 index 0c1571f67a53cd..5ceb4a16b93402 100644 --- a/libcxx/test/libcxx/containers/sequences/vector/assert.cback.empty.pass.cpp +++ b/libcxx/test/libcxx/containers/sequences/vector/assert.cback.empty.pass.cpp @@ -13,7 +13,7 @@ // REQUIRES: has-unix-headers // UNSUPPORTED: c++03 // UNSUPPORTED: libcpp-hardening-mode=none -// XFAIL: availability-verbose_abort-missing +// XFAIL: libcpp-hardening-mode=debug && 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 index 6d0f4eacf44c0c..20f94f1d3f0fad 100644 --- a/libcxx/test/libcxx/containers/sequences/vector/assert.cfront.empty.pass.cpp +++ b/libcxx/test/libcxx/containers/sequences/vector/assert.cfront.empty.pass.cpp @@ -13,7 +13,7 @@ // REQUIRES: has-unix-headers // UNSUPPORTED: c++03 // UNSUPPORTED: libcpp-hardening-mode=none -// XFAIL: availability-verbose_abort-missing +// XFAIL: libcpp-hardening-mode=debug && 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 index 47a531fb3cf756..3a9a7add3e30d0 100644 --- a/libcxx/test/libcxx/containers/sequences/vector/assert.cindex.oob.pass.cpp +++ b/libcxx/test/libcxx/containers/sequences/vector/assert.cindex.oob.pass.cpp @@ -13,7 +13,7 @@ // REQUIRES: has-unix-headers // UNSUPPORTED: c++03 // UNSUPPORTED: libcpp-hardening-mode=none -// XFAIL: availability-verbose_abort-missing +// XFAIL: libcpp-hardening-mode=debug && availability-verbose_abort-missing #include #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 index 687f8fa8664a6e..85364c778ad64d 100644 --- a/libcxx/test/libcxx/containers/sequences/vector/assert.front.empty.pass.cpp +++ b/libcxx/test/libcxx/containers/sequences/vector/assert.front.empty.pass.cpp @@ -13,7 +13,7 @@ // REQUIRES: has-unix-headers // UNSUPPORTED: c++03 // UNSUPPORTED: libcpp-hardening-mode=none -// XFAIL: availability-verbose_abort-missing +// XFAIL: libcpp-hardening-mode=debug && availability-verbose_abort-missing #include #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 index 1f3cae3479a1b8..14cb89625f0643 100644 --- a/libcxx/test/libcxx/containers/sequences/vector/assert.index.oob.pass.cpp +++ b/libcxx/test/libcxx/containers/sequences/vector/assert.index.oob.pass.cpp @@ -13,7 +13,7 @@ // REQUIRES: has-unix-headers // UNSUPPORTED: c++03 // UNSUPPORTED: libcpp-hardening-mode=none -// XFAIL: availability-verbose_abort-missing +// XFAIL: libcpp-hardening-mode=debug && availability-verbose_abort-missing #include #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 index 4ed3fab6d22bb7..ad80be69897edc 100644 --- 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 @@ -13,7 +13,7 @@ // REQUIRES: has-unix-headers // UNSUPPORTED: c++03 // UNSUPPORTED: libcpp-hardening-mode=none -// XFAIL: availability-verbose_abort-missing +// XFAIL: libcpp-hardening-mode=debug && 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 index 51718c013ba560..8d23673dfc50f2 100644 --- a/libcxx/test/libcxx/containers/unord/unord.map/assert.bucket.pass.cpp +++ b/libcxx/test/libcxx/containers/unord/unord.map/assert.bucket.pass.cpp @@ -13,7 +13,7 @@ // REQUIRES: has-unix-headers // UNSUPPORTED: c++03 // REQUIRES: libcpp-hardening-mode={{extensive|debug}} -// XFAIL: availability-verbose_abort-missing +// XFAIL: libcpp-hardening-mode=debug && availability-verbose_abort-missing #include #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 index de6aa442c6b3ba..0a0bb888182e9e 100644 --- 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 @@ -17,7 +17,7 @@ // REQUIRES: has-unix-headers // UNSUPPORTED: c++03 // REQUIRES: libcpp-hardening-mode={{extensive|debug}} -// XFAIL: availability-verbose_abort-missing +// XFAIL: libcpp-hardening-mode=debug && availability-verbose_abort-missing #include #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 index 7b6a83559f9ee1..452a3ae8c3818f 100644 --- 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 @@ -18,7 +18,7 @@ // REQUIRES: has-unix-headers // UNSUPPORTED: c++03 // REQUIRES: libcpp-hardening-mode={{extensive|debug}} -// XFAIL: availability-verbose_abort-missing +// XFAIL: libcpp-hardening-mode=debug && availability-verbose_abort-missing #include #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 index 2b2859c1e19407..ec3892f444cd6b 100644 --- a/libcxx/test/libcxx/containers/unord/unord.multimap/assert.bucket.pass.cpp +++ b/libcxx/test/libcxx/containers/unord/unord.multimap/assert.bucket.pass.cpp @@ -17,7 +17,7 @@ // REQUIRES: has-unix-headers // UNSUPPORTED: c++03 // REQUIRES: libcpp-hardening-mode={{extensive|debug}} -// XFAIL: availability-verbose_abort-missing +// XFAIL: libcpp-hardening-mode=debug && availability-verbose_abort-missing #include #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 index 6100ef37a33b11..ea5904b94019eb 100644 --- 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 @@ -17,7 +17,7 @@ // REQUIRES: has-unix-headers // UNSUPPORTED: c++03 // REQUIRES: libcpp-hardening-mode={{extensive|debug}} -// XFAIL: availability-verbose_abort-missing +// XFAIL: libcpp-hardening-mode=debug && availability-verbose_abort-missing #include #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 index 8c80821b823d44..65f7c91d293d6c 100644 --- 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 @@ -18,7 +18,7 @@ // REQUIRES: has-unix-headers // UNSUPPORTED: c++03 // REQUIRES: libcpp-hardening-mode={{extensive|debug}} -// XFAIL: availability-verbose_abort-missing +// XFAIL: libcpp-hardening-mode=debug && availability-verbose_abort-missing #include #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 index 40c68fd6c0c09b..49fdb723b42301 100644 --- a/libcxx/test/libcxx/containers/unord/unord.multiset/assert.bucket.pass.cpp +++ b/libcxx/test/libcxx/containers/unord/unord.multiset/assert.bucket.pass.cpp @@ -17,7 +17,7 @@ // REQUIRES: has-unix-headers // UNSUPPORTED: c++03 // REQUIRES: libcpp-hardening-mode={{extensive|debug}} -// XFAIL: availability-verbose_abort-missing +// XFAIL: libcpp-hardening-mode=debug && 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 index 8599b53ae30c8b..5709fd1e30d9ab 100644 --- 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 @@ -17,7 +17,7 @@ // REQUIRES: has-unix-headers // UNSUPPORTED: c++03 // REQUIRES: libcpp-hardening-mode={{extensive|debug}} -// XFAIL: availability-verbose_abort-missing +// XFAIL: libcpp-hardening-mode=debug && 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 index 0dedebed4acfcf..c54bb833e72403 100644 --- 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 @@ -18,7 +18,7 @@ // REQUIRES: has-unix-headers // UNSUPPORTED: c++03 // REQUIRES: libcpp-hardening-mode={{extensive|debug}} -// XFAIL: availability-verbose_abort-missing +// XFAIL: libcpp-hardening-mode=debug && 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 index d5a3cd9a5c1b30..c0bfb00efc68ae 100644 --- a/libcxx/test/libcxx/containers/unord/unord.set/assert.bucket.pass.cpp +++ b/libcxx/test/libcxx/containers/unord/unord.set/assert.bucket.pass.cpp @@ -17,7 +17,7 @@ // REQUIRES: has-unix-headers // UNSUPPORTED: c++03 // REQUIRES: libcpp-hardening-mode={{extensive|debug}} -// XFAIL: availability-verbose_abort-missing +// XFAIL: libcpp-hardening-mode=debug && 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 index f8f5feea48aabf..3e25b448cb8726 100644 --- 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 @@ -17,7 +17,7 @@ // REQUIRES: has-unix-headers // UNSUPPORTED: c++03 // REQUIRES: libcpp-hardening-mode={{extensive|debug}} -// XFAIL: availability-verbose_abort-missing +// XFAIL: libcpp-hardening-mode=debug && 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 index 002e5f3962146a..ec1f1f3bd5ce17 100644 --- 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 @@ -18,7 +18,7 @@ // REQUIRES: has-unix-headers // UNSUPPORTED: c++03 // REQUIRES: libcpp-hardening-mode={{extensive|debug}} -// XFAIL: availability-verbose_abort-missing +// XFAIL: libcpp-hardening-mode=debug && 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 index e8cde6bf8856c8..03ed1f78b778b4 100644 --- a/libcxx/test/libcxx/containers/views/mdspan/extents/assert.conversion.pass.cpp +++ b/libcxx/test/libcxx/containers/views/mdspan/extents/assert.conversion.pass.cpp @@ -7,7 +7,7 @@ // REQUIRES: has-unix-headers // UNSUPPORTED: c++03, c++11, c++14, c++17, c++20 // UNSUPPORTED: libcpp-hardening-mode=none -// XFAIL: availability-verbose_abort-missing +// XFAIL: libcpp-hardening-mode=debug && 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 index 886375e54ca3ca..906a6ec87bd446 100644 --- 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 @@ -7,7 +7,7 @@ // REQUIRES: has-unix-headers // UNSUPPORTED: c++03, c++11, c++14, c++17, c++20 // UNSUPPORTED: libcpp-hardening-mode=none -// XFAIL: availability-verbose_abort-missing +// XFAIL: libcpp-hardening-mode=debug && 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 index e03bb28ba1cfba..af484a300ea8b3 100644 --- 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 @@ -7,7 +7,7 @@ // REQUIRES: has-unix-headers // UNSUPPORTED: c++03, c++11, c++14, c++17, c++20 // UNSUPPORTED: libcpp-hardening-mode=none -// XFAIL: availability-verbose_abort-missing +// XFAIL: libcpp-hardening-mode=debug && 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 index d2e1910b194623..f09515cf1142d1 100644 --- 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 @@ -7,7 +7,7 @@ // REQUIRES: has-unix-headers // UNSUPPORTED: c++03, c++11, c++14, c++17, c++20 // UNSUPPORTED: libcpp-hardening-mode=none -// XFAIL: availability-verbose_abort-missing +// XFAIL: libcpp-hardening-mode=debug && 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 index 44e6d48e9e1780..c473879d87b718 100644 --- a/libcxx/test/libcxx/containers/views/mdspan/extents/assert.obs.pass.cpp +++ b/libcxx/test/libcxx/containers/views/mdspan/extents/assert.obs.pass.cpp @@ -7,7 +7,7 @@ // REQUIRES: has-unix-headers // UNSUPPORTED: c++03, c++11, c++14, c++17, c++20 // UNSUPPORTED: libcpp-hardening-mode=none -// XFAIL: availability-verbose_abort-missing +// XFAIL: libcpp-hardening-mode=debug && 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 index 94d49f13e9b8a5..2cdfa2667cfd46 100644 --- 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 @@ -9,7 +9,7 @@ // REQUIRES: has-unix-headers // UNSUPPORTED: c++03, c++11, c++14, c++17, c++20 // UNSUPPORTED: libcpp-hardening-mode=none -// XFAIL: availability-verbose_abort-missing +// XFAIL: libcpp-hardening-mode=debug && 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 index e73a167a51be3d..6ac7411f1df014 100644 --- 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 @@ -9,7 +9,7 @@ // REQUIRES: has-unix-headers // UNSUPPORTED: c++03, c++11, c++14, c++17, c++20 // UNSUPPORTED: libcpp-hardening-mode=none -// XFAIL: availability-verbose_abort-missing +// XFAIL: libcpp-hardening-mode=debug && 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 index d11cf9c2362dde..ceb3242beb9c2a 100644 --- 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 @@ -9,7 +9,7 @@ // REQUIRES: has-unix-headers // UNSUPPORTED: c++03, c++11, c++14, c++17, c++20 // UNSUPPORTED: libcpp-hardening-mode=none -// XFAIL: availability-verbose_abort-missing +// XFAIL: libcpp-hardening-mode=debug && availability-verbose_abort-missing // diff --git a/libcxx/test/libcxx/containers/views/mdspan/layout_left/assert.ctor.layout_stride.pass.cpp b/libcxx/test/libcxx/containers/views/mdspan/layout_left/assert.ctor.layout_stride.pass.cpp index 60c08a86d20036..cc9358c853db41 100644 --- a/libcxx/test/libcxx/containers/views/mdspan/layout_left/assert.ctor.layout_stride.pass.cpp +++ b/libcxx/test/libcxx/containers/views/mdspan/layout_left/assert.ctor.layout_stride.pass.cpp @@ -9,7 +9,7 @@ // REQUIRES: has-unix-headers // UNSUPPORTED: c++03, c++11, c++14, c++17, c++20 // UNSUPPORTED: libcpp-hardening-mode=none -// XFAIL: availability-verbose_abort-missing +// XFAIL: libcpp-hardening-mode=debug && availability-verbose_abort-missing // ADDITIONAL_COMPILE_FLAGS: -Wno-ctad-maybe-unsupported // FIXME: https://github.com/llvm/llvm-project/issues/64719 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 index c514a532a1a0d3..79e424fbb52cbf 100644 --- 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 @@ -9,7 +9,7 @@ // REQUIRES: has-unix-headers // UNSUPPORTED: c++03, c++11, c++14, c++17, c++20 // REQUIRES: libcpp-hardening-mode={{extensive|debug}} -// XFAIL: availability-verbose_abort-missing +// XFAIL: libcpp-hardening-mode=debug && 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 index e54cf8678ea716..61a5149c6881a3 100644 --- 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 @@ -9,7 +9,7 @@ // REQUIRES: has-unix-headers // UNSUPPORTED: c++03, c++11, c++14, c++17, c++20 // UNSUPPORTED: libcpp-hardening-mode=none -// XFAIL: availability-verbose_abort-missing +// XFAIL: libcpp-hardening-mode=debug && 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 index f3ee1a63be3685..4695ea834692ec 100644 --- 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 @@ -9,7 +9,7 @@ // REQUIRES: has-unix-headers // UNSUPPORTED: c++03, c++11, c++14, c++17, c++20 // UNSUPPORTED: libcpp-hardening-mode=none -// XFAIL: availability-verbose_abort-missing +// XFAIL: libcpp-hardening-mode=debug && 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 index 824c0b0f5793bc..797a8e3845c2f7 100644 --- 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 @@ -9,7 +9,7 @@ // REQUIRES: has-unix-headers // UNSUPPORTED: c++03, c++11, c++14, c++17, c++20 // UNSUPPORTED: libcpp-hardening-mode=none -// XFAIL: availability-verbose_abort-missing +// XFAIL: libcpp-hardening-mode=debug && 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 index 29903595a2a7f0..e4044a94b7f68d 100644 --- 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 @@ -9,7 +9,7 @@ // REQUIRES: has-unix-headers // UNSUPPORTED: c++03, c++11, c++14, c++17, c++20 // UNSUPPORTED: libcpp-hardening-mode=none -// XFAIL: availability-verbose_abort-missing +// XFAIL: libcpp-hardening-mode=debug && availability-verbose_abort-missing // diff --git a/libcxx/test/libcxx/containers/views/mdspan/layout_right/assert.ctor.layout_stride.pass.cpp b/libcxx/test/libcxx/containers/views/mdspan/layout_right/assert.ctor.layout_stride.pass.cpp index a14459823ff6a2..18d974333a5800 100644 --- a/libcxx/test/libcxx/containers/views/mdspan/layout_right/assert.ctor.layout_stride.pass.cpp +++ b/libcxx/test/libcxx/containers/views/mdspan/layout_right/assert.ctor.layout_stride.pass.cpp @@ -9,7 +9,7 @@ // REQUIRES: has-unix-headers // UNSUPPORTED: c++03, c++11, c++14, c++17, c++20 // UNSUPPORTED: libcpp-hardening-mode=none -// XFAIL: availability-verbose_abort-missing +// XFAIL: libcpp-hardening-mode=debug && availability-verbose_abort-missing // ADDITIONAL_COMPILE_FLAGS: -Wno-ctad-maybe-unsupported // FIXME: https://github.com/llvm/llvm-project/issues/64719 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 index 756234f157f2c5..7fae6f87caf7ce 100644 --- 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 @@ -9,7 +9,7 @@ // REQUIRES: has-unix-headers // UNSUPPORTED: c++03, c++11, c++14, c++17, c++20 // REQUIRES: libcpp-hardening-mode={{extensive|debug}} -// XFAIL: availability-verbose_abort-missing +// XFAIL: libcpp-hardening-mode=debug && 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 index 9cc5ad72f9349c..8e3049c4736f0a 100644 --- 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 @@ -9,7 +9,7 @@ // REQUIRES: has-unix-headers // UNSUPPORTED: c++03, c++11, c++14, c++17, c++20 // UNSUPPORTED: libcpp-hardening-mode=none -// XFAIL: availability-verbose_abort-missing +// XFAIL: libcpp-hardening-mode=debug && availability-verbose_abort-missing // diff --git a/libcxx/test/libcxx/containers/views/mdspan/layout_stride/assert.conversion.pass.cpp b/libcxx/test/libcxx/containers/views/mdspan/layout_stride/assert.conversion.pass.cpp index c6d3e4fe97f615..81f6321ef519cd 100644 --- a/libcxx/test/libcxx/containers/views/mdspan/layout_stride/assert.conversion.pass.cpp +++ b/libcxx/test/libcxx/containers/views/mdspan/layout_stride/assert.conversion.pass.cpp @@ -9,7 +9,7 @@ // REQUIRES: has-unix-headers // UNSUPPORTED: c++03, c++11, c++14, c++17, c++20 // UNSUPPORTED: libcpp-hardening-mode=none -// XFAIL: availability-verbose_abort-missing +// XFAIL: libcpp-hardening-mode=debug && availability-verbose_abort-missing // XFAIL: target=powerpc{{.*}}le-unknown-linux-gnu // diff --git a/libcxx/test/libcxx/containers/views/mdspan/layout_stride/assert.ctor.extents_array.non_unique.pass.cpp b/libcxx/test/libcxx/containers/views/mdspan/layout_stride/assert.ctor.extents_array.non_unique.pass.cpp index 34b333ec3d1451..97a6d56e4f8397 100644 --- a/libcxx/test/libcxx/containers/views/mdspan/layout_stride/assert.ctor.extents_array.non_unique.pass.cpp +++ b/libcxx/test/libcxx/containers/views/mdspan/layout_stride/assert.ctor.extents_array.non_unique.pass.cpp @@ -9,7 +9,7 @@ // REQUIRES: has-unix-headers // UNSUPPORTED: c++03, c++11, c++14, c++17, c++20 // UNSUPPORTED: !libcpp-hardening-mode=debug -// XFAIL: availability-verbose_abort-missing +// XFAIL: libcpp-hardening-mode=debug && availability-verbose_abort-missing // diff --git a/libcxx/test/libcxx/containers/views/mdspan/layout_stride/assert.ctor.extents_array.pass.cpp b/libcxx/test/libcxx/containers/views/mdspan/layout_stride/assert.ctor.extents_array.pass.cpp index eab1c67ed69793..31b38bd8079cef 100644 --- a/libcxx/test/libcxx/containers/views/mdspan/layout_stride/assert.ctor.extents_array.pass.cpp +++ b/libcxx/test/libcxx/containers/views/mdspan/layout_stride/assert.ctor.extents_array.pass.cpp @@ -9,7 +9,7 @@ // REQUIRES: has-unix-headers // UNSUPPORTED: c++03, c++11, c++14, c++17, c++20 // UNSUPPORTED: libcpp-hardening-mode=none -// XFAIL: availability-verbose_abort-missing +// XFAIL: libcpp-hardening-mode=debug && availability-verbose_abort-missing // diff --git a/libcxx/test/libcxx/containers/views/mdspan/layout_stride/assert.ctor.extents_span.non_unique.pass.cpp b/libcxx/test/libcxx/containers/views/mdspan/layout_stride/assert.ctor.extents_span.non_unique.pass.cpp index 9e1de537682d8d..fd0701e9ee3a7a 100644 --- a/libcxx/test/libcxx/containers/views/mdspan/layout_stride/assert.ctor.extents_span.non_unique.pass.cpp +++ b/libcxx/test/libcxx/containers/views/mdspan/layout_stride/assert.ctor.extents_span.non_unique.pass.cpp @@ -9,7 +9,7 @@ // REQUIRES: has-unix-headers // UNSUPPORTED: c++03, c++11, c++14, c++17, c++20 // UNSUPPORTED: !libcpp-hardening-mode=debug -// XFAIL: availability-verbose_abort-missing +// XFAIL: libcpp-hardening-mode=debug && availability-verbose_abort-missing // diff --git a/libcxx/test/libcxx/containers/views/mdspan/layout_stride/assert.ctor.extents_span.pass.cpp b/libcxx/test/libcxx/containers/views/mdspan/layout_stride/assert.ctor.extents_span.pass.cpp index 3b7338449a7f6d..4cd0d8ff896ab6 100644 --- a/libcxx/test/libcxx/containers/views/mdspan/layout_stride/assert.ctor.extents_span.pass.cpp +++ b/libcxx/test/libcxx/containers/views/mdspan/layout_stride/assert.ctor.extents_span.pass.cpp @@ -9,7 +9,7 @@ // REQUIRES: has-unix-headers // UNSUPPORTED: c++03, c++11, c++14, c++17, c++20 // UNSUPPORTED: libcpp-hardening-mode=none -// XFAIL: availability-verbose_abort-missing +// XFAIL: libcpp-hardening-mode=debug && availability-verbose_abort-missing // diff --git a/libcxx/test/libcxx/containers/views/mdspan/layout_stride/assert.index_operator.pass.cpp b/libcxx/test/libcxx/containers/views/mdspan/layout_stride/assert.index_operator.pass.cpp index f507b14ca45ebf..b5244a60af0f70 100644 --- a/libcxx/test/libcxx/containers/views/mdspan/layout_stride/assert.index_operator.pass.cpp +++ b/libcxx/test/libcxx/containers/views/mdspan/layout_stride/assert.index_operator.pass.cpp @@ -9,7 +9,7 @@ // REQUIRES: has-unix-headers // UNSUPPORTED: c++03, c++11, c++14, c++17, c++20 // UNSUPPORTED: !libcpp-hardening-mode=debug -// XFAIL: availability-verbose_abort-missing +// XFAIL: libcpp-hardening-mode=debug && availability-verbose_abort-missing // diff --git a/libcxx/test/libcxx/containers/views/mdspan/layout_stride/assert.stride.pass.cpp b/libcxx/test/libcxx/containers/views/mdspan/layout_stride/assert.stride.pass.cpp index 5ae141389da4ec..ee2b731da203b2 100644 --- a/libcxx/test/libcxx/containers/views/mdspan/layout_stride/assert.stride.pass.cpp +++ b/libcxx/test/libcxx/containers/views/mdspan/layout_stride/assert.stride.pass.cpp @@ -9,7 +9,7 @@ // REQUIRES: has-unix-headers // UNSUPPORTED: c++03, c++11, c++14, c++17, c++20 // UNSUPPORTED: libcpp-hardening-mode=none -// XFAIL: availability-verbose_abort-missing +// XFAIL: libcpp-hardening-mode=debug && 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 index 860bf19af45ca2..53aec7bb714ea7 100644 --- a/libcxx/test/libcxx/containers/views/mdspan/mdspan/assert.conversion.pass.cpp +++ b/libcxx/test/libcxx/containers/views/mdspan/mdspan/assert.conversion.pass.cpp @@ -7,7 +7,7 @@ // REQUIRES: has-unix-headers // UNSUPPORTED: c++03, c++11, c++14, c++17, c++20 // UNSUPPORTED: libcpp-hardening-mode=none -// XFAIL: availability-verbose_abort-missing +// XFAIL: libcpp-hardening-mode=debug && 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 index 174bddb56d53c8..9dd957986f14d2 100644 --- 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 @@ -9,7 +9,7 @@ // REQUIRES: has-unix-headers // UNSUPPORTED: c++03, c++11, c++14, c++17, c++20 // UNSUPPORTED: libcpp-hardening-mode=none -// XFAIL: availability-verbose_abort-missing +// XFAIL: libcpp-hardening-mode=debug && 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 index ee3114e228a0d8..5682de61fbb329 100644 --- a/libcxx/test/libcxx/containers/views/mdspan/mdspan/assert.size.pass.cpp +++ b/libcxx/test/libcxx/containers/views/mdspan/mdspan/assert.size.pass.cpp @@ -7,7 +7,7 @@ // REQUIRES: has-unix-headers // UNSUPPORTED: c++03, c++11, c++14, c++17, c++20 // REQUIRES: libcpp-hardening-mode={{extensive|debug}} -// XFAIL: availability-verbose_abort-missing +// XFAIL: libcpp-hardening-mode=debug && 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 index c268ae51e79ac7..fa2a98e33b8f0e 100644 --- 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 @@ -20,7 +20,7 @@ // REQUIRES: has-unix-headers // UNSUPPORTED: libcpp-hardening-mode=none -// XFAIL: availability-verbose_abort-missing +// XFAIL: libcpp-hardening-mode=debug && availability-verbose_abort-missing #include #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 index 3c800e9f2fdf9e..4461bad8ff5047 100644 --- 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 @@ -17,7 +17,7 @@ // REQUIRES: has-unix-headers // UNSUPPORTED: libcpp-hardening-mode=none -// XFAIL: availability-verbose_abort-missing +// XFAIL: libcpp-hardening-mode=debug && availability-verbose_abort-missing #include #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 index f1b7d2183625b5..c288c2acd6b59f 100644 --- 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 @@ -15,7 +15,7 @@ // REQUIRES: has-unix-headers // UNSUPPORTED: libcpp-hardening-mode=none -// XFAIL: availability-verbose_abort-missing +// XFAIL: libcpp-hardening-mode=debug && availability-verbose_abort-missing #include #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 index 18ed7ce213b90a..1f9af3e03009ab 100644 --- 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 @@ -15,7 +15,7 @@ // REQUIRES: has-unix-headers // UNSUPPORTED: libcpp-hardening-mode=none -// XFAIL: availability-verbose_abort-missing +// XFAIL: libcpp-hardening-mode=debug && availability-verbose_abort-missing #include #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 index d15b024149775e..ea98fe81ee2f8a 100644 --- 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 @@ -15,7 +15,7 @@ // REQUIRES: has-unix-headers // UNSUPPORTED: libcpp-hardening-mode=none -// XFAIL: availability-verbose_abort-missing +// XFAIL: libcpp-hardening-mode=debug && availability-verbose_abort-missing #include #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 index 588123af6499b0..2660ca1f90c141 100644 --- 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 @@ -15,7 +15,7 @@ // REQUIRES: has-unix-headers // UNSUPPORTED: libcpp-hardening-mode=none -// XFAIL: availability-verbose_abort-missing +// XFAIL: libcpp-hardening-mode=debug && availability-verbose_abort-missing #include #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 index 8a74739c79ddfb..e7d79588441818 100644 --- 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 @@ -15,7 +15,7 @@ // REQUIRES: has-unix-headers // UNSUPPORTED: libcpp-hardening-mode=none -// XFAIL: availability-verbose_abort-missing +// XFAIL: libcpp-hardening-mode=debug && availability-verbose_abort-missing #include #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 index 01d5658291f1d9..eb6b442d648499 100644 --- 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 @@ -15,7 +15,7 @@ // REQUIRES: has-unix-headers // UNSUPPORTED: libcpp-hardening-mode=none -// XFAIL: availability-verbose_abort-missing +// XFAIL: libcpp-hardening-mode=debug && availability-verbose_abort-missing #include #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 index 4e6587443c6a78..141735db02a602 100644 --- 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 @@ -15,7 +15,7 @@ // REQUIRES: has-unix-headers // UNSUPPORTED: libcpp-hardening-mode=none -// XFAIL: availability-verbose_abort-missing +// XFAIL: libcpp-hardening-mode=debug && availability-verbose_abort-missing #include #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 index 52e4fe9ecc5c70..7ed228e96a4837 100644 --- 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 @@ -23,7 +23,7 @@ // REQUIRES: has-unix-headers // UNSUPPORTED: libcpp-hardening-mode=none -// XFAIL: availability-verbose_abort-missing +// XFAIL: libcpp-hardening-mode=debug && availability-verbose_abort-missing #include #include 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 index 6c138752b50542..38047957de8e5e 100644 --- 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 @@ -9,7 +9,7 @@ // REQUIRES: has-unix-headers // UNSUPPORTED: c++03 // UNSUPPORTED: !libcpp-hardening-mode=debug -// XFAIL: availability-verbose_abort-missing +// XFAIL: libcpp-hardening-mode=debug && availability-verbose_abort-missing // diff --git a/libcxx/test/libcxx/iterators/assert.advance.pass.cpp b/libcxx/test/libcxx/iterators/assert.advance.pass.cpp index b7e6962b443efb..e9d2f27008260a 100644 --- a/libcxx/test/libcxx/iterators/assert.advance.pass.cpp +++ b/libcxx/test/libcxx/iterators/assert.advance.pass.cpp @@ -9,7 +9,7 @@ // REQUIRES: has-unix-headers // UNSUPPORTED: c++03 // REQUIRES: libcpp-hardening-mode={{extensive|debug}} -// XFAIL: availability-verbose_abort-missing +// XFAIL: libcpp-hardening-mode=debug && availability-verbose_abort-missing // diff --git a/libcxx/test/libcxx/iterators/assert.next.pass.cpp b/libcxx/test/libcxx/iterators/assert.next.pass.cpp index da4f4ea3150c39..242a0c6f0f7ce4 100644 --- a/libcxx/test/libcxx/iterators/assert.next.pass.cpp +++ b/libcxx/test/libcxx/iterators/assert.next.pass.cpp @@ -9,7 +9,7 @@ // REQUIRES: has-unix-headers // UNSUPPORTED: c++03 // REQUIRES: libcpp-hardening-mode={{extensive|debug}} -// XFAIL: availability-verbose_abort-missing +// XFAIL: libcpp-hardening-mode=debug && availability-verbose_abort-missing // diff --git a/libcxx/test/libcxx/iterators/assert.prev.pass.cpp b/libcxx/test/libcxx/iterators/assert.prev.pass.cpp index 6a71cad9ef0489..a5a04f1bbeb6be 100644 --- a/libcxx/test/libcxx/iterators/assert.prev.pass.cpp +++ b/libcxx/test/libcxx/iterators/assert.prev.pass.cpp @@ -9,7 +9,7 @@ // REQUIRES: has-unix-headers // UNSUPPORTED: c++03 // REQUIRES: libcpp-hardening-mode={{extensive|debug}} -// XFAIL: availability-verbose_abort-missing +// XFAIL: libcpp-hardening-mode=debug && 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 index 095e8a8fef6ef6..8eee4ad2f319a2 100644 --- a/libcxx/test/libcxx/iterators/bounded_iter/dereference.pass.cpp +++ b/libcxx/test/libcxx/iterators/bounded_iter/dereference.pass.cpp @@ -14,7 +14,7 @@ // REQUIRES: has-unix-headers // UNSUPPORTED: c++03 // UNSUPPORTED: libcpp-hardening-mode=none -// XFAIL: availability-verbose_abort-missing +// XFAIL: libcpp-hardening-mode=debug && availability-verbose_abort-missing #include diff --git a/libcxx/test/libcxx/iterators/predef.iterators/counted.iterator/assert.pass.cpp b/libcxx/test/libcxx/iterators/predef.iterators/counted.iterator/assert.pass.cpp index f803b2cad75be9..2fafe4727185da 100644 --- a/libcxx/test/libcxx/iterators/predef.iterators/counted.iterator/assert.pass.cpp +++ b/libcxx/test/libcxx/iterators/predef.iterators/counted.iterator/assert.pass.cpp @@ -9,7 +9,7 @@ // REQUIRES: has-unix-headers // UNSUPPORTED: c++03, c++11, c++14, c++17 // UNSUPPORTED: libcpp-hardening-mode=none -// XFAIL: availability-verbose_abort-missing +// XFAIL: libcpp-hardening-mode=debug && availability-verbose_abort-missing #include diff --git a/libcxx/test/libcxx/iterators/predef.iterators/iterators.common/assert.pass.cpp b/libcxx/test/libcxx/iterators/predef.iterators/iterators.common/assert.pass.cpp index ea4574fc1a9ccf..01c0fb40483207 100644 --- a/libcxx/test/libcxx/iterators/predef.iterators/iterators.common/assert.pass.cpp +++ b/libcxx/test/libcxx/iterators/predef.iterators/iterators.common/assert.pass.cpp @@ -9,7 +9,7 @@ // REQUIRES: has-unix-headers // UNSUPPORTED: c++03, c++11, c++14, c++17 // UNSUPPORTED: libcpp-hardening-mode=none -// XFAIL: availability-verbose_abort-missing +// XFAIL: libcpp-hardening-mode=debug && availability-verbose_abort-missing #include diff --git a/libcxx/test/libcxx/ranges/range.adaptors/range.chunk.by/assert.begin.pass.cpp b/libcxx/test/libcxx/ranges/range.adaptors/range.chunk.by/assert.begin.pass.cpp index 0ba4745be08267..57af3663170916 100644 --- a/libcxx/test/libcxx/ranges/range.adaptors/range.chunk.by/assert.begin.pass.cpp +++ b/libcxx/test/libcxx/ranges/range.adaptors/range.chunk.by/assert.begin.pass.cpp @@ -10,7 +10,7 @@ // UNSUPPORTED: c++03, c++11, c++14, c++17, c++20 // UNSUPPORTED: no-exceptions // UNSUPPORTED: !libcpp-hardening-mode=debug -// XFAIL: availability-verbose_abort-missing +// XFAIL: libcpp-hardening-mode=debug && availability-verbose_abort-missing // diff --git a/libcxx/test/libcxx/ranges/range.adaptors/range.chunk.by/assert.find-next.pass.cpp b/libcxx/test/libcxx/ranges/range.adaptors/range.chunk.by/assert.find-next.pass.cpp index 9e5536bf51be2b..1c91ee71989529 100644 --- a/libcxx/test/libcxx/ranges/range.adaptors/range.chunk.by/assert.find-next.pass.cpp +++ b/libcxx/test/libcxx/ranges/range.adaptors/range.chunk.by/assert.find-next.pass.cpp @@ -10,7 +10,7 @@ // UNSUPPORTED: c++03, c++11, c++14, c++17, c++20 // UNSUPPORTED: no-exceptions // UNSUPPORTED: !libcpp-hardening-mode=debug -// XFAIL: availability-verbose_abort-missing +// XFAIL: libcpp-hardening-mode=debug && availability-verbose_abort-missing // diff --git a/libcxx/test/libcxx/ranges/range.adaptors/range.chunk.by/assert.find-prev.pass.cpp b/libcxx/test/libcxx/ranges/range.adaptors/range.chunk.by/assert.find-prev.pass.cpp index 4f746cfec2f1a4..2605bf6dde0743 100644 --- a/libcxx/test/libcxx/ranges/range.adaptors/range.chunk.by/assert.find-prev.pass.cpp +++ b/libcxx/test/libcxx/ranges/range.adaptors/range.chunk.by/assert.find-prev.pass.cpp @@ -10,7 +10,7 @@ // UNSUPPORTED: c++03, c++11, c++14, c++17, c++20 // UNSUPPORTED: no-exceptions // UNSUPPORTED: !libcpp-hardening-mode=debug -// XFAIL: availability-verbose_abort-missing +// XFAIL: libcpp-hardening-mode=debug && availability-verbose_abort-missing // diff --git a/libcxx/test/libcxx/ranges/range.adaptors/range.chunk.by/range.chunk.by.iter/assert.deref.pass.cpp b/libcxx/test/libcxx/ranges/range.adaptors/range.chunk.by/range.chunk.by.iter/assert.deref.pass.cpp index 80c08efc56c05e..8ed84ca8b56a16 100644 --- a/libcxx/test/libcxx/ranges/range.adaptors/range.chunk.by/range.chunk.by.iter/assert.deref.pass.cpp +++ b/libcxx/test/libcxx/ranges/range.adaptors/range.chunk.by/range.chunk.by.iter/assert.deref.pass.cpp @@ -9,7 +9,7 @@ // REQUIRES: has-unix-headers // UNSUPPORTED: c++03, c++11, c++14, c++17, c++20 // UNSUPPORTED: !libcpp-hardening-mode=debug -// XFAIL: availability-verbose_abort-missing +// XFAIL: libcpp-hardening-mode=debug && availability-verbose_abort-missing // diff --git a/libcxx/test/libcxx/ranges/range.adaptors/range.chunk.by/range.chunk.by.iter/assert.increment.pass.cpp b/libcxx/test/libcxx/ranges/range.adaptors/range.chunk.by/range.chunk.by.iter/assert.increment.pass.cpp index 7381ad28862939..1a804b71b5e5e5 100644 --- a/libcxx/test/libcxx/ranges/range.adaptors/range.chunk.by/range.chunk.by.iter/assert.increment.pass.cpp +++ b/libcxx/test/libcxx/ranges/range.adaptors/range.chunk.by/range.chunk.by.iter/assert.increment.pass.cpp @@ -9,7 +9,7 @@ // REQUIRES: has-unix-headers // UNSUPPORTED: c++03, c++11, c++14, c++17, c++20 // UNSUPPORTED: !libcpp-hardening-mode=debug -// XFAIL: availability-verbose_abort-missing +// XFAIL: libcpp-hardening-mode=debug && availability-verbose_abort-missing // 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 index a2b11fb54ed9da..205cf40746207e 100644 --- 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 @@ -14,7 +14,7 @@ // UNSUPPORTED: c++03, c++11, c++14, c++17 // UNSUPPORTED: no-exceptions // REQUIRES: libcpp-hardening-mode={{extensive|debug}} -// XFAIL: availability-verbose_abort-missing +// XFAIL: libcpp-hardening-mode=debug && 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 index 86ee2841f249e9..22ede4143ffa47 100644 --- 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 @@ -9,7 +9,7 @@ // REQUIRES: has-unix-headers // UNSUPPORTED: c++03, c++11, c++14, c++17 // REQUIRES: libcpp-hardening-mode={{extensive|debug}} -// XFAIL: availability-verbose_abort-missing +// XFAIL: libcpp-hardening-mode=debug && 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 index d4a3bbc513c49a..b6cbf5241f744d 100644 --- 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 @@ -9,7 +9,7 @@ // REQUIRES: has-unix-headers // UNSUPPORTED: c++03, c++11, c++14, c++17 // REQUIRES: libcpp-hardening-mode={{extensive|debug}} -// XFAIL: availability-verbose_abort-missing +// XFAIL: libcpp-hardening-mode=debug && 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 index 42beb28c47b136..36a485a1e4d00e 100644 --- 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 @@ -13,7 +13,7 @@ // REQUIRES: has-unix-headers // UNSUPPORTED: c++03 // UNSUPPORTED: libcpp-hardening-mode=none -// XFAIL: availability-verbose_abort-missing +// XFAIL: libcpp-hardening-mode=debug && 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 index 7a3d3e1661636a..d810acd67e7e70 100644 --- 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 @@ -13,7 +13,7 @@ // REQUIRES: has-unix-headers // UNSUPPORTED: c++03 // UNSUPPORTED: libcpp-hardening-mode=none -// XFAIL: availability-verbose_abort-missing +// XFAIL: libcpp-hardening-mode=debug && 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 index 66432dc099b5ff..12e7ef3328b04b 100644 --- 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 @@ -13,7 +13,7 @@ // REQUIRES: has-unix-headers // UNSUPPORTED: c++03 // UNSUPPORTED: libcpp-hardening-mode=none -// XFAIL: availability-verbose_abort-missing +// XFAIL: libcpp-hardening-mode=debug && 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 index 41bb48b6f574c8..3983352712963f 100644 --- 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 @@ -13,7 +13,7 @@ // REQUIRES: has-unix-headers // UNSUPPORTED: c++03 // UNSUPPORTED: libcpp-hardening-mode=none -// XFAIL: availability-verbose_abort-missing +// XFAIL: libcpp-hardening-mode=debug && availability-verbose_abort-missing #include #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 index 1033e17961b242..24df3fcad0c5ce 100644 --- 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 @@ -13,7 +13,7 @@ // REQUIRES: has-unix-headers // UNSUPPORTED: c++03 // UNSUPPORTED: libcpp-hardening-mode=none -// XFAIL: availability-verbose_abort-missing +// XFAIL: libcpp-hardening-mode=debug && availability-verbose_abort-missing #include #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 index 776bba32da184d..d26997d8d24c29 100644 --- 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 @@ -13,7 +13,7 @@ // REQUIRES: has-unix-headers // UNSUPPORTED: c++03 // UNSUPPORTED: libcpp-hardening-mode=none -// XFAIL: availability-verbose_abort-missing +// XFAIL: libcpp-hardening-mode=debug && availability-verbose_abort-missing #include #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 index 0b4cb9db51c94c..036e75965c4882 100644 --- 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 @@ -13,7 +13,7 @@ // REQUIRES: has-unix-headers // UNSUPPORTED: c++03 // UNSUPPORTED: libcpp-hardening-mode=none -// XFAIL: availability-verbose_abort-missing +// XFAIL: libcpp-hardening-mode=debug && 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 index 2bab67bdc3edc5..54c011c4d54a0d 100644 --- 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 @@ -13,7 +13,7 @@ // REQUIRES: has-unix-headers // UNSUPPORTED: c++03 // UNSUPPORTED: libcpp-hardening-mode=none -// XFAIL: availability-verbose_abort-missing +// XFAIL: libcpp-hardening-mode=debug && 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 index addcae5ec1863e..af8b393f9e0a74 100644 --- 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 // REQUIRES: libcpp-hardening-mode={{extensive|debug}} -// XFAIL: availability-verbose_abort-missing +// XFAIL: libcpp-hardening-mode=debug && availability-verbose_abort-missing // Construct a string_view from an invalid length // constexpr basic_string_view( const _CharT* s, size_type len ) 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 index b38e0585d03120..1810ec1ca8ac90 100644 --- a/libcxx/test/libcxx/strings/string.view/assert.ctor.pointer.pass.cpp +++ b/libcxx/test/libcxx/strings/string.view/assert.ctor.pointer.pass.cpp @@ -9,7 +9,7 @@ // REQUIRES: has-unix-headers // UNSUPPORTED: c++03, c++11, c++14 // REQUIRES: libcpp-hardening-mode={{extensive|debug}} -// XFAIL: availability-verbose_abort-missing +// XFAIL: libcpp-hardening-mode=debug && availability-verbose_abort-missing // Construct a string_view from a null pointer // constexpr basic_string_view( const CharT* s ); 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 index fe7b3616b5a764..6d5eb5ef9931f5 100644 --- 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 @@ -9,7 +9,7 @@ // REQUIRES: has-unix-headers // UNSUPPORTED: c++03, no-threads // REQUIRES: libcpp-hardening-mode={{extensive|debug}} -// XFAIL: availability-verbose_abort-missing +// XFAIL: libcpp-hardening-mode=debug && 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 index f28db8caba9497..1bffde5e3ebd1f 100644 --- 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 @@ -9,7 +9,7 @@ // REQUIRES: has-unix-headers // UNSUPPORTED: c++03, no-threads // REQUIRES: libcpp-hardening-mode={{extensive|debug}} -// XFAIL: availability-verbose_abort-missing +// XFAIL: libcpp-hardening-mode=debug && 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 index 58bc4b844eb59d..419a603a037f80 100644 --- a/libcxx/test/libcxx/thread/thread.barrier/assert.arrive.pass.cpp +++ b/libcxx/test/libcxx/thread/thread.barrier/assert.arrive.pass.cpp @@ -9,7 +9,7 @@ // UNSUPPORTED: c++03, c++11, c++14, c++17 // REQUIRES: libcpp-hardening-mode={{extensive|debug}} -// XFAIL: availability-verbose_abort-missing +// XFAIL: libcpp-hardening-mode=debug && availability-verbose_abort-missing // REQUIRES: has-unix-headers diff --git a/libcxx/test/libcxx/thread/thread.barrier/assert.ctor.pass.cpp b/libcxx/test/libcxx/thread/thread.barrier/assert.ctor.pass.cpp index 3af43bdbe7b139..0b4fb1d675eaa7 100644 --- a/libcxx/test/libcxx/thread/thread.barrier/assert.ctor.pass.cpp +++ b/libcxx/test/libcxx/thread/thread.barrier/assert.ctor.pass.cpp @@ -9,7 +9,7 @@ // UNSUPPORTED: c++03, c++11, c++14, c++17 // REQUIRES: libcpp-hardening-mode={{extensive|debug}} -// XFAIL: availability-verbose_abort-missing +// XFAIL: libcpp-hardening-mode=debug && availability-verbose_abort-missing // REQUIRES: has-unix-headers 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 index 442ae0d962631a..e61679554a62e1 100644 --- 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 @@ -18,7 +18,7 @@ // REQUIRES: has-unix-headers // REQUIRES: libcpp-hardening-mode={{extensive|debug}} -// XFAIL: availability-verbose_abort-missing +// XFAIL: libcpp-hardening-mode=debug && 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 index 1547dd6390d6cb..6220cba02af195 100644 --- a/libcxx/test/libcxx/thread/thread.latch/assert.count_down.pass.cpp +++ b/libcxx/test/libcxx/thread/thread.latch/assert.count_down.pass.cpp @@ -19,7 +19,7 @@ // REQUIRES: has-unix-headers // REQUIRES: libcpp-hardening-mode={{extensive|debug}} -// XFAIL: availability-verbose_abort-missing +// XFAIL: libcpp-hardening-mode=debug && 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 index b20911e0c3b9f0..5f1ea19d82a503 100644 --- a/libcxx/test/libcxx/thread/thread.latch/assert.ctor.pass.cpp +++ b/libcxx/test/libcxx/thread/thread.latch/assert.ctor.pass.cpp @@ -18,7 +18,7 @@ // REQUIRES: has-unix-headers // REQUIRES: libcpp-hardening-mode={{extensive|debug}} -// XFAIL: availability-verbose_abort-missing +// XFAIL: libcpp-hardening-mode=debug && 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 index 91b1e354290888..1e33add7794968 100644 --- a/libcxx/test/libcxx/thread/thread.semaphore/assert.ctor.pass.cpp +++ b/libcxx/test/libcxx/thread/thread.semaphore/assert.ctor.pass.cpp @@ -9,7 +9,7 @@ // UNSUPPORTED: c++03, c++11, c++14, c++17 // REQUIRES: libcpp-hardening-mode={{extensive|debug}} -// XFAIL: availability-verbose_abort-missing +// XFAIL: libcpp-hardening-mode=debug && availability-verbose_abort-missing // REQUIRES: has-unix-headers diff --git a/libcxx/test/libcxx/thread/thread.semaphore/assert.release.pass.cpp b/libcxx/test/libcxx/thread/thread.semaphore/assert.release.pass.cpp index 09b4de36653597..a5a01a38478784 100644 --- a/libcxx/test/libcxx/thread/thread.semaphore/assert.release.pass.cpp +++ b/libcxx/test/libcxx/thread/thread.semaphore/assert.release.pass.cpp @@ -9,7 +9,7 @@ // UNSUPPORTED: c++03, c++11, c++14, c++17 // REQUIRES: libcpp-hardening-mode={{extensive|debug}} -// XFAIL: availability-verbose_abort-missing +// XFAIL: libcpp-hardening-mode=debug && availability-verbose_abort-missing // REQUIRES: has-unix-headers 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 index cf6b7bef3ebcec..c6ddb8bd252a40 100644 --- a/libcxx/test/libcxx/utilities/assert.exception_guard.no_exceptions.pass.cpp +++ b/libcxx/test/libcxx/utilities/assert.exception_guard.no_exceptions.pass.cpp @@ -9,7 +9,7 @@ // REQUIRES: has-unix-headers // UNSUPPORTED: c++03 // REQUIRES: libcpp-hardening-mode=debug -// XFAIL: availability-verbose_abort-missing +// XFAIL: libcpp-hardening-mode=debug && availability-verbose_abort-missing // ADDITIONAL_COMPILE_FLAGS: -fno-exceptions #include <__utility/exception_guard.h> 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 index 27dcdfe951230a..47481bcbef8a8a 100644 --- a/libcxx/test/libcxx/utilities/expected/expected.expected/assert.arrow.pass.cpp +++ b/libcxx/test/libcxx/utilities/expected/expected.expected/assert.arrow.pass.cpp @@ -9,7 +9,7 @@ // REQUIRES: has-unix-headers // UNSUPPORTED: c++03, c++11, c++14, c++17, c++20 // UNSUPPORTED: libcpp-hardening-mode=none -// XFAIL: availability-verbose_abort-missing +// XFAIL: libcpp-hardening-mode=debug && availability-verbose_abort-missing // constexpr const T* operator->() const noexcept; // constexpr T* operator->() 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 index 01078ac27e96a9..5ab43d38ccb15b 100644 --- a/libcxx/test/libcxx/utilities/expected/expected.expected/assert.deref.pass.cpp +++ b/libcxx/test/libcxx/utilities/expected/expected.expected/assert.deref.pass.cpp @@ -9,7 +9,7 @@ // REQUIRES: has-unix-headers // UNSUPPORTED: c++03, c++11, c++14, c++17, c++20 // UNSUPPORTED: libcpp-hardening-mode=none -// XFAIL: availability-verbose_abort-missing +// XFAIL: libcpp-hardening-mode=debug && availability-verbose_abort-missing // constexpr const T& operator*() const & noexcept; // constexpr T& operator*() & 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 index ff574b350cc9e1..92bf305994c183 100644 --- a/libcxx/test/libcxx/utilities/expected/expected.expected/assert.error.pass.cpp +++ b/libcxx/test/libcxx/utilities/expected/expected.expected/assert.error.pass.cpp @@ -9,7 +9,7 @@ // REQUIRES: has-unix-headers // UNSUPPORTED: c++03, c++11, c++14, c++17, c++20 // UNSUPPORTED: libcpp-hardening-mode=none -// XFAIL: availability-verbose_abort-missing +// XFAIL: libcpp-hardening-mode=debug && availability-verbose_abort-missing // constexpr const E& error() const & noexcept; // constexpr E& error() & 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 index e5d7ac3eae6988..6f1ba075b3245f 100644 --- a/libcxx/test/libcxx/utilities/expected/expected.void/assert.deref.pass.cpp +++ b/libcxx/test/libcxx/utilities/expected/expected.void/assert.deref.pass.cpp @@ -9,7 +9,7 @@ // REQUIRES: has-unix-headers // UNSUPPORTED: c++03, c++11, c++14, c++17, c++20 // UNSUPPORTED: libcpp-hardening-mode=none -// XFAIL: availability-verbose_abort-missing +// XFAIL: libcpp-hardening-mode=debug && 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 index 7bf4844b29b017..a1c92ff85f33a2 100644 --- a/libcxx/test/libcxx/utilities/expected/expected.void/assert.error.pass.cpp +++ b/libcxx/test/libcxx/utilities/expected/expected.void/assert.error.pass.cpp @@ -9,7 +9,7 @@ // REQUIRES: has-unix-headers // UNSUPPORTED: c++03, c++11, c++14, c++17, c++20 // UNSUPPORTED: libcpp-hardening-mode=none -// XFAIL: availability-verbose_abort-missing +// XFAIL: libcpp-hardening-mode=debug && availability-verbose_abort-missing // constexpr const E& error() const & noexcept; // constexpr E& error() & 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 index 2ba5f299bc34e6..31938b3f8fbaa1 100644 --- 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 @@ -16,7 +16,7 @@ // REQUIRES: has-unix-headers // UNSUPPORTED: c++03, c++11, c++14 // UNSUPPORTED: libcpp-hardening-mode=none -// XFAIL: availability-verbose_abort-missing +// XFAIL: libcpp-hardening-mode=debug && 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 index f93569979d1886..52009628327db6 100644 --- 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 @@ -14,7 +14,7 @@ // REQUIRES: has-unix-headers // UNSUPPORTED: c++03, c++11, c++14 // UNSUPPORTED: libcpp-hardening-mode=none -// XFAIL: availability-verbose_abort-missing +// XFAIL: libcpp-hardening-mode=debug && availability-verbose_abort-missing #include diff --git a/libcxx/test/support/check_assertion.h b/libcxx/test/support/check_assertion.h index 83a46548fa9250..485f8103c7ad8d 100644 --- a/libcxx/test/support/check_assertion.h +++ b/libcxx/test/support/check_assertion.h @@ -15,7 +15,9 @@ #include #include #include +#include #include +#include #include #include #include @@ -27,118 +29,206 @@ #include "test_allocator.h" #if TEST_STD_VER < 11 -# error "C++11 or greater is required to use this header" +# error "C++11 or greater is required to use this header" #endif -struct AssertionInfoMatcher { - static const int any_line = -1; - static constexpr const char* any_file = "*"; - static constexpr const char* any_msg = "*"; +// When printing the assertion message to `stderr`, delimit it with a marker to make it easier to match the message +// later. +static constexpr const char* Marker = "###"; - constexpr AssertionInfoMatcher() : is_empty_(true), msg_(any_msg, __builtin_strlen(any_msg)), file_(any_file, __builtin_strlen(any_file)), line_(any_line) { } - constexpr AssertionInfoMatcher(const char* msg, const char* file = any_file, int line = any_line) - : is_empty_(false), msg_(msg, __builtin_strlen(msg)), file_(file, __builtin_strlen(file)), line_(line) {} +// (success, error-message-if-failed) +using MatchResult = std::pair; +using Matcher = std::function; - bool Matches(char const* file, int line, char const* message) const { - assert(!empty() && "empty matcher"); +MatchResult MatchAssertionMessage(const std::string& text, std::string_view expected_message) { + // Extract information from the error message. This has to stay synchronized with how we format assertions in the + // library. + std::regex assertion_format(".*###\\n(.*):(\\d+): assertion (.*) failed: (.*)\\n###"); - if (CheckLineMatches(line) && CheckFileMatches(file) && CheckMessageMatches(message)) - return true; - // Write to stdout because that's the file descriptor captured by the parent - // process. - std::printf("Failed to match assertion info!\n%s\nVS\n%s:%d (%s)\n", ToString().data(), file, line, message); - return false; + std::smatch match_result; + bool has_match = std::regex_match(text, match_result, assertion_format); + assert(has_match); + assert(match_result.size() == 5); + + const std::string& file = match_result[1]; + int line = std::stoi(match_result[2]); + // Omitting `expression` in `match_result[3]` + const std::string& assertion_message = match_result[4]; + + bool result = assertion_message == expected_message; + if (!result) { + std::stringstream matching_error; + matching_error // + << "Expected message: '" << expected_message.data() << "'\n" // + << "Actual message: '" << assertion_message.c_str() << "'\n" // + << "Source location: " << file << ":" << std::to_string(line) << "\n"; + return MatchResult(/*success=*/false, matching_error.str()); } - std::string ToString() const { - std::string result = "msg = \""; result += msg_; result += "\"\n"; - result += "line = " + (line_ == any_line ? "'*'" : std::to_string(line_)) + "\n"; - result += "file = " + (file_ == any_file ? "'*'" : std::string(file_)); - return result; + return MatchResult(/*success=*/true, /*maybe_error=*/""); +} + +Matcher MakeAssertionMessageMatcher(std::string_view assertion_message) { + return [=](const std::string& text) { // + return MatchAssertionMessage(text, assertion_message); + }; +} + +Matcher MakeAnyMatcher() { + return [](const std::string&) { // + return MatchResult(/*success=*/true, /*maybe_error=*/""); + }; +} + +enum class DeathCause { + // Valid causes + VerboseAbort = 1, + StdTerminate, + Trap, + // Invalid causes + DidNotDie, + SetupFailure, + Unknown +}; + +bool IsValidCause(DeathCause cause) { + switch (cause) { + case DeathCause::VerboseAbort: + case DeathCause::StdTerminate: + case DeathCause::Trap: + return true; + default: + return false; } +} - bool empty() const { return is_empty_; } -private: - bool CheckLineMatches(int got_line) const { - if (line_ == any_line) - return true; - return got_line == line_; +std::string ToString(DeathCause cause) { + switch (cause) { + case DeathCause::VerboseAbort: + return "verbose abort"; + case DeathCause::StdTerminate: + return "`std::terminate`"; + case DeathCause::Trap: + return "trap"; + case DeathCause::DidNotDie: + return ""; + case DeathCause::SetupFailure: + return ""; + case DeathCause::Unknown: + return ""; } - bool CheckFileMatches(std::string_view got_file) const { - assert(!empty() && "empty matcher"); - if (file_ == any_file) - return true; - std::size_t found_at = got_file.find(file_); - if (found_at == std::string_view::npos) - return false; - // require the match start at the beginning of the file or immediately after - // a directory separator. - if (found_at != 0) { - char last_char = got_file[found_at - 1]; - if (last_char != '/' && last_char != '\\') - return false; - } - // require the match goes until the end of the string. - return got_file.substr(found_at) == file_; + assert(false && "Unreachable"); +} + +TEST_NORETURN void StopChildProcess(DeathCause cause) { std::exit(static_cast(cause)); } + +DeathCause ConvertToDeathCause(int val) { + if (val < static_cast(DeathCause::VerboseAbort) || val > static_cast(DeathCause::Unknown)) { + return DeathCause::Unknown; } + return static_cast(val); +} + +enum class Outcome { + Success, + UnexpectedCause, + UnexpectedErrorMessage, + InvalidCause, +}; - bool CheckMessageMatches(std::string_view got_msg) const { - assert(!empty() && "empty matcher"); - if (msg_ == any_msg) - return true; - std::size_t found_at = got_msg.find(msg_); - if (found_at == std::string_view::npos) - return false; - return found_at == 0 && got_msg.size() == msg_.size(); +std::string ToString(Outcome outcome) { + switch (outcome) { + case Outcome::Success: + return "success"; + case Outcome::UnexpectedCause: + return "unexpected death cause"; + case Outcome::UnexpectedErrorMessage: + return "unexpected error message"; + case Outcome::InvalidCause: + return "invalid death cause"; } + + assert(false && "Unreachable"); +} + +class DeathTestResult { +public: + DeathTestResult() = default; + DeathTestResult(Outcome set_outcome, DeathCause set_cause, const std::string& set_failure_description = "") + : outcome_(set_outcome), cause_(set_cause), failure_description_(set_failure_description) {} + + bool success() const { return outcome() == Outcome::Success; } + Outcome outcome() const { return outcome_; } + DeathCause cause() const { return cause_; } + const std::string& failure_description() const { return failure_description_; } + private: - bool is_empty_; - std::string_view msg_; - std::string_view file_; - int line_; + Outcome outcome_ = Outcome::Success; + DeathCause cause_ = DeathCause::Unknown; + std::string failure_description_; }; -static constexpr AssertionInfoMatcher AnyMatcher(AssertionInfoMatcher::any_msg); +class DeathTest { +public: + DeathTest() = default; + DeathTest(DeathTest const&) = delete; + DeathTest& operator=(DeathTest const&) = delete; -inline AssertionInfoMatcher& GlobalMatcher() { - static AssertionInfoMatcher GMatch; - return GMatch; -} + template + DeathTestResult Run(DeathCause expected_cause, Func&& func, const Matcher& matcher) { + std::set_terminate([] { StopChildProcess(DeathCause::StdTerminate); }); -struct DeathTest { - enum ResultKind { - RK_DidNotDie, RK_MatchFound, RK_MatchFailure, RK_Terminate, RK_SetupFailure, RK_Unknown - }; + DeathCause cause = Run(func); - static const char* ResultKindToString(ResultKind RK) { -#define CASE(K) case K: return #K - switch (RK) { - CASE(RK_MatchFailure); - CASE(RK_DidNotDie); - CASE(RK_SetupFailure); - CASE(RK_MatchFound); - CASE(RK_Unknown); - CASE(RK_Terminate); + if (!IsValidCause(cause)) { + return DeathTestResult(Outcome::InvalidCause, cause, ToString(cause)); } - return "not a result kind"; - } - static bool IsValidResultKind(int val) { - return val >= RK_DidNotDie && val <= RK_Unknown; + if (expected_cause != cause) { + std::stringstream failure_description; + failure_description // + << "Child died, but with a different death cause\n" // + << "Expected cause: " << ToString(expected_cause) << "\n" // + << "Actual cause: " << ToString(cause) << "\n"; + return DeathTestResult(Outcome::UnexpectedCause, cause, failure_description.str()); + } + + MatchResult match_result = matcher(GetChildStdErr()); + if (!match_result.first) { + auto failure_description = std::string("Child died, but with a different error message\n") + match_result.second; + return DeathTestResult(Outcome::UnexpectedErrorMessage, cause, failure_description); + } + + return DeathTestResult(Outcome::Success, cause); } - DeathTest(AssertionInfoMatcher const& Matcher) : matcher_(Matcher) {} + void PrintFailureDetails(std::string_view failure_description, std::string_view stmt, DeathCause cause) const { + std::fprintf( + stderr, "Failure: EXPECT_DEATH( %s ) failed!\n(reason: %s)\n\n", stmt.data(), failure_description.data()); + + if (cause != DeathCause::Unknown) { + std::fprintf(stderr, "child exit code: %d\n", GetChildExitCode()); + } + std::fprintf(stderr, "---------- standard err ----------\n%s", GetChildStdErr().c_str()); + std::fprintf(stderr, "\n----------------------------------\n"); + std::fprintf(stderr, "---------- standard out ----------\n%s", GetChildStdOut().c_str()); + std::fprintf(stderr, "\n----------------------------------\n"); + }; + +private: + int GetChildExitCode() const { return exit_code_; } + std::string const& GetChildStdOut() const { return stdout_from_child_; } + std::string const& GetChildStdErr() const { return stderr_from_child_; } template - ResultKind Run(Func&& f) { + DeathCause Run(Func&& f) { int pipe_res = pipe(stdout_pipe_fd_); assert(pipe_res != -1 && "failed to create pipe"); pipe_res = pipe(stderr_pipe_fd_); assert(pipe_res != -1 && "failed to create pipe"); pid_t child_pid = fork(); - assert(child_pid != -1 && - "failed to fork a process to perform a death test"); + assert(child_pid != -1 && "failed to fork a process to perform a death test"); child_pid_ = child_pid; if (child_pid_ == 0) { RunForChild(std::forward(f)); @@ -147,10 +237,6 @@ struct DeathTest { return RunForParent(); } - int getChildExitCode() const { return exit_code_; } - std::string const& getChildStdOut() const { return stdout_from_child_; } - std::string const& getChildStdErr() const { return stderr_from_child_; } -private: template TEST_NORETURN void RunForChild(Func&& f) { close(GetStdOutReadFD()); // don't need to read from the pipe in the child. @@ -158,14 +244,13 @@ struct DeathTest { auto DupFD = [](int DestFD, int TargetFD) { int dup_result = dup2(DestFD, TargetFD); if (dup_result == -1) - std::exit(RK_SetupFailure); + StopChildProcess(DeathCause::SetupFailure); }; DupFD(GetStdOutWriteFD(), STDOUT_FILENO); DupFD(GetStdErrWriteFD(), STDERR_FILENO); - GlobalMatcher() = matcher_; f(); - std::exit(RK_DidNotDie); + StopChildProcess(DeathCause::DidNotDie); } static std::string ReadChildIOUntilEnd(int FD) { @@ -190,7 +275,7 @@ struct DeathTest { close(GetStdErrReadFD()); } - ResultKind RunForParent() { + DeathCause RunForParent() { CaptureIOFromChild(); int status_value; @@ -199,35 +284,27 @@ struct DeathTest { if (WIFEXITED(status_value)) { exit_code_ = WEXITSTATUS(status_value); - if (!IsValidResultKind(exit_code_)) - return RK_Unknown; - return static_cast(exit_code_); + return ConvertToDeathCause(exit_code_); } - return RK_Unknown; - } - DeathTest(DeathTest const&) = delete; - DeathTest& operator=(DeathTest const&) = delete; + if (WIFSIGNALED(status_value)) { + exit_code_ = WTERMSIG(status_value); + // `__builtin_trap` generqtes `SIGILL` on x86 and `SIGTRAP` on ARM. + if (exit_code_ == SIGILL || exit_code_ == SIGTRAP) { + return DeathCause::Trap; + } + } - int GetStdOutReadFD() const { - return stdout_pipe_fd_[0]; + return DeathCause::Unknown; } - int GetStdOutWriteFD() const { - return stdout_pipe_fd_[1]; - } + int GetStdOutReadFD() const { return stdout_pipe_fd_[0]; } + int GetStdOutWriteFD() const { return stdout_pipe_fd_[1]; } + int GetStdErrReadFD() const { return stderr_pipe_fd_[0]; } + int GetStdErrWriteFD() const { return stderr_pipe_fd_[1]; } - int GetStdErrReadFD() const { - return stderr_pipe_fd_[0]; - } - - int GetStdErrWriteFD() const { - return stderr_pipe_fd_[1]; - } -private: - AssertionInfoMatcher matcher_; pid_t child_pid_ = -1; - int exit_code_ = -1; + int exit_code_ = -1; int stdout_pipe_fd_[2]; int stderr_pipe_fd_[2]; std::string stdout_from_child_; @@ -235,82 +312,56 @@ struct DeathTest { }; #ifdef _LIBCPP_VERSION -void std::__libcpp_verbose_abort(char const* printf_format, ...) { - // Extract information from the error message. This has to stay synchronized with how we format assertions in the - // library. +void std::__libcpp_verbose_abort(char const* format, ...) { va_list args; - va_start(args, printf_format); - char const* message = va_arg(args, char const*); + va_start(args, format); - std::regex message_format("(.*):(\\d+): assertion (.*) failed: (.*)\\n"); + std::fprintf(stderr, "%s\n", Marker); + std::vfprintf(stderr, format, args); + std::fprintf(stderr, "%s", Marker); - std::cmatch match_result; - bool has_match = std::regex_match(message, match_result, message_format); - assert(has_match); - assert(match_result.size() == 5); - - std::string file = match_result[1]; - int line = std::stoi(match_result[2]); - // Omitting `expression` in `match_result[3]` - std::string failure_reason = match_result[4]; + va_end(args); - if (GlobalMatcher().Matches(file.c_str(), line, failure_reason.c_str())) { - std::exit(DeathTest::RK_MatchFound); - } - std::exit(DeathTest::RK_MatchFailure); + StopChildProcess(DeathCause::VerboseAbort); } #endif // _LIBCPP_VERSION -[[noreturn]] inline void terminate_handler() { - std::exit(DeathTest::RK_Terminate); -} - template -inline bool ExpectDeath(const char* stmt, Func&& func, AssertionInfoMatcher Matcher) { - std::set_terminate(terminate_handler); - DeathTest DT(Matcher); - DeathTest::ResultKind RK = DT.Run(func); - auto OnFailure = [&](const char* msg) { - std::fprintf(stderr, "EXPECT_DEATH( %s ) failed! (%s)\n\n", stmt, msg); - if (RK != DeathTest::RK_Unknown) { - std::fprintf(stderr, "child exit code: %d\n", DT.getChildExitCode()); - } - if (!DT.getChildStdErr().empty()) { - std::fprintf(stderr, "---------- standard err ----------\n%s\n", DT.getChildStdErr().c_str()); - } - if (!DT.getChildStdOut().empty()) { - std::fprintf(stderr, "---------- standard out ----------\n%s\n", DT.getChildStdOut().c_str()); - } - return false; - }; - switch (RK) { - case DeathTest::RK_MatchFound: - case DeathTest::RK_Terminate: - return true; - case DeathTest::RK_SetupFailure: - return OnFailure("child failed to setup test environment"); - case DeathTest::RK_Unknown: - return OnFailure("reason unknown"); - case DeathTest::RK_DidNotDie: - return OnFailure("child did not die"); - case DeathTest::RK_MatchFailure: - return OnFailure("matcher failed"); +bool ExpectDeath(DeathCause expected_cause, const char* stmt, Func&& func, const Matcher& matcher) { + assert(IsValidCause(expected_cause)); + + DeathTest test_case; + DeathTestResult test_result = test_case.Run(expected_cause, func, matcher); + if (!test_result.success()) { + test_case.PrintFailureDetails(test_result.failure_description(), stmt, test_result.cause()); } - assert(false && "unreachable"); + + return test_result.success(); } template -inline bool ExpectDeath(const char* stmt, Func&& func) { - return ExpectDeath(stmt, func, AnyMatcher); +bool ExpectDeath(DeathCause expected_cause, const char* stmt, Func&& func) { + return ExpectDeath(expected_cause, stmt, func, MakeAnyMatcher()); } -/// Assert that the specified expression throws a libc++ debug exception. -#define EXPECT_DEATH(...) assert((ExpectDeath(#__VA_ARGS__, [&]() { __VA_ARGS__; } ))) - -#define EXPECT_STD_TERMINATE(...) assert(ExpectDeath(#__VA_ARGS__, __VA_ARGS__)) - -#define EXPECT_DEATH_MATCHES(Matcher, ...) assert((ExpectDeath(#__VA_ARGS__, [&]() { __VA_ARGS__; }, Matcher))) - -#define TEST_LIBCPP_ASSERT_FAILURE(expr, message) assert((ExpectDeath(#expr, [&]() { (void)(expr); }, AssertionInfoMatcher(message)))) +// clang-format off + +/// Assert that the specified expression aborts with the expected cause and, optionally, error message. +#define EXPECT_DEATH(...) \ + assert(( ExpectDeath(DeathCause::VerboseAbort, #__VA_ARGS__, [&]() { __VA_ARGS__; } ) )) +#define EXPECT_DEATH_MATCHES(matcher, ...) \ + assert(( ExpectDeath(DeathCause::VerboseAbort, #__VA_ARGS__, [&]() { __VA_ARGS__; }, matcher) )) +#define EXPECT_STD_TERMINATE(...) \ + assert( ExpectDeath(DeathCause::StdTerminate, #__VA_ARGS__, __VA_ARGS__) ) + +#if _LIBCPP_HARDENING_MODE == _LIBCPP_HARDENING_MODE_DEBUG +#define TEST_LIBCPP_ASSERT_FAILURE(expr, message) \ + assert(( ExpectDeath(DeathCause::VerboseAbort, #expr, [&]() { (void)(expr); }, MakeAssertionMessageMatcher(message)) )) +#else +#define TEST_LIBCPP_ASSERT_FAILURE(expr, message) \ + assert(( ExpectDeath(DeathCause::Trap, #expr, [&]() { (void)(expr); }) )) +#endif // _LIBCPP_HARDENING_MODE == _LIBCPP_HARDENING_MODE_DEBUG + +// clang-format on #endif // TEST_SUPPORT_CHECK_ASSERTION_H diff --git a/libcxx/test/support/test.support/test_check_assertion.pass.cpp b/libcxx/test/support/test.support/test_check_assertion.pass.cpp index 7cf0e0966ce89d..d1ac6717267f3b 100644 --- a/libcxx/test/support/test.support/test_check_assertion.pass.cpp +++ b/libcxx/test/support/test.support/test_check_assertion.pass.cpp @@ -18,47 +18,110 @@ #include "check_assertion.h" template -inline bool TestDeathTest(const char* stmt, Func&& func, DeathTest::ResultKind ExpectResult, AssertionInfoMatcher Matcher = AnyMatcher) { - DeathTest DT(Matcher); - DeathTest::ResultKind RK = DT.Run(func); - auto OnFailure = [&](std::string msg) { - std::fprintf(stderr, "EXPECT_DEATH( %s ) failed! (%s)\n\n", stmt, msg.c_str()); - if (!DT.getChildStdErr().empty()) { - std::fprintf(stderr, "---------- standard err ----------\n%s\n", DT.getChildStdErr().c_str()); - } - if (!DT.getChildStdOut().empty()) { - std::fprintf(stderr, "---------- standard out ----------\n%s\n", DT.getChildStdOut().c_str()); +bool TestDeathTest( + Outcome expected_outcome, DeathCause expected_cause, const char* stmt, Func&& func, const Matcher& matcher) { + auto get_matcher = [&] { +#if _LIBCPP_HARDENING_MODE == _LIBCPP_HARDENING_MODE_DEBUG + return matcher; +#else + (void)matcher; + return MakeAnyMatcher(); +#endif + }; + + DeathTest test_case; + DeathTestResult test_result = test_case.Run(expected_cause, func, get_matcher()); + std::string maybe_failure_description; + + Outcome outcome = test_result.outcome(); + if (expected_outcome != outcome) { + maybe_failure_description += + std::string("Test outcome was different from expected; expected ") + ToString(expected_outcome) + + ", got: " + ToString(outcome); + } + + DeathCause cause = test_result.cause(); + if (expected_cause != cause) { + auto failure_description = + std::string("Cause of death was different from expected; expected ") + ToString(expected_cause) + + ", got: " + ToString(cause); + if (maybe_failure_description.empty()) { + maybe_failure_description = failure_description; + } else { + maybe_failure_description += std::string("; ") + failure_description; } + } + + if (!maybe_failure_description.empty()) { + test_case.PrintFailureDetails(maybe_failure_description, stmt, test_result.cause()); return false; - }; - if (RK != ExpectResult) - return OnFailure(std::string("expected result did not occur: expected ") + DeathTest::ResultKindToString(ExpectResult) + " got: " + DeathTest::ResultKindToString(RK)); + } + return true; } -#define TEST_DEATH_TEST(RK, ...) assert((TestDeathTest(#__VA_ARGS__, [&]() { __VA_ARGS__; }, RK, AnyMatcher ))) - -#define TEST_DEATH_TEST_MATCHES(RK, Matcher, ...) assert((TestDeathTest(#__VA_ARGS__, [&]() { __VA_ARGS__; }, RK, Matcher))) -void my_libcpp_assert() { - _LIBCPP_ASSERT(false, "other"); -} +// clang-format off -void test_no_match_found() { - AssertionInfoMatcher ExpectMatch("my message"); - TEST_DEATH_TEST_MATCHES(DeathTest::RK_MatchFailure, ExpectMatch, my_libcpp_assert()); -} +#define TEST_DEATH_TEST(outcome, cause, ...) \ + assert(( TestDeathTest(outcome, cause, #__VA_ARGS__, [&]() { __VA_ARGS__; }, MakeAnyMatcher()) )) +#define TEST_DEATH_TEST_MATCHES(outcome, cause, matcher, ...) \ + assert(( TestDeathTest(outcome, cause, #__VA_ARGS__, [&]() { __VA_ARGS__; }, matcher) )) -void test_did_not_die() { - TEST_DEATH_TEST(DeathTest::RK_DidNotDie, ((void)0)); -} +// clang-format on -void test_unknown() { - TEST_DEATH_TEST(DeathTest::RK_Unknown, std::exit(13)); -} +#if _LIBCPP_HARDENING_MODE == _LIBCPP_HARDENING_MODE_DEBUG +DeathCause assertion_death_cause = DeathCause::VerboseAbort; +#else +DeathCause assertion_death_cause = DeathCause::Trap; +#endif int main(int, char**) { - test_no_match_found(); - test_did_not_die(); - test_unknown(); + auto fail_assert = [] { _LIBCPP_ASSERT(false, "Some message"); }; + Matcher good_matcher = MakeAssertionMessageMatcher("Some message"); + Matcher bad_matcher = MakeAssertionMessageMatcher("Bad expected message"); + + // Test the implementation of death tests. We're bypassing the assertions added by the actual `EXPECT_DEATH` macros + // which allows us to test failure cases (where the assertion would fail) as well. + { + // Success -- `std::terminate`. + TEST_DEATH_TEST(Outcome::Success, DeathCause::StdTerminate, std::terminate()); + + // Success -- trapping. + TEST_DEATH_TEST(Outcome::Success, DeathCause::Trap, __builtin_trap()); + + // Success -- assertion failure with any matcher. + TEST_DEATH_TEST_MATCHES(Outcome::Success, assertion_death_cause, MakeAnyMatcher(), fail_assert()); + + // Success -- assertion failure with a specific matcher. + TEST_DEATH_TEST_MATCHES(Outcome::Success, assertion_death_cause, good_matcher, fail_assert()); + +#if _LIBCPP_HARDENING_MODE == _LIBCPP_HARDENING_MODE_DEBUG + // Failure -- error message doesn't match. + TEST_DEATH_TEST_MATCHES(Outcome::UnexpectedErrorMessage, assertion_death_cause, bad_matcher, fail_assert()); +#endif + + // Invalid cause -- child did not die. + TEST_DEATH_TEST(Outcome::InvalidCause, DeathCause::DidNotDie, ((void)0)); + + // Invalid cause -- unknown. + TEST_DEATH_TEST(Outcome::InvalidCause, DeathCause::Unknown, std::exit(13)); + } + + // Test the `EXPECT_DEATH` macros themselves. Since they assert success, we can only test successful cases. + { + auto invoke_abort = [] { _LIBCPP_VERBOSE_ABORT("contains some message"); }; + + auto simple_matcher = [](const std::string& text) { + bool success = text.find("some") != std::string::npos; + return MatchResult(success, ""); + }; + + EXPECT_DEATH(invoke_abort()); + EXPECT_DEATH_MATCHES(MakeAnyMatcher(), invoke_abort()); + EXPECT_DEATH_MATCHES(simple_matcher, invoke_abort()); + EXPECT_STD_TERMINATE([] { std::terminate(); }); + TEST_LIBCPP_ASSERT_FAILURE(fail_assert(), "Some message"); + } + return 0; } diff --git a/libcxx/vendor/llvm/default_assertion_handler.in b/libcxx/vendor/llvm/default_assertion_handler.in index 111d305a16f7c4..8bc0553c078b34 100644 --- a/libcxx/vendor/llvm/default_assertion_handler.in +++ b/libcxx/vendor/llvm/default_assertion_handler.in @@ -17,7 +17,15 @@ # pragma GCC system_header #endif -// TODO(hardening): in production, trap rather than abort. -#define _LIBCPP_ASSERTION_HANDLER(message) _LIBCPP_VERBOSE_ABORT("%s", message) +#if _LIBCPP_HARDENING_MODE == _LIBCPP_HARDENING_MODE_DEBUG + +# define _LIBCPP_ASSERTION_HANDLER(message) _LIBCPP_VERBOSE_ABORT("%s", message) + +#else + +// TODO(hardening): use `__builtin_verbose_trap(message)` once that becomes available. +# define _LIBCPP_ASSERTION_HANDLER(message) ((void)message, __builtin_trap()) + +#endif // _LIBCPP_HARDENING_MODE == _LIBCPP_HARDENING_MODE_DEBUG #endif // _LIBCPP___ASSERTION_HANDLER