1 // { dg-do run { xfail sparc64-*-elf z8k-*-* arm-*-pe } } 2 // { dg-options "-fexceptions" } 3 4 #include <exception> 5 my_unexpected()6void my_unexpected() { 7 throw 42; 8 } 9 foo()10void foo() throw (int) { throw "Hi"; } 11 main()12int main() { 13 std::set_unexpected (my_unexpected); 14 try { 15 foo(); 16 } catch (int i) { 17 if (i == 42) 18 return 0; 19 } 20 return 1; 21 } 22