From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pl1-x62a.google.com (mail-pl1-x62a.google.com [IPv6:2607:f8b0:4864:20::62a]) by sourceware.org (Postfix) with ESMTPS id D76B43858033 for ; Wed, 1 Feb 2023 17:56:47 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org D76B43858033 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=linaro.org Received: by mail-pl1-x62a.google.com with SMTP id h9so10634864plf.9 for ; Wed, 01 Feb 2023 09:56:47 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=content-transfer-encoding:in-reply-to:from:references:to :content-language:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=QxxhdU0WwD5rpiik4oS4KyGekL6IzCnUY1pb8VDy/XA=; b=WAY7bMKt0e1DPkSr8nKvCZBToaCwhX1GO5XPAplxmVdWW1rCP9ypQnrAxUrxsJSxyd A3au1wwM073xF4MnCVelyUB+IWpXxV6/NFppu4SHBV6OY9JUtCCbiBOczC5fD7fGCg4H YTHc3bmbkKvD1sRoitj8gUbqa5RWVKYd5MIelb3g7pdIxHX6TGzotlvf6FMcRMOPOedD myHW+8/25089guCcYC3pTb5YpBJyOm4FGvdNHLyXQhqDrbH14V5AVsquP4X81nZ0owqu Mn5+aCn09BywwyscqTQIABmLOP9x3mRYaTDLLtj50M7GK6NRYCcMUjZ2jgg1GWFNp8kI 3mrg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:in-reply-to:from:references:to :content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=QxxhdU0WwD5rpiik4oS4KyGekL6IzCnUY1pb8VDy/XA=; b=nac4WjWQg7W7DIwS6Dxuz5CSMOhQncTqWP0/yOc7x2f5UR34xqFxvBot9GNKfsdTVM uOVXhFAxKFS/PediJWbi3wmB1OC7709VnGFGK7lXmBmln27VTsJ4DoeGn95SXylWGYN9 espzHCvZHR5yeBlyqu8Z9QtzZ5m4gyRRwTIvN3T/f6MCXLEfkoEDAYDiWlr4vuzltlK/ ZgrqbBt50efJZdQenrpdl5kHjKpEQPYJlfcFsui2mS263KEEdW8hw7LSBepnvUEzJyDF OXEMkHFdyQmZpu4pTATI0NdrO/em9S2Asj+AYUlh8XzWqaF3NP1WR1MeNw9veb15zYsx bNTQ== X-Gm-Message-State: AO0yUKUoywSvaeRFAksOGX8WzF2tP2O8SzmVQg1zTrhzv0J1p1L5cVwR Aml8uFkfmPmUkfQfM9lV3aeDvg== X-Google-Smtp-Source: AK7set9iG0HEHBFL9jYx30eTF3snbfk+odwvK/N1wA9nx0U+qG7mQzfrqwJpaaAVmlgil+XLgwNqAg== X-Received: by 2002:a17:902:e801:b0:196:89ba:349 with SMTP id u1-20020a170902e80100b0019689ba0349mr4544326plg.64.1675274206929; Wed, 01 Feb 2023 09:56:46 -0800 (PST) Received: from [192.168.50.50] (rrcs-173-197-98-118.west.biz.rr.com. [173.197.98.118]) by smtp.gmail.com with ESMTPSA id p15-20020a170902a40f00b00195e77c20a9sm12066013plq.163.2023.02.01.09.56.45 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 01 Feb 2023 09:56:46 -0800 (PST) Message-ID: <55d9ba3f-db7b-bb80-1fa0-553312e6ddc2@linaro.org> Date: Wed, 1 Feb 2023 07:56:43 -1000 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.4.2 Subject: Re: [PATCH v11 27/29] string: Hook up the default implementation on test-strcpy Content-Language: en-US To: Adhemerval Zanella , libc-alpha@sourceware.org, Noah Goldstein , Jeff Law , Xi Ruoyao References: <20230201170406.303978-1-adhemerval.zanella@linaro.org> <20230201170406.303978-28-adhemerval.zanella@linaro.org> From: Richard Henderson In-Reply-To: <20230201170406.303978-28-adhemerval.zanella@linaro.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-11.6 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,GIT_PATCH_0,NICE_REPLY_A,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: On 2/1/23 07:04, Adhemerval Zanella wrote: > --- > string/test-strcpy.c | 34 ++++++++++++++++++++++++---------- > 1 file changed, 24 insertions(+), 10 deletions(-) Reviewed-by: Richard Henderson r~ > > 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 *);