1 //===----------------------------------------------------------------------===//
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
7 //===----------------------------------------------------------------------===//
10 // REQUIRES: no-exceptions
17 // namespace __cxxabiv1 {
18 // void __cxa_decrement_exception_refcount(void *thrown_object) throw();
21 unsigned gCounter
= 0;
23 void my_terminate() { exit(0); }
27 // should not call std::terminate()
28 __cxxabiv1::__cxa_decrement_exception_refcount(nullptr);
30 std::set_terminate(my_terminate
);
32 // should call std::terminate()
33 __cxxabiv1::__cxa_decrement_exception_refcount((void*) &gCounter
);