https://gcc.gnu.org/g:8f0912e5a88a3470145725e7b00a65770658f335
commit r17-3960-g8f0912e5a88a3470145725e7b00a65770658f335 Author: Iain Sandoe <[email protected]> Date: Sat Sep 5 16:17:42 2026 +0100 testsuite, Darwin: Handle __weak predefine. 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]> Diff: --- 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 a55ef28bd131..09e4fbef7e4b 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() {}
