1 // HP-UX libunwind.so doesn't provide _UA_END_OF_STACK.
2 // { dg-do run { xfail "ia64-hp-hpux11.*" } }
4 // Test that forced unwinding calls std::unexpected going
5 // throw a nothrow function.
12 static _Unwind_Reason_Code
13 force_unwind_stop (int version, _Unwind_Action actions,
14 _Unwind_Exception_Class exc_class,
15 struct _Unwind_Exception *exc_obj,
16 struct _Unwind_Context *context,
19 if (actions & _UA_END_OF_STACK)
21 return _URC_NO_REASON;
24 static void __attribute__((noreturn))
27 _Unwind_Exception *exc = new _Unwind_Exception;
28 // exception_class might not be a scalar.
29 memset (&exc->exception_class, 0, sizeof (exc->exception_class));
30 exc->exception_cleanup = 0;
32 #ifndef __USING_SJLJ_EXCEPTIONS__
33 _Unwind_ForcedUnwind (exc, force_unwind_stop, 0);
35 _Unwind_SjLj_ForcedUnwind (exc, force_unwind_stop, 0);
55 std::set_unexpected (handle_unexpected);