From patchwork Wed Feb 1 17:04:03 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adhemerval Zanella Netto X-Patchwork-Id: 64110 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 8CBC6382E6BE for ; Wed, 1 Feb 2023 17:09:08 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 8CBC6382E6BE DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1675271348; bh=Sq2bS6OKH9OGVMzwrmwLBiFn09QfLa9qFmIoj/BIje4=; h=To:Subject:Date:In-Reply-To:References:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To: From; b=QwpOSKdx1qAvEpJA3dD2eZOwRg3d4q7HxgPzRgPC4mb9QtOVgI40piNVj8sCS+Yy1 bdFFqnvExWGpDuyLpiseO+4i1DEDvVNNuvHPY4dJwtvESc4n+FRZx5MokrulP4p/Sq GFrGqW0kJgNMGO9UZRPcxh5ms9uETStRrvWfQzAA= X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from mail-ot1-x329.google.com (mail-ot1-x329.google.com [IPv6:2607:f8b0:4864:20::329]) by sourceware.org (Postfix) with ESMTPS id B97653858412 for ; Wed, 1 Feb 2023 17:05:19 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org B97653858412 Received: by mail-ot1-x329.google.com with SMTP id 14-20020a9d010e000000b0068bdddfa263so2006347otu.2 for ; Wed, 01 Feb 2023 09:05:19 -0800 (PST) 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=Sq2bS6OKH9OGVMzwrmwLBiFn09QfLa9qFmIoj/BIje4=; b=IDq+o1ud3eFji/mtUJViXz0LrcW7cEs/B+afY2dCU5okRq0CDN9IXIDtxzlsPzLwvL apPYWvbr/SCvEos6QJrC5vOa2lQMXWKY1MmsLUqx7zFzJMyALREcs+Z4gZJcrGyy9ufT vKvqTi9nobnqcoB1nzfTHWpRxQmRy/da+6PI4VsaEspbPt/8aoSbNgaEnrNw6MmiRVM5 1QCAcoBP3JG0EmYiKrQUUPxzxlwQGNzJ5Pvjrv2R+zNGaaNPNpTfRbvgsA53RiXg71lX OIXPItaaI7zqr5S6I7n+II38BSfjC0YKJBaREPBUy9LHHbM/MWX/HBNzZma0uhHSUYCG UOhA== X-Gm-Message-State: AO0yUKVLKpl9jp72+oQQpMFsyienp32xYZuy4f/i7VW0SuVXdhVS+K7y Sm0eEZTYzGUbdzt2o1PKV+5009+9VTPk5RG3Rhg= X-Google-Smtp-Source: AK7set+AojViNtcByshiEsalowO0Xp8ZgxmgHAv98Uod1t9QwDKNXNpcD3ine8evgQ4yF+PWU5YAxQ== X-Received: by 2002:a9d:7b49:0:b0:68c:f7f5:f53d with SMTP id f9-20020a9d7b49000000b0068cf7f5f53dmr1677715oto.0.1675271118390; Wed, 01 Feb 2023 09:05:18 -0800 (PST) Received: from mandiga.. ([2804:1b3:a7c2:1887:d2ed:98c2:d2cc:bf06]) by smtp.gmail.com with ESMTPSA id b17-20020a056830311100b006863ccbf067sm8077090ots.74.2023.02.01.09.05.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 01 Feb 2023 09:05:17 -0800 (PST) To: libc-alpha@sourceware.org, Richard Henderson , Noah Goldstein , Jeff Law , Xi Ruoyao Subject: [PATCH v11 26/29] string: Hook up the default implementation on test-stpcpy Date: Wed, 1 Feb 2023 14:04:03 -0300 Message-Id: <20230201170406.303978-27-adhemerval.zanella@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230201170406.303978-1-adhemerval.zanella@linaro.org> References: <20230201170406.303978-1-adhemerval.zanella@linaro.org> MIME-Version: 1.0 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 X-BeenThere: libc-alpha@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Libc-alpha mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: Adhemerval Zanella via Libc-alpha From: Adhemerval Zanella Netto Reply-To: Adhemerval Zanella Errors-To: libc-alpha-bounces+patchwork=sourceware.org@sourceware.org Sender: "Libc-alpha" --- string/test-stpcpy.c | 32 +++++++++++++++++++++----------- 1 file changed, 21 insertions(+), 11 deletions(-) Reviewed-by: Richard Henderson 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"