]>
Commit | Line | Data |
---|---|---|
da879e01 MS |
1 | /* Verify that attribute nonnull on global and local function declarations |
2 | or those to pointers to functions is merged. | |
3 | { dg-do compile } | |
4 | { dg-options "-Wall" } */ | |
5 | ||
6 | void fnonnull_local_local (void) | |
7 | { | |
8 | extern __attribute__ ((nonnull)) void fnonnull1 (void*); | |
9 | ||
10 | fnonnull1 (0); // { dg-warning "\\\[-Wnonnull" } | |
11 | } | |
12 | ||
13 | void gnonnull_local_local (void) | |
14 | { | |
15 | extern void fnonnull1 (void*); | |
16 | ||
17 | fnonnull1 (0); // { dg-warning "\\\[-Wnonnull" } | |
18 | } | |
19 | ||
20 | ||
21 | void fnonnull_local_global (void) | |
22 | { | |
23 | extern __attribute__ ((nonnull)) void fnonnull2 (void*); | |
24 | ||
25 | fnonnull2 (0); // { dg-warning "\\\[-Wnonnull" } | |
26 | } | |
27 | ||
28 | extern void fnonnull2 (void*); | |
29 | ||
30 | void gnonnull_local_global (void) | |
31 | { | |
32 | fnonnull2 (0); // { dg-warning "\\\[-Wnonnull" } | |
33 | } | |
34 | ||
35 | ||
36 | extern __attribute__ ((nonnull)) void fnonnull3 (void*); | |
37 | ||
38 | void fnonnull_global_local (void) | |
39 | { | |
40 | fnonnull3 (0); // { dg-warning "\\\[-Wnonnull" } | |
41 | } | |
42 | ||
43 | void gnonnull_global_local (void) | |
44 | { | |
45 | extern void fnonnull3 (void*); | |
46 | ||
47 | fnonnull3 (0); // { dg-warning "\\\[-Wnonnull" } | |
48 | } | |
49 | ||
50 | ||
51 | void pfnonnull_local_local (void) | |
52 | { | |
53 | extern __attribute__ ((nonnull)) void (*pfnonnull1) (void*); | |
54 | ||
55 | pfnonnull1 (0); // { dg-warning "\\\[-Wnonnull" } | |
56 | } | |
57 | ||
58 | void gpnonnull_local_local (void) | |
59 | { | |
60 | extern void (*pfnonnull1) (void*); | |
61 | ||
62 | pfnonnull1 (0); // { dg-warning "\\\[-Wnonnull" "pr?????" { xfail *-*-* } } | |
63 | } | |
64 | ||
65 | ||
66 | void pfnonnull_local_global (void) | |
67 | { | |
68 | extern __attribute__ ((nonnull)) void (*pfnonnull2) (void*); | |
69 | ||
70 | pfnonnull2 (0); // { dg-warning "\\\[-Wnonnull" } | |
71 | } | |
72 | ||
73 | extern void (*pfnonnull2) (void*); | |
74 | ||
75 | void gpnonnull_local_global (void) | |
76 | { | |
77 | pfnonnull2 (0); // { dg-warning "\\\[-Wnonnull" "pr?????" { xfail *-*-* } } | |
78 | } | |
79 | ||
80 | ||
81 | extern __attribute__ ((nonnull)) void (*pfnonnull3) (void*); | |
82 | ||
83 | void pfnonnull_global_local (void) | |
84 | { | |
85 | pfnonnull3 (0); // { dg-warning "\\\[-Wnonnull" } | |
86 | } | |
87 | ||
88 | void gpnonnull_global_local (void) | |
89 | { | |
90 | extern void (*pfnonnull3) (void*); | |
91 | ||
92 | pfnonnull3 (0); // { dg-warning "\\\[-Wnonnull" } | |
93 | } |