1 /* HP-UX libunwind.so doesn't provide _UA_END_OF_STACK */
2 /* { dg-do run { xfail "ia64-hp-hpux11.*" } } */
3 /* { dg-options "-fexceptions" } */
4 /* Verify that cleanups work with exception handling. */
9 static _Unwind_Reason_Code
10 force_unwind_stop (int version, _Unwind_Action actions,
11 _Unwind_Exception_Class exc_class,
12 struct _Unwind_Exception *exc_obj,
13 struct _Unwind_Context *context,
16 if (actions & _UA_END_OF_STACK)
18 return _URC_NO_REASON;
21 static void force_unwind ()
23 struct _Unwind_Exception *exc = malloc (sizeof (*exc));
24 exc->exception_class = 0;
25 exc->exception_cleanup = 0;
27 #ifndef __USING_SJLJ_EXCEPTIONS__
28 _Unwind_ForcedUnwind (exc, force_unwind_stop, 0);
30 _Unwind_SjLj_ForcedUnwind (exc, force_unwind_stop, 0);
36 static void handler (void *p __attribute__((unused)))
43 char dummy __attribute__((cleanup (handler)));