Daily bump.
[official-gcc.git] / gcc / testsuite / gcc.target / i386 / cet-sjlj-1.c
blob5e34810babc4534c403f7f25e0b39956a39fbd55
1 /* { dg-do compile } */
2 /* { dg-options "-O -fcf-protection" } */
3 /* { dg-final { scan-assembler-times "endbr32" 4 { target ia32 } } } */
4 /* { dg-final { scan-assembler-times "endbr64" 4 { target { ! ia32 } } } } */
5 /* { dg-final { scan-assembler-times "rdssp\[dq]" 2 } } */
6 /* { dg-final { scan-assembler-times "incssp\[dq]" 2 } } */
8 /* Based on gcc.dg/setjmp-3.c. */
10 void *buf[5];
12 extern void abort (void);
14 void raise0(void)
16 __builtin_longjmp (buf, 1);
19 int execute(int cmd)
21 int last = 0;
23 if (__builtin_setjmp (buf) == 0)
24 while (1)
26 last = 1;
27 raise0 ();
30 if (last == 0)
31 return 0;
32 else
33 return cmd;
36 int main(void)
38 if (execute (1) == 0)
39 abort ();
41 return 0;