From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-ot1-x331.google.com (mail-ot1-x331.google.com [IPv6:2607:f8b0:4864:20::331]) by sourceware.org (Postfix) with ESMTPS id 0B73B38493CA for ; Thu, 2 Feb 2023 18:13:01 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 0B73B38493CA 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-ot1-x331.google.com with SMTP id k91-20020a9d19e4000000b0068bca1294aaso690757otk.8 for ; Thu, 02 Feb 2023 10:13:01 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date:message-id :reply-to; bh=yp7d9ZhXZEifCrrQc8AHjNoV8JRIdvNw91N1+33ZME8=; b=dkHLeFYYGcwJb+cGbn39TanZ2d+JLZW/W2Gy1BU0xuAwcas65HRr5J8xeghrHmxyKp GSPPRI88RMtls9/Uj6mZjKS3Co1slc8vUZJYdwizmUQDRyMe2tMy+z2jtGHPGtoYddUn y5ebvYBRXnaMR0QhAL0lWPZokQNsOVoWX4nhbPl6x7LOoOcuRZrdlbacueCyO/kCLS9o cHr0HtDsBAIkm1p+Od0s8oJb+gfwSEzoycQggsPZuOiPJsjMJdxvx/XEvUscE9W5i+4L xZdWpf/+C75JUvqOpd/R1V0J2/UtBKwQ/xNWpohzILl9l858JrjFd5/lCWezzWqAd99V Anbw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=yp7d9ZhXZEifCrrQc8AHjNoV8JRIdvNw91N1+33ZME8=; b=MeitFy2CimYoYX3D8Ht6bo94n2Uz/bosx/g+qkIwo34mJlLklt4RxY8QB7x+cnhyDZ nic8ZLUAHomgrSjB26k/ubabE6Dmpy/4ItvzwWh5kBhXk2a8ejq3R5L4590mtMTTzeqV UZICRhwn7glfO4ZIDhKwGIzs2koLOOGUASx97hRzxVJDEUe1CIb9Hw9s0kWP+lDClmrn Lbsm3RAwvg++DZebV0Ena4UUvv8i9ioomkUoPyAIYfZjNy5YTPDSiql2qPoZhV9c5hPu koIxnB072SQfrfgHUxRA90Ha1t72LaJgM3bxIkWRGgXpxFUBO10R5RfyxHVGBhVdQrza mNLw== X-Gm-Message-State: AO0yUKXMh8zbvEPU7tEYsxLgPqh+NBDyGQnxGROQj92DauKwUZh6WFhz DZA10MJQFRtqLVXqEh1S6kR1loi4jzrR2CnMfKE= X-Google-Smtp-Source: AK7set887IVlMidrSuLGfY2dZL4kVI5y3BUQ5RUWfZctl2Wqy55tQwgnmj4miVIk9oVquF2GIPaC3w== X-Received: by 2002:a9d:588d:0:b0:685:134:b73d with SMTP id x13-20020a9d588d000000b006850134b73dmr3166169otg.23.1675361580228; Thu, 02 Feb 2023 10:13:00 -0800 (PST) Received: from mandiga.. ([2804:1b3:a7c2:1887:da12:b9d3:2162:a28c]) by smtp.gmail.com with ESMTPSA id ci10-20020a05683063ca00b00684a10970adsm126689otb.16.2023.02.02.10.12.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 02 Feb 2023 10:12:59 -0800 (PST) From: Adhemerval Zanella To: libc-alpha@sourceware.org, Richard Henderson , Jeff Law , Xi Ruoyao , Noah Goldstein Subject: [PATCH v12 27/31] string: Hook up the default implementation on test-stpcpy Date: Thu, 2 Feb 2023 15:11:45 -0300 Message-Id: <20230202181149.2181553-28-adhemerval.zanella@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230202181149.2181553-1-adhemerval.zanella@linaro.org> References: <20230202181149.2181553-1-adhemerval.zanella@linaro.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-12.8 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,GIT_PATCH_0,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: Reviewed-by: Richard Henderson --- string/test-stpcpy.c | 32 +++++++++++++++++++++----------- 1 file changed, 21 insertions(+), 11 deletions(-) diff --git a/string/test-stpcpy.c b/string/test-stpcpy.c index c7a416f93a..5d344b6a23 100644 --- a/string/test-stpcpy.c +++ b/string/test-stpcpy.c @@ -26,26 +26,36 @@ #include "test-string.h" #ifndef WIDE # define CHAR char -# define SIMPLE_STPCPY simple_stpcpy # define STPCPY stpcpy #else # include # define CHAR wchar_t -# define SIMPLE_STPCPY simple_wcpcpy # define STPCPY wcpcpy #endif /* !WIDE */ -CHAR *SIMPLE_STPCPY (CHAR *, const CHAR *); - -IMPL (SIMPLE_STPCPY, 0) IMPL (STPCPY, 1) -CHAR * -SIMPLE_STPCPY (CHAR *dst, const CHAR *src) -{ - while ((*dst++ = *src++) != '\0'); - return dst - 1; -} +/* Also check the generic implementation. */ +#undef STPCPY +#undef weak_alias +#define weak_alias(a, b) +#undef libc_hidden_def +#define libc_hidden_def(a) +#undef libc_hidden_builtin_def +#define libc_hidden_builtin_def(a) +#undef attribute_hidden +#define attribute_hidden +#ifndef WIDE +# define STPCPY __stpcpy_default +# include "string/stpcpy.c" +IMPL (__stpcpy_default, 1) +#else +# define __wcslen wcslen +# define __wmemcpy wmemcpy +# define WCPCPY __wcpcpy_default +# include "wcsmbs/wcpcpy.c" +IMPL (__wcpcpy_default, 1) +#endif #undef CHAR #include "test-strcpy.c" -- 2.34.1