comparison gcc/testsuite/g++.dg/torture/pr85334.C @ 131:84e7813d76e9

gcc-8.2
author mir3636
date Thu, 25 Oct 2018 07:37:49 +0900
parents
children
comparison
equal deleted inserted replaced
111:04ced10e8804 131:84e7813d76e9
1 // { dg-do run { target { i?86-*-linux* i?86-*-gnu* x86_64-*-linux* } } }
2 // { dg-require-effective-target cet }
3 // { dg-additional-options "-fexceptions -fnon-call-exceptions -fcf-protection" }
4
5 #include <signal.h>
6 #include <stdlib.h>
7
8 void sighandler (int signo, siginfo_t * si, void * uc)
9 {
10 throw (5);
11 }
12
13 char * dosegv ()
14 {
15 * ((volatile int *)0) = 12;
16 return 0;
17 }
18
19 int main ()
20 {
21 struct sigaction sa;
22 int status;
23
24 sa.sa_sigaction = sighandler;
25 sa.sa_flags = SA_SIGINFO;
26
27 status = sigaction (SIGSEGV, & sa, NULL);
28 status = sigaction (SIGBUS, & sa, NULL);
29
30 try {
31 dosegv ();
32 }
33 catch (int x) {
34 return (x != 5);
35 }
36
37 return 1;
38 }