PR rtl-optimization/87918
[official-gcc.git] / gcc / testsuite / gcc.target / i386 / cet-notrack-1a.c
blobd8d2e5a6d15c6415d15a517b04ce9de4bae52bc7
1 /* { dg-do compile } */
2 /* { dg-options "-O0 -fcf-protection=none" } */
3 /* { dg-final { scan-assembler-not "endbr" } } */
4 /* { dg-final { scan-assembler-not "notrack call\[ \t]+" } } */
6 int func (int a) __attribute__ ((nocf_check)); /* { dg-warning "'nocf_check' attribute ignored. Use -fcf-protection option to enable it" } */
7 int (*fptr) (int a) __attribute__ ((nocf_check)); /* { dg-warning "'nocf_check' attribute ignored. Use -fcf-protection option to enable it" } */
9 int foo (int arg)
11 int a, b;
12 a = func (arg);
13 b = (*fptr) (arg);
14 return a+b;
17 int __attribute__ ((nocf_check))
18 func (int arg)
19 { /* { dg-warning "'nocf_check' attribute ignored. Use -fcf-protection option to enable it" } */
20 int (*fptrl) (int a) __attribute__ ((nocf_check)); /* { dg-warning "'nocf_check' attribute ignored. Use -fcf-protection option to enable it" } */
21 return arg*(*fptrl)(arg);