C++, testsuite: Adjust pure-virtual1.C options for Darwin.
authorIain Sandoe <iain@sandoe.co.uk>
Sat, 25 Jul 2020 20:42:55 +0000 (21:42 +0100)
committerIain Sandoe <iain@sandoe.co.uk>
Sat, 25 Jul 2020 20:48:06 +0000 (21:48 +0100)
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.

gcc/testsuite/ChangeLog:

* g++.dg/abi/pure-virtual1.C: Add dynamic_lookup option
for Darwin.

gcc/testsuite/g++.dg/abi/pure-virtual1.C

index 86cc9f6..538e2cb 100644 (file)
@@ -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