Daily bump.
[official-gcc.git] / gcc / testsuite / gcc.target / i386 / cet-sjlj-4.c
blob329a592f4b2c2317337f3486a7a9679f1d9b4c29
1 /* { dg-do compile } */
2 /* { dg-options "-O -fcf-protection" } */
3 /* { dg-final { scan-assembler-times "endbr32" 3 { target ia32 } } } */
4 /* { dg-final { scan-assembler-times "endbr64" 3 { 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
15 raise0 (void)
17 __builtin_longjmp (buf, 1);
20 __attribute__ ((noinline, noclone))
21 static int
22 execute (int cmd)
24 int last = 0;
26 if (__builtin_setjmp (buf) == 0)
27 while (1)
29 last = 1;
30 raise0 ();
33 if (last == 0)
34 return 0;
35 else
36 return cmd;
39 int main(void)
41 if (execute (1) == 0)
42 abort ();
44 return 0;