From patchwork Thu Feb 2 18:11:45 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adhemerval Zanella X-Patchwork-Id: 64180 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 0DC5A3896C17 for ; Thu, 2 Feb 2023 18:16:22 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 0DC5A3896C17 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1675361782; bh=yp7d9ZhXZEifCrrQc8AHjNoV8JRIdvNw91N1+33ZME8=; 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=rYCApkDXnqU2SUYBziqoafcnmNszvc78lxiUW5RyBOI3PQjXOr800OAY7AHhJn2jn /ZDHwbcNmy6F9l5wWIuJ5w36/I1feBUAXRrAkUSxriUa2Oerzt+5fnJzXvwTgNRJZY EFDEOsR0dHNuI/fa+NFG9KWa4sjIw50jPvCh4ejs= X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org 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 Received: by mail-ot1-x331.google.com with SMTP id k91-20020a9d19e4000000b0068bca1294aaso690757otk.8 for ; Thu, 02 Feb 2023 10:13:01 -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=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) 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 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 Reply-To: Adhemerval Zanella Errors-To: libc-alpha-bounces+patchwork=sourceware.org@sourceware.org Sender: "Libc-alpha" 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"