3 // Test that forced unwinding runs all cleanups. Also tests that
4 // rethrowing doesn't call the exception object destructor.
11 static _Unwind_Reason_Code
12 force_unwind_stop (int version, _Unwind_Action actions,
13 _Unwind_Exception_Class exc_class,
14 struct _Unwind_Exception *exc_obj,
15 struct _Unwind_Context *context,
18 if (actions & _UA_END_OF_STACK)
25 return _URC_NO_REASON;
29 force_unwind_cleanup (_Unwind_Reason_Code, struct _Unwind_Exception *)
34 static void force_unwind ()
36 _Unwind_Exception *exc = new _Unwind_Exception;
37 exc->exception_class = 0;
38 exc->exception_cleanup = force_unwind_cleanup;
40 #ifndef __USING_SJLJ_EXCEPTIONS__
41 _Unwind_ForcedUnwind (exc, force_unwind_stop, 0);
43 _Unwind_SjLj_ForcedUnwind (exc, force_unwind_stop, 0);