PR tree-optimization/86401
[official-gcc.git] / gcc / testsuite / c-c++-common / attr-nocf-check-3.c
blob02b56cb155e0d2e9ebea893f1e4cd634aae98e36
1 /* { dg-do compile } */
2 /* { dg-additional-options "-fcf-protection=none" } */
4 int foo (void) __attribute__ ((nocf_check)); /* { dg-warning "'nocf_check' attribute ignored" } */
5 void (*foo1) (void) __attribute__((nocf_check)); /* { dg-warning "'nocf_check' attribute ignored" } */
6 void (*foo2) (void);
8 int
9 foo (void) /* The function's address is not tracked. */
11 /* This call site is not tracked for
12 control-flow instrumentation. */
13 (*foo1)();
15 foo1 = foo2;
16 /* This call site is still not tracked for
17 control-flow instrumentation. */
18 (*foo1)();
20 /* This call site is tracked for
21 control-flow instrumentation. */
22 (*foo2)();
24 foo2 = foo1;
25 /* This call site is still tracked for
26 control-flow instrumentation. */
27 (*foo2)();
29 return 0;