2018-05-17 Richard Biener <rguenther@suse.de>
[official-gcc.git] / gcc / testsuite / gcc.target / i386 / cet-notrack-1b.c
blobd1a3337ac21584c60a88a6b89e778dafc9950c26
1 /* { dg-do compile } */
2 /* { dg-options "-O -fcf-protection" } */
3 /* { dg-final { scan-assembler-times "endbr32" 1 { target ia32 } } } */
4 /* { dg-final { scan-assembler-times "endbr64" 1 { target { ! ia32 } } } } */
5 /* { dg-final { scan-assembler-times "notrack call\[ \t]+" 2 } } */
7 int func (int a) __attribute__ ((nocf_check));
8 int (*fptr) (int a) __attribute__ ((nocf_check));
10 int foo (int arg)
12 int a, b;
13 a = func (arg);
14 b = (*fptr) (arg);
15 return a+b;
18 int __attribute__ ((nocf_check))
19 func (int arg)
21 int (*fptrl) (int a) __attribute__ ((nocf_check));
22 return arg*(*fptrl)(arg);