| 1 |
/* { dg-do compile } */ |
| 2 |
/* { dg-additional-options "-fcf-protection=none" } */ |
| 3 |
|
| 4 |
int func (int) __attribute__ ((nocf_check)); /* { dg-warning "'nocf_check' attribute ignored" } */ |
| 5 |
int (*fptr) (int) __attribute__ ((nocf_check)); /* { dg-warning "'nocf_check' attribute ignored" } */ |
| 6 |
typedef void (*nocf_check_t) (void) __attribute__ ((nocf_check)); /* { dg-warning "'nocf_check' attribute ignored" } */ |
| 7 |
|
| 8 |
int |
| 9 |
foo1 (int arg) |
| 10 |
{ |
| 11 |
return func (arg) + fptr (arg); |
| 12 |
} |
| 13 |
|
| 14 |
void |
| 15 |
foo2 (void (*foo) (void)) |
| 16 |
{ |
| 17 |
void (*func) (void) __attribute__((nocf_check)) = foo; /* { dg-warning "'nocf_check' attribute ignored" } */ |
| 18 |
func (); |
| 19 |
} |
| 20 |
|
| 21 |
void |
| 22 |
foo3 (nocf_check_t foo) |
| 23 |
{ |
| 24 |
foo (); |
| 25 |
} |
| 26 |
|
| 27 |
void |
| 28 |
foo4 (void (*foo) (void) __attribute__((nocf_check))) /* { dg-warning "'nocf_check' attribute ignored" } */ |
| 29 |
{ |
| 30 |
foo (); |
| 31 |
} |