aboutsummaryrefslogtreecommitdiff
path: root/libcxx/test/libcxx-03/assertions/customize_verbose_abort.link-time.pass.cpp
blob: 390c6b6db190d7ec64d917bd1cd02d5f1c17f9b1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
//===----------------------------------------------------------------------===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//

// Test that we can set a custom verbose termination function at link-time.

// We flag uses of the verbose termination function in older dylibs at compile-time to avoid runtime
// failures when back-deploying.
// XFAIL: availability-verbose_abort-missing

// XFAIL: FROZEN-CXX03-HEADERS-FIXME

#include <__verbose_abort>
#include <cstdlib>

void std::__libcpp_verbose_abort(char const*, ...) _NOEXCEPT { std::exit(EXIT_SUCCESS); }

int main(int, char**) {
  std::__libcpp_verbose_abort("%s", "message");
  return EXIT_FAILURE;
}