comparison gcc/testsuite/c-c++-common/attr-nocf-check-1.c @ 111:04ced10e8804

gcc 7
author kono
date Fri, 27 Oct 2017 22:46:09 +0900
parents
children 84e7813d76e9
comparison
equal deleted inserted replaced
68:561a7518be6b 111:04ced10e8804
1 /* { dg-do compile } */
2
3 int func (int) __attribute__ ((nocf_check)); /* { dg-warning "'nocf_check' attribute ignored" } */
4 int (*fptr) (int) __attribute__ ((nocf_check)); /* { dg-warning "'nocf_check' attribute ignored" } */
5 typedef void (*nocf_check_t) (void) __attribute__ ((nocf_check)); /* { dg-warning "'nocf_check' attribute ignored" } */
6
7 int
8 foo1 (int arg)
9 {
10 return func (arg) + fptr (arg);
11 }
12
13 void
14 foo2 (void (*foo) (void))
15 {
16 void (*func) (void) __attribute__((nocf_check)) = foo; /* { dg-warning "'nocf_check' attribute ignored" } */
17 func ();
18 }
19
20 void
21 foo3 (nocf_check_t foo)
22 {
23 foo ();
24 }
25
26 void
27 foo4 (void (*foo) (void) __attribute__((nocf_check))) /* { dg-warning "'nocf_check' attribute ignored" } */
28 {
29 foo ();
30 }