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 // Make sure that we can enable assertions when we back-deploy to older platforms
10 // if we define _LIBCPP_AVAILABILITY_CUSTOM_VERBOSE_ABORT_PROVIDED.
11 //
12 // Note that this test isn't really different from customize_verbose_abort.pass.cpp when
13 // run outside of back-deployment scenarios, but we always want to run this test.
14
15 // ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_ENABLE_ASSERTIONS=1 -D_LIBCPP_AVAILABILITY_CUSTOM_VERBOSE_ABORT_PROVIDED
16
17 #include <cstdlib>
18
__libcpp_verbose_abort(char const *,...)19 void std::__libcpp_verbose_abort(char const*, ...) {
20 std::exit(EXIT_SUCCESS);
21 }
22
main(int,char **)23 int main(int, char**) {
24 _LIBCPP_ASSERT(false, "message");
25 return EXIT_FAILURE;
26 }
27