24 lines · cpp
1//===----------------------------------------------------------------------===//2//3// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.4// See https://llvm.org/LICENSE.txt for license information.5// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception6//7//===----------------------------------------------------------------------===//8 9// Test that we can set a custom verbose termination function at link-time.10 11// We flag uses of the verbose termination function in older dylibs at compile-time to avoid runtime12// failures when back-deploying.13// XFAIL: availability-verbose_abort-missing14 15#include <__cxx03/__verbose_abort>16#include <cstdlib>17 18void std::__libcpp_verbose_abort(char const*, ...) _NOEXCEPT { std::exit(EXIT_SUCCESS); }19 20int main(int, char**) {21 std::__libcpp_verbose_abort("%s", "message");22 return EXIT_FAILURE;23}24