OSDN Git Service

* gcc.dg/torture/pr26565.c: Expect warning on packed field for
[pf3gnuchains/gcc-fork.git] / gcc / testsuite / gcc.dg / cleanup-11.c
index 9c47f6c..8330c2b 100644 (file)
@@ -1,5 +1,5 @@
-/* { dg-do run { target i?86-*-linux* x86_64-*-linux* ia64-*-linux* alpha*-*-linux* powerpc*-*-linux* s390*-*-linux* sparc*-*-linux* mips*-*-linux* } } */
-/* { dg-options "-fasynchronous-unwind-tables -fexceptions -O2" } */
+/* { dg-do run { target hppa*-*-hpux* *-*-linux* powerpc*-*-darwin* } } */
+/* { dg-options "-fexceptions -fnon-call-exceptions -O2" } */
 /* Verify that cleanups work with exception handling through realtime signal
    frames on alternate stack.  */
 
@@ -7,6 +7,7 @@
 #include <stdlib.h>
 #include <signal.h>
 #include <unistd.h>
+#include <string.h>
 
 static _Unwind_Reason_Code
 force_unwind_stop (int version, _Unwind_Action actions,
@@ -23,7 +24,7 @@ force_unwind_stop (int version, _Unwind_Action actions,
 static void force_unwind ()
 {
   struct _Unwind_Exception *exc = malloc (sizeof (*exc));
-  exc->exception_class = 0;
+  memset (&exc->exception_class, 0, sizeof (exc->exception_class));
   exc->exception_cleanup = 0;
                    
 #ifndef __USING_SJLJ_EXCEPTIONS__
@@ -93,8 +94,9 @@ static int __attribute__((noinline)) fn1 ()
 
   sigemptyset (&s.sa_mask);
   s.sa_sigaction = fn4;
-  s.sa_flags = SA_ONESHOT | SA_ONSTACK | SA_SIGINFO;
+  s.sa_flags = SA_RESETHAND | SA_ONSTACK | SA_SIGINFO;
   sigaction (SIGSEGV, &s, NULL);
+  sigaction (SIGBUS, &s, NULL);
   fn2 ();
   return 0;
 }