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 //===----------------------------------------------------------------------===//
9 // UNSUPPORTED: no-exceptions
20 // Disable warning about throw always calling terminate.
21 #if defined(__GNUC__) && !defined(__clang__)
22 # pragma GCC diagnostic ignored "-Wterminate"
25 // use dtors instead of try/catch
29 printf("should not be run\n");
36 #if __has_feature(cxx_noexcept)
46 void my_terminate() { exit(0); }
51 T
* t
= static_cast<T
*>(v
);
57 std::set_terminate(my_terminate
);
59 typedef test1::A Array
[10];
60 Array a
[10]; // calls _cxa_vec_dtor
61 __cxxabiv1::__cxa_vec_dtor(a
, 10, sizeof(test1::A
), destroy
<test1::A
>);