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-exception |
6 | // |
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 runtime |
12 | // failures when back-deploying. |
13 | // XFAIL: availability-verbose_abort-missing |
14 | |
15 | #include <__verbose_abort> |
16 | #include <cstdlib> |
17 | |
18 | void std::__libcpp_verbose_abort(char const*, ...) { |
19 | std::exit(EXIT_SUCCESS); |
20 | } |
21 | |
22 | int main(int, char**) { |
23 | std::__libcpp_verbose_abort("%s" , "message" ); |
24 | return EXIT_FAILURE; |
25 | } |
26 | |