PR tree-optimization/67955
[official-gcc.git] / gcc / testsuite / c-c++-common / attributes-3.c
blob821278c680fb8c30d31e3e92ee73623c9c2c8976
1 /* PR c++/71024 */
2 /* { dg-do compile } */
3 /* { dg-prune-output "declared but never defined" } */
5 void
6 fn0 (void) /* { dg-message "previous definition" } */
9 extern void __attribute__((optimize ("O2"))) fn0 (void); /* { dg-warning "optimization attribute" } */
11 extern __attribute__((noinline)) int fn1 (void); /* { dg-message "previous declaration" } */
12 extern inline int fn1 (void); /* { dg-warning "inline declaration of" } */
14 extern inline int fn2 (void); /* { dg-message "previous declaration" } */
15 extern __attribute__((noinline)) int fn2 (void); /* { dg-warning "attribute noinline follows inline declaration" } */
17 extern __attribute__((always_inline)) int fn3 (void); /* { dg-message "previous declaration" } */
18 extern __attribute__((noinline)) int fn3 (void); /* { dg-warning "attribute .noinline. follows declaration with attribute .always_inline." } */
20 extern __attribute__((noinline)) int fn4 (void); /* { dg-message "previous declaration" } */
21 extern __attribute__((always_inline)) int fn4 (void); /* { dg-warning "attribute .always_inline. follows declaration with attribute .noinline." } */
23 extern __attribute__((hot)) int fn5 (void); /* { dg-message "previous declaration" } */
24 extern __attribute__((cold)) int fn5 (void); /* { dg-warning "attribute .cold. follows declaration with attribute .hot." } */
26 extern __attribute__((cold)) int fn6 (void); /* { dg-message "previous declaration" } */
27 extern __attribute__((hot)) int fn6 (void); /* { dg-warning "attribute .hot. follows declaration with attribute .cold." } */