Tested on x86_64-linux, darwin, i686-darwin, pushed to trunk,
thanks
Iain

--- 8< ---

Darwin predefines '__weak' for c-family which clashes with the use
in the test-case. Undefine it for the test purposes.

gcc/testsuite/ChangeLog:

        * gcc.dg/lto/attr-weakref-2_0.c: Undefine '__weak' for this
        test.

Signed-off-by: Iain Sandoe <[email protected]>
---
 gcc/testsuite/gcc.dg/lto/attr-weakref-2_0.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/gcc/testsuite/gcc.dg/lto/attr-weakref-2_0.c 
b/gcc/testsuite/gcc.dg/lto/attr-weakref-2_0.c
index a55ef28bd13..09e4fbef7e4 100644
--- a/gcc/testsuite/gcc.dg/lto/attr-weakref-2_0.c
+++ b/gcc/testsuite/gcc.dg/lto/attr-weakref-2_0.c
@@ -1,6 +1,9 @@
 /* { dg-lto-do link } */
 /* { dg-lto-options {{-O2 -flto}} } */
 
+#if __APPLE__
+# undef __weak
+#endif
 #define __weak __attribute__((__weak__))
 void __weak other() {}
 void __weak fn() {}
-- 
2.50.1 (Apple Git-155)

Reply via email to