PR inline-asm/84742
[official-gcc.git] / gcc / testsuite / gcc.target / i386 / cet-switch-1.c
blob7a75857fcb11f1c0d5afa774e6c337cdd6fa13ba
1 /* Verify that CET works. */
2 /* { dg-do compile } */
3 /* { dg-options "-O -fcf-protection -mcet" } */
4 /* { dg-final { scan-assembler-times "endbr32" 1 { target ia32 } } } */
5 /* { dg-final { scan-assembler-times "endbr64" 1 { target { ! ia32 } } } } */
6 /* { dg-final { scan-assembler-times "notrack 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;