PR inline-asm/84742
[official-gcc.git] / gcc / testsuite / gcc.target / i386 / cet-switch-2.c
blobe620b837a3c499b406c0cb516e63841732f31b7f
1 /* Verify that CET works. */
2 /* { dg-do compile } */
3 /* { dg-options "-O -fcf-protection -mcet -mcet-switch" } */
4 /* { dg-final { scan-assembler-times "endbr32" 12 { target ia32 } } } */
5 /* { dg-final { scan-assembler-times "endbr64" 12 { target { ! ia32 } } } } */
6 /* { dg-final { scan-assembler-times "\[ \t]+jmp\[ \t]+\[*]" 1 } } */
8 void func2 (int);
10 int func1 (int arg)
12 switch (arg)
14 case 1: func2 (arg*100);
15 case 2: func2 (arg*300);
16 case 5: func2 (arg*500);
17 case 8: func2 (arg*700);
18 case 7: func2 (arg*900);
19 case -1: func2 (arg*-100);
20 case -2: func2 (arg*-300);
21 case -5: func2 (arg*-500);
22 case -7: func2 (arg*-700);
23 case -9: func2 (arg*-900);
25 return 0;