From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 1791) id BBD8B3858C66; Mon, 6 Feb 2023 20:15:23 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org BBD8B3858C66 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1675714523; bh=uVw6vcME5LXvGmiXE2xipBeZFCRn2s7d2hQrm3ptcIQ=; h=From:To:Subject:Date:From; b=Rl52Zmeqra7wzcbNZe5QHAY9G+7zgz9WrNWizaDkJ9VScV3Ue9RSSAN2VqfyA4GGu LzFDRI9ikyIGkSXbb4tYOQeP/GxBgvviTqL0iXU8n0PI/J592qtxYMPwukFwe6dx/8 ZzX9oBhDtVq9yVVwBYOXchertqMMTCImpxxoiXPc= Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: Adhemerval Zanella To: glibc-cvs@sourceware.org Subject: [glibc] string: Hook up the default implementation on test-strcpy X-Act-Checkin: glibc X-Git-Author: Adhemerval Zanella X-Git-Refname: refs/heads/master X-Git-Oldrev: 11aabacce87227bbd5681b4f118b040544d3a0f9 X-Git-Newrev: 3092c84900ec08c7c5b6608489df39e24888a563 Message-Id: <20230206201523.BBD8B3858C66@sourceware.org> Date: Mon, 6 Feb 2023 20:15:23 +0000 (GMT) List-Id: https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=3092c84900ec08c7c5b6608489df39e24888a563 commit 3092c84900ec08c7c5b6608489df39e24888a563 Author: Adhemerval Zanella Date: Tue Jan 31 16:29:58 2023 -0300 string: Hook up the default implementation on test-strcpy Reviewed-by: Richard Henderson Diff: --- string/test-strcpy.c | 34 ++++++++++++++++++++++++---------- 1 file changed, 24 insertions(+), 10 deletions(-) diff --git a/string/test-strcpy.c b/string/test-strcpy.c index 8183c4b7f3..3e04c754d0 100644 --- a/string/test-strcpy.c +++ b/string/test-strcpy.c @@ -47,23 +47,37 @@ # endif # include "test-string.h" # ifndef WIDE -# define SIMPLE_STRCPY simple_strcpy # define STRCPY strcpy # else -# define SIMPLE_STRCPY simple_wcscpy # define STRCPY wcscpy # endif IMPL (STRCPY, 1) -/* Naive implementation to verify results. */ -CHAR * -SIMPLE_STRCPY (CHAR *dst, const CHAR *src) -{ - CHAR *ret = dst; - while ((*dst++ = *src++) != '\0'); - return ret; -} +/* Also check the generic implementation. */ +#undef STRCPY +#undef libc_hidden_builtin_def +#define libc_hidden_builtin_def(a) +#undef libc_hidden_def +#define libc_hidden_def(a) +#undef weak_alias +#define weak_alias(a,b) +#undef attribute_hidden +#define attribute_hidden +# ifndef WIDE +# define STPCPY __stpcpy_default +# include "string/stpcpy.c" +# define STRCPY __strcpy_default +# define __stpcpy __stpcpy_default +# include "string/strcpy.c" +IMPL (__strcpy_default, 1) +# else +# define __wcslen wcslen +# define __wmemcpy wmemcpy +# define WCSCPY __wcscpy_default +# include "wcsmbs/wcscpy.c" +IMPL (__wcscpy_default, 1) +# endif #endif typedef CHAR *(*proto_t) (CHAR *, const CHAR *);