From patchwork Tue Jan 17 20:00:09 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adhemerval Zanella X-Patchwork-Id: 63292 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 9DC253881D36 for ; Tue, 17 Jan 2023 20:02:44 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 9DC253881D36 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1673985764; bh=mCE/YFqXL4Z7i4zGFW/a0I/C1EeOtkop6T1+5F6jnvE=; 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=x2RG2KpUioZovg5PbLtGN6KpyhzlaL0hDCj+gtOj+RF7VJKo0qV/2+GPSl4gBvCxO kr0eoTeI4Q2oKG2UElKpy/+3D83SHP3vCwCKlVon61YcUbkgBgbejzB3SPpE+x0U4A s8uHgzhrBd4fK0xSJe6ejcNRnbUKoZ+rNcN0vZBY= X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from mail-oi1-x232.google.com (mail-oi1-x232.google.com [IPv6:2607:f8b0:4864:20::232]) by sourceware.org (Postfix) with ESMTPS id 3C772385703F for ; Tue, 17 Jan 2023 20:00:55 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 3C772385703F Received: by mail-oi1-x232.google.com with SMTP id r205so26873310oib.9 for ; Tue, 17 Jan 2023 12:00:55 -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=mCE/YFqXL4Z7i4zGFW/a0I/C1EeOtkop6T1+5F6jnvE=; b=WBEh1TJJgf4ghxfiboIpb+AmAZCQ9KiMUwBH3fMMX9+saqv+X4xC7asf7zHQvuspzV oFfkeG1XItEflU6Vx4mZhQxCIEWEhjM8MGd94/mZGYumImFGNFgObE0GSAL5N+cnKl3s kiTGu41jZfAWHUEoiOb4Ied4EZm1b0z3EpopTRdNPQTIlBMz2+qb3yUzNc5kbHmFoty4 9w6Js1lmdArQNgqYyYUS7HEkU2EamKAjENbkEU058tuzfx2P2w5F/Q+FDXHS3nDPkyEC 0dSvVCTKcDktcijQ7j8I3LkD7Xdod35mQ6+2Ru/tBKBT+2G0+xrEkebBq7l4gw+9lAzE KpPw== X-Gm-Message-State: AFqh2krQVZacUftIgJmYN8Aw8sVuAFRUglHoOhHWI+A1ADu3ryT/KDP1 7r3ovF/3pVDLk0gRGNe0PUP8BbCAQq1EI/vlpEY= X-Google-Smtp-Source: AMrXdXvtQetmnSWY6+H4I7a9PnxhOt7WoqF/iP3VUEhOVLma0VrQUqGpTjfXWkprSTl66cADgavxLw== X-Received: by 2002:aca:120a:0:b0:35e:a9d4:30d6 with SMTP id 10-20020aca120a000000b0035ea9d430d6mr12202621ois.44.1673985653973; Tue, 17 Jan 2023 12:00:53 -0800 (PST) Received: from mandiga.. ([2804:1b3:a7c1:1652:fbfc:c80a:f5e8:5ed9]) by smtp.gmail.com with ESMTPSA id l10-20020a056808020a00b00360e46a1edasm15095866oie.22.2023.01.17.12.00.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 17 Jan 2023 12:00:53 -0800 (PST) To: libc-alpha@sourceware.org, Richard Henderson , Noah Goldstein Subject: [PATCH v9 17/22] string: Hook up the default implementation on test-strlen Date: Tue, 17 Jan 2023 17:00:09 -0300 Message-Id: <20230117200014.1299923-18-adhemerval.zanella@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230117200014.1299923-1-adhemerval.zanella@linaro.org> References: <20230117200014.1299923-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" Also remove the simple_STRLEN and builtin_strlen, which are not used anywhere. --- 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)