blob: 8bbe6e48796c350661e9c7773c54d8ef908741dd [file] [log] [blame]
/* { dg-do compile } */
/* { dg-options "-O2 -fcf-protection" } */
/* { dg-final { scan-assembler-times "endbr32" 1 { target ia32 } } } */
/* { dg-final { scan-assembler-times "endbr64" 1 { target { ! ia32 } } } } */
/* { dg-final { scan-assembler-times "\t(?:call|jmp)\[ \t]+.*foo" 1 } } */
/* { dg-final { scan-assembler-not "notrack call\[ \t]+" } } */
int foo (int arg);
int func (int arg)
{
int (*fptrl) (int a) __attribute__ ((nocf_check)) = foo; /* { dg-warning "incompatible pointer type" } */
return (*fptrl)(arg);
}