xref: /aosp_15_r20/external/libcxxabi/test/noexception4.pass.cpp (revision c05d8e5dc3e10f6ce4317e8bc22cc4a25f55fa94)
1*c05d8e5dSAndroid Build Coastguard Worker //===----------------------- noexception4.pass.cpp ------------------------===//
2*c05d8e5dSAndroid Build Coastguard Worker //
3*c05d8e5dSAndroid Build Coastguard Worker //                     The LLVM Compiler Infrastructure
4*c05d8e5dSAndroid Build Coastguard Worker //
5*c05d8e5dSAndroid Build Coastguard Worker // This file is dual licensed under the MIT and the University of Illinois Open
6*c05d8e5dSAndroid Build Coastguard Worker // Source Licenses. See LICENSE.TXT for details.
7*c05d8e5dSAndroid Build Coastguard Worker //
8*c05d8e5dSAndroid Build Coastguard Worker //===----------------------------------------------------------------------===//
9*c05d8e5dSAndroid Build Coastguard Worker 
10*c05d8e5dSAndroid Build Coastguard Worker // REQUIRES: libcxxabi-no-exceptions
11*c05d8e5dSAndroid Build Coastguard Worker 
12*c05d8e5dSAndroid Build Coastguard Worker #include <cxxabi.h>
13*c05d8e5dSAndroid Build Coastguard Worker #include <exception>
14*c05d8e5dSAndroid Build Coastguard Worker #include <cassert>
15*c05d8e5dSAndroid Build Coastguard Worker 
16*c05d8e5dSAndroid Build Coastguard Worker // namespace __cxxabiv1 {
17*c05d8e5dSAndroid Build Coastguard Worker //      void *__cxa_current_primary_exception() throw();
18*c05d8e5dSAndroid Build Coastguard Worker //      extern bool          __cxa_uncaught_exception () throw();
19*c05d8e5dSAndroid Build Coastguard Worker //      extern unsigned int  __cxa_uncaught_exceptions() throw();
20*c05d8e5dSAndroid Build Coastguard Worker // }
21*c05d8e5dSAndroid Build Coastguard Worker 
main()22*c05d8e5dSAndroid Build Coastguard Worker int main ()
23*c05d8e5dSAndroid Build Coastguard Worker {
24*c05d8e5dSAndroid Build Coastguard Worker     // Trivially
25*c05d8e5dSAndroid Build Coastguard Worker     assert(nullptr == __cxxabiv1::__cxa_current_primary_exception());
26*c05d8e5dSAndroid Build Coastguard Worker     assert(!__cxxabiv1::__cxa_uncaught_exception());
27*c05d8e5dSAndroid Build Coastguard Worker     assert(0 == __cxxabiv1::__cxa_uncaught_exceptions());
28*c05d8e5dSAndroid Build Coastguard Worker     return 0;
29*c05d8e5dSAndroid Build Coastguard Worker }
30