public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [PATCH, testsuite] Fix gcc.dg/memcmp-1.c for targets using __USER_LABEL_PREFIX__
@ 2018-08-15 16:05 Iain Sandoe
  2018-08-15 16:43 ` Jeff Law
  0 siblings, 1 reply; 2+ messages in thread
From: Iain Sandoe @ 2018-08-15 16:05 UTC (permalink / raw)
  To: GCC Patches; +Cc: Mike Stump

Hi,

The test fails on Darwin (and presumably on other _U_L_P_ targets) because the asm-specified symbol isn’t found at link time.

OK for trunk?

thanks
Iain

gcc/testsuite:

	* gcc.dg/memcmp-1.c (lib_memcmp): Apply __USER_LABEL_PREFIX__.
	(lib_strncmp): Likewise.

diff --git a/gcc/testsuite/gcc.dg/memcmp-1.c b/gcc/testsuite/gcc.dg/memcmp-1.c
index a79db51..619cf9b 100644
--- a/gcc/testsuite/gcc.dg/memcmp-1.c
+++ b/gcc/testsuite/gcc.dg/memcmp-1.c
@@ -8,8 +8,13 @@
 #include <string.h>
 #include <stdint.h>
 
-int lib_memcmp(const void *a, const void *b, size_t n) asm("memcmp");
-int lib_strncmp(const char *a, const char *b, size_t n) asm("strncmp");
+#define STR1(X) #X
+#define STR2(X) STR1(X)
+
+int lib_memcmp(const void *a, const void *b, size_t n)
+ asm(STR2(__USER_LABEL_PREFIX__) "memcmp");
+int lib_strncmp(const char *a, const char *b, size_t n)
+ asm(STR2(__USER_LABEL_PREFIX__) "strncmp");
 
 #ifndef NRAND
 #ifdef TEST_ALL

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH, testsuite] Fix gcc.dg/memcmp-1.c for targets using __USER_LABEL_PREFIX__
  2018-08-15 16:05 [PATCH, testsuite] Fix gcc.dg/memcmp-1.c for targets using __USER_LABEL_PREFIX__ Iain Sandoe
@ 2018-08-15 16:43 ` Jeff Law
  0 siblings, 0 replies; 2+ messages in thread
From: Jeff Law @ 2018-08-15 16:43 UTC (permalink / raw)
  To: Iain Sandoe, GCC Patches; +Cc: Mike Stump

On 08/15/2018 10:05 AM, Iain Sandoe wrote:
> Hi,
> 
> The test fails on Darwin (and presumably on other _U_L_P_ targets) because the asm-specified symbol isn’t found at link time.
> 
> OK for trunk?
> 
> thanks
> Iain
> 
> gcc/testsuite:
> 
> 	* gcc.dg/memcmp-1.c (lib_memcmp): Apply __USER_LABEL_PREFIX__.
> 	(lib_strncmp): Likewise.
OK.
jeff

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2018-08-15 16:43 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-08-15 16:05 [PATCH, testsuite] Fix gcc.dg/memcmp-1.c for targets using __USER_LABEL_PREFIX__ Iain Sandoe
2018-08-15 16:43 ` Jeff Law

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).