1  /* Verify that CET works.  */
       2  /* { dg-do compile } */
       3  /* { dg-options "-O -fcf-protection -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 } } */
       7  
       8  void func2 (int);
       9  
      10  int func1 (int arg)
      11  {
      12    switch (arg)
      13    {
      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);
      24    }
      25    return 0;
      26  }