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

--- 8< ---

Darwin's linker defaults to requiring all symbols to be resolved at static-
link time.  This test creates a shared object with two undefined symbols,
allow them for Darwin.

gcc/testsuite/ChangeLog:

        * gcc.dg/lto/pr99849_0.c: Allo baz and qux to be undefined at
        static-link time.

Signed-off-by: Iain Sandoe <[email protected]>
---
 gcc/testsuite/gcc.dg/lto/pr99849_0.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/gcc/testsuite/gcc.dg/lto/pr99849_0.c 
b/gcc/testsuite/gcc.dg/lto/pr99849_0.c
index 5c97a7c75a2..735b93ee90d 100644
--- a/gcc/testsuite/gcc.dg/lto/pr99849_0.c
+++ b/gcc/testsuite/gcc.dg/lto/pr99849_0.c
@@ -3,6 +3,7 @@
 /* { dg-require-effective-target fpic } */
 /* { dg-require-effective-target shared } */
 /* { dg-extra-ld-options { -shared } } */
+/* { dg-extra-ld-options "-shared -Wl,-U,_bar,-U,_qux" { target *-*-darwin* } 
} */
 /* { dg-lto-options { { -std=gnu17 -flto -flto-partition=1to1 -O2 
-Wno-incompatible-pointer-types -Wno-discarded-qualifiers -fPIC } } } */
 
 struct { struct A *a; } *b;
-- 
2.50.1 (Apple Git-155)

Reply via email to