libcpp, c, middle-end: Optimize initializers using #embed in C
[official-gcc.git] / gcc / testsuite / gcc.dg / Wunused-result.c
blobc0bb9ae35e24d70fb3a8a5a94d00f50d0e34d861
1 /* PR c/99972 - missing -Wunused-result on a call to a locally redeclared
2 warn_unused_result function
3 { dg-do compile }
4 { dg-options "-Wall" } */
6 void gwur_local_local (void)
8 __attribute__ ((warn_unused_result)) int fwur1 (void);
10 fwur1 (); // { dg-warning "\\\[-Wunused-result" }
13 void hwur_local_local (void)
15 /* Verify the attribute from the declaration above is copied/merged
16 into the declaration below. */
17 int fwur1 (void);
19 fwur1 (); // { dg-warning "\\\[-Wunused-result" }
23 void gwur_local_global (void)
25 __attribute__ ((warn_unused_result)) int fwur2 (void);
27 fwur2 (); // { dg-warning "\\\[-Wunused-result" }
30 int fwur2 (void);
32 void hwur_local_global (void)
34 fwur2 (); // { dg-warning "\\\[-Wunused-result" }
38 __attribute__ ((warn_unused_result)) int fwur3 (void);
40 void gwur_global_local (void)
42 fwur3 (); // { dg-warning "\\\[-Wunused-result" }
45 void hwur_global_local (void)
47 int fwur3 (void);
49 fwur3 (); // { dg-warning "\\\[-Wunused-result" }