]>
Commit | Line | Data |
---|---|---|
9091ccd2 | 1 | /* { dg-do compile } */ |
ec9e5c79 | 2 | /* { dg-options "-O0 -fcf-protection=none" } */ |
9091ccd2 | 3 | /* { dg-final { scan-assembler-not "endbr" } } */ |
4 | /* { dg-final { scan-assembler-not "notrack call\[ \t]+" } } */ | |
5 | ||
2f6d557f | 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" } */ | |
9091ccd2 | 8 | |
9 | int foo (int arg) | |
10 | { | |
11 | int a, b; | |
12 | a = func (arg); | |
13 | b = (*fptr) (arg); | |
14 | return a+b; | |
15 | } | |
16 | ||
17 | int __attribute__ ((nocf_check)) | |
18 | func (int arg) | |
2f6d557f | 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" } */ | |
9091ccd2 | 21 | return arg*(*fptrl)(arg); |
22 | } |