1 // HP-UX libunwind.so doesn't provide _UA_END_OF_STACK.
2 // { dg-do run { xfail "ia64-hp-hpux11.*" } }
3 // { dg-require-effective-target c++14_down }
5 // Test that forced unwinding calls std::unexpected going
6 // through a nothrow function.
13 static _Unwind_Reason_Code
14 force_unwind_stop (int version, _Unwind_Action actions,
15 _Unwind_Exception_Class exc_class,
16 struct _Unwind_Exception *exc_obj,
17 struct _Unwind_Context *context,
20 if (actions & _UA_END_OF_STACK)
22 return _URC_NO_REASON;
25 static void __attribute__((noreturn))
28 _Unwind_Exception *exc = new _Unwind_Exception;
29 // exception_class might not be a scalar.
30 memset (&exc->exception_class, 0, sizeof (exc->exception_class));
31 exc->exception_cleanup = 0;
33 #ifndef __USING_SJLJ_EXCEPTIONS__
34 _Unwind_ForcedUnwind (exc, force_unwind_stop, 0);
36 _Unwind_SjLj_ForcedUnwind (exc, force_unwind_stop, 0);
56 std::set_unexpected (handle_unexpected);