1 /* HP-UX libunwind.so doesn't provide _UA_END_OF_STACK */
3 /* { dg-options "-fexceptions" } */
4 /* { dg-skip-if "" { "ia64-*-hpux11.*" } { "*" } { "" } } */
5 /* Verify that cleanups work with exception handling. */
10 static _Unwind_Reason_Code
11 force_unwind_stop (int version
, _Unwind_Action actions
,
12 _Unwind_Exception_Class exc_class
,
13 struct _Unwind_Exception
*exc_obj
,
14 struct _Unwind_Context
*context
,
17 if (actions
& _UA_END_OF_STACK
)
19 return _URC_NO_REASON
;
22 static void force_unwind ()
24 struct _Unwind_Exception
*exc
= malloc (sizeof (*exc
));
25 exc
->exception_class
= 0;
26 exc
->exception_cleanup
= 0;
28 #ifndef __USING_SJLJ_EXCEPTIONS__
29 _Unwind_ForcedUnwind (exc
, force_unwind_stop
, 0);
31 _Unwind_SjLj_ForcedUnwind (exc
, force_unwind_stop
, 0);
37 static void handler (void *p
__attribute__((unused
)))
44 char dummy
__attribute__((cleanup (handler
)));