From patchwork Thu Feb 2 18:11:40 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: 64177 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 96B5F38582BC for ; Thu, 2 Feb 2023 18:15:36 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 96B5F38582BC DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1675361736; bh=EdEacAiDNy91IxfCbhUa2BV1sVEmxuELNg72O36/HDw=; 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=nzqJzuikNwFtVTmIXxEAygdirx3v+o21J8faTxVKVfOThvojPAuvKq3OgTKhNjw6u Y3sllJnJPn1VXd/K8WBcSECSAvWSvnsfDkxxs7V0yRRzKnDOLjTMZZxBQ/q/nFM4KC G/QjuJyRmxWc+aFKmtnENPxEmKobTy+UIX57L/Rc= X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from mail-ot1-x336.google.com (mail-ot1-x336.google.com [IPv6:2607:f8b0:4864:20::336]) by sourceware.org (Postfix) with ESMTPS id D619D3858004 for ; Thu, 2 Feb 2023 18:12:49 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org D619D3858004 Received: by mail-ot1-x336.google.com with SMTP id v24-20020a05683011d800b0068bdd29b160so681536otq.13 for ; Thu, 02 Feb 2023 10:12:49 -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=EdEacAiDNy91IxfCbhUa2BV1sVEmxuELNg72O36/HDw=; b=LsjLS/3/acnEp8tLoSK5bncvsotfGOi4IT6kKNsoeb4Rt6ylLwx89koMuZBZTs/D4u z7GI70ak/hXiZMeejqZ1Go4kb1LuAzwqnQphruw730Rn3lI++wYAqkkgqMqXl4n146HB FOowKXhOamqQeL5jL2Ef7lMUBKV+cdV2auNS8XMqY4tVCWCox/8v7Tyy5qYXIAC01d09 Ek7uUMA0kqkXpDRIoJ6wZNbOlPR68hlOKHp/QZ1sWDfLVu0bLSrHbbSBd/sSkn5TWQys SjuSbLmk7hDa85SoRR4DC1yU+umgukFqk33jB+Yp26eCH8/yoDy5pZCIHtNRycJzWyBY gIpA== X-Gm-Message-State: AO0yUKUjmm08cqlfIor3OqT9DZY2tnyDR+gTw4Vs3GLqR6HLyUWhaYFe QTt49FkKukkP1iYqeCbb7fyZ7lRXfYGlWo+IHbk= X-Google-Smtp-Source: AK7set95smygH1c1xDZSEC1GlyoaI33PKqV9MHqgxSBWKKA+RaARy85sH2cEUApKWqo0+IPuSMD8ww== X-Received: by 2002:a9d:3e7:0:b0:68b:e3c5:6eb0 with SMTP id f94-20020a9d03e7000000b0068be3c56eb0mr1145196otf.22.1675361568782; Thu, 02 Feb 2023 10:12:48 -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.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 02 Feb 2023 10:12:47 -0800 (PST) To: libc-alpha@sourceware.org, Richard Henderson , Jeff Law , Xi Ruoyao , Noah Goldstein Subject: [PATCH v12 22/31] string: Hook up the default implementation on test-strlen Date: Thu, 2 Feb 2023 15:11:40 -0300 Message-Id: <20230202181149.2181553-23-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 Netto Reply-To: Adhemerval Zanella Errors-To: libc-alpha-bounces+patchwork=sourceware.org@sourceware.org Sender: "Libc-alpha" Also remove the simple_STRLEN and builtin_strlen, which are not used anywhere. Reviewed-by: Richard Henderson --- string/test-strlen.c | 31 ++++++++++++++----------------- 1 file changed, 14 insertions(+), 17 deletions(-) diff --git a/string/test-strlen.c b/string/test-strlen.c index 81adf23737..0f98576f40 100644 --- a/string/test-strlen.c +++ b/string/test-strlen.c @@ -37,27 +37,24 @@ typedef size_t (*proto_t) (const CHAR *); -/* Naive implementation to verify results. */ -size_t -simple_STRLEN (const CHAR *s) -{ - const CHAR *p; - - for (p = s; *p; ++p); - return p - s; -} +IMPL (STRLEN, 1) +/* Also check the generic implementation. */ +#undef STRLEN +#undef weak_alias +#define weak_alias(a, b) +#undef libc_hidden_builtin_def +#define libc_hidden_builtin_def(a) #ifndef WIDE -size_t -builtin_strlen (const CHAR *p) -{ - return __builtin_strlen (p); -} -IMPL (builtin_strlen, 0) +# define STRLEN __strlen_default +# include "string/strlen.c" +IMPL (__strlen_default, 1) +#else +# define WCSLEN __wcslen_default +# include "wcsmbs/wcslen.c" +IMPL (__wcslen_default, 1) #endif -IMPL (STRLEN, 1) - static void do_one_test (impl_t *impl, const CHAR *s, size_t exp_len)