@@ -0,0 +1,8 @@
+// PR c++/89325
+// { dg-do compile }
+// { dg-options "-Wattributes" }
+
+struct A { friend int &operator<< (int &i, const A &) { return i; } }; // { dg-bogus "previous definition" }
+#pragma GCC optimize ("-fno-ipa-cp-clone")
+struct B {};
+int &operator<<(int &, const B &); // { dg-bogus "optimization attribute on '\[^\n\r]*' follows definition but the attribute doesn.t match" }
@@ -0,0 +1,11 @@
+// PR c++/89325
+// { dg-do compile }
+// { dg-options "-Wattributes" }
+
+int foo (int) { return 0; } // { dg-bogus "previous definition" }
+int bar (int) { return 0; } // { dg-bogus "previous definition" }
+int baz (int) { return 0; } // { dg-message "previous definition" }
+__attribute__((optimize (0))) int bar (long); // { dg-bogus "optimization attribute on '\[^\n\r]*' follows definition but the attribute doesn.t match" }
+#pragma GCC optimize ("-fno-ipa-cp-clone")
+int foo (long); // { dg-bogus "optimization attribute on '\[^\n\r]*' follows definition but the attribute doesn.t match" }
+int baz (int); // { dg-warning "optimization attribute on '\[^\n\r]*' follows definition but the attribute doesn.t match" }
@@ -0,0 +1,9 @@
+// PR c++/89325
+// { dg-do compile }
+// { dg-options "-Wattributes" }
+
+__attribute__((noinline)) void foo (int) {} // { dg-bogus "previous definition" }
+inline void foo (long); // { dg-bogus "inline declaration of '\[^\n\r]*' follows declaration with attribute 'noinline'" }
+inline void foo (long) {}
+__attribute__((noinline)) void bar (int) {} // { dg-message "previous definition" }
+inline void bar (int); // { dg-warning "inline declaration of '\[^\n\r]*' follows declaration with attribute 'noinline'" }