[PR c++/84702] ICE with default tmpl arg of overload set
[official-gcc.git] / gcc / testsuite / g++.dg / eh / sighandle.C
blobc2200024687efc5acb6529cd150c859e14ab6937
1 // { dg-do run { target { *-*-aix5* i?86-*-linux* i?86-*-gnu* x86_64-*-linux* } } }
2 // { dg-options "-fexceptions -fnon-call-exceptions" }
4 #include <signal.h>
5 #include <stdlib.h>
7 void sighandler (int signo, siginfo_t * si, void * uc)
9   throw (5);
12 char * dosegv ()
13 {    
14   * ((volatile int *)0) = 12;
15   return 0;
18 int main ()
20   struct sigaction sa;
21   int status;
23   sa.sa_sigaction = sighandler;
24   sa.sa_flags = SA_SIGINFO;
25     
26   status = sigaction (SIGSEGV, & sa, NULL);
27   status = sigaction (SIGBUS, & sa, NULL);
29   try {
30     dosegv ();
31   }
32   catch (int x) {
33     return (x != 5);
34   }
36   return 1;