Fix ICE in substring-handling building 502.gcc_r (PR 87562)
[official-gcc.git] / gcc / testsuite / c-c++-common / attr-nocf-check-1.c
blobc5ac7cb9f8692e5e614068b4194e67720a4f3ded
1 /* { dg-do compile } */
2 /* { dg-additional-options "-fcf-protection=none" } */
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" } */
8 int
9 foo1 (int arg)
11 return func (arg) + fptr (arg);
14 void
15 foo2 (void (*foo) (void))
17 void (*func) (void) __attribute__((nocf_check)) = foo; /* { dg-warning "'nocf_check' attribute ignored" } */
18 func ();
21 void
22 foo3 (nocf_check_t foo)
24 foo ();
27 void
28 foo4 (void (*foo) (void) __attribute__((nocf_check))) /* { dg-warning "'nocf_check' attribute ignored" } */
30 foo ();