PR rtl-optimization/87918
[official-gcc.git] / gcc / testsuite / gcc.target / i386 / cet-label.c
blobea48f4161eb75fea55917c2eecf1aa908161e0d1
1 /* Verify that -fcf-protection works. */
2 /* { dg-do compile } */
3 /* { dg-options "-O -fcf-protection" } */
4 /* { dg-final { scan-assembler-times "endbr32" 3 { target ia32 } } } */
5 /* { dg-final { scan-assembler-times "endbr64" 3 { target { ! ia32 } } } } */
7 int func (int arg)
9 static void *array[] = { &&foo, &&bar };
11 goto *array[arg];
12 foo:
13 return arg*111;
14 bar:
15 return arg*777;