[pushed] testsuite, Darwin: Allow for an undefined symbol [PR114036].

Message ID 20240402112844.86705-1-iain@sandoe.co.uk
State Committed
Commit ad8e34eaa870608e2b07b4e7147e6ef2944bb8b5
Headers
Series [pushed] testsuite, Darwin: Allow for an undefined symbol [PR114036]. |

Checks

Context Check Description
linaro-tcwg-bot/tcwg_gcc_build--master-arm warning Patch is already merged
linaro-tcwg-bot/tcwg_gcc_build--master-aarch64 warning Patch is already merged

Commit Message

Iain Sandoe April 2, 2024, 11:28 a.m. UTC
  Tested on x86_64-darwin17,21,23 and on x86_64 and powerpc64 linux gnu,
pushed to trunk, thanks
Iain

--- 8< ---

Darwin's linker defaults to requiring all symbols to be defined at
static link time (unless specifically noted or dynamic lookuo is
enabled).

For this test, we just need to note that the symbol is expected to
be undefined.

	PR testsuite/114036

gcc/testsuite/ChangeLog:

	* gcc.misc-tests/gcov-14.c: Allow for 'Foo' to be undefined
	on Darwin link lines.

Signed-off-by: Iain Sandoe <iain@sandoe.co.uk>
---
 gcc/testsuite/gcc.misc-tests/gcov-14.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
  

Patch

diff --git a/gcc/testsuite/gcc.misc-tests/gcov-14.c b/gcc/testsuite/gcc.misc-tests/gcov-14.c
index 2bebf7e4a93..61a9191c068 100644
--- a/gcc/testsuite/gcc.misc-tests/gcov-14.c
+++ b/gcc/testsuite/gcc.misc-tests/gcov-14.c
@@ -3,7 +3,7 @@ 
 /* { dg-do run { target native } } */
 /* { dg-options "-O2 -fprofile-arcs -ftest-coverage -fgnu89-inline" } */
 /* The following line arranges that Darwin has behavior like elf weak import.  */
-/* { dg-additional-options "-flat_namespace -undefined suppress" { target *-*-darwin* }  } */
+/* { dg-additional-options "-Wl,-U,_Foo" { target *-*-darwin* }  } */
 /* { dg-require-weak "" } */
 /* { dg-skip-if "undefined weak not supported" { { hppa*-*-hpux* } && { ! lp64 } } } */
 /* { dg-skip-if "undefined weak not supported" { powerpc-ibm-aix* } } */