diff mbox series

[pushed] C++, testsuite: Adjust pure-virtual1.C options for Darwin.

Message ID 5E4F5178-C907-41BA-A397-D800E1BE15B3@sandoe.co.uk
State New
Headers show
Series [pushed] C++, testsuite: Adjust pure-virtual1.C options for Darwin. | expand

Commit Message

Iain Sandoe July 25, 2020, 8:50 p.m. UTC
Hi,

Darwin's static linker expects, by default, that all linkage will
be satisfied (even for weak items).  This allows the two-level
namespace to work even for weak cases.

However, there's an option to make it behave in a similar manner
to ELF.  This is needed for the pure-virtual1.C testcase to pass
on Darwin.

tested on x86_64-darwin and linux,
pushed to master
thanks
Iain

gcc/testsuite/ChangeLog:

	* g++.dg/abi/pure-virtual1.C: Add dynamic_lookup option
	for Darwin.
---
 gcc/testsuite/g++.dg/abi/pure-virtual1.C | 1 +
 1 file changed, 1 insertion(+)
diff mbox series

Patch

diff --git a/gcc/testsuite/g++.dg/abi/pure-virtual1.C b/gcc/testsuite/g++.dg/abi/pure-virtual1.C
index 86cc9f63db1..538e2cb097a 100644
--- a/gcc/testsuite/g++.dg/abi/pure-virtual1.C
+++ b/gcc/testsuite/g++.dg/abi/pure-virtual1.C
@@ -2,6 +2,7 @@ 
 // { dg-do link }
 // { dg-require-weak }
 // { dg-additional-options "-fno-rtti -nodefaultlibs -lc" }
+// { dg-additional-options "-Wl,-undefined,dynamic_lookup" { target *-*-darwin* } }
 // { dg-xfail-if "AIX weak" { powerpc-ibm-aix* } }
 
 struct A