From patchwork Tue May 30 06:42:56 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Zhangjin Wu X-Patchwork-Id: 100570 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:994d:0:b0:3d9:f83d:47d9 with SMTP id k13csp1981069vqr; Mon, 29 May 2023 23:49:33 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ4yOdVf2Jhky8oCKrmgd0fLzCyJM+wlvXN7L0lL3HJHdUbjA30+fa9/Ni7g5eTIqzqL3bVz X-Received: by 2002:a05:6a00:124a:b0:64f:bf12:a7f7 with SMTP id u10-20020a056a00124a00b0064fbf12a7f7mr1837316pfi.5.1685429372987; Mon, 29 May 2023 23:49:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1685429372; cv=none; d=google.com; s=arc-20160816; b=f//c4K4Kj6rAnkotjT4ib4359h49PglZsMbTSQyjVSzQb/Zn3CZyi7AgdDVMyFoTpi +eWYES7HX6fGuTBlpgZKzOXAJkDsW70jgaDgBFkUdJxM31LxMZ3meklNMbcmfPPJLjqd lmGAdn2o4jxTqwEHugwQaBfXt5DB7q9PtWIa4zfWVLNAI6gXPmgaK06e0cwt3kqXrGT6 FSF2o8iXBgjgcYf4hAUZkK69Oh4VsGZo82368akwaSNaFdBqc52aYOOp5UPS/8CRbRfV 2UiODvkIZF2UtAEZpgzMOajcHv1NJaTMJ1weQ39R2EQMmfOZIAaEIYf1t2kPlr8H8C73 j8Vw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:feedback-id:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from; bh=kuSRXXrz2Aq6Dou0pVIoYRl3EuwNWdAtG28eYZ2g8C0=; b=GAUgJmqlMYePj/LpzHFafUlj1ndbWVDac8Cm5AmS6iSWC2/VtlOkdhoo9RAylhZUfh Jhk1j3O4cefuEr55VlK2+/whiVdvEvGsV0lcHvsBynPjZDLqlH7jt919TNasG07a8wXC 10hwuYu3pKB5Ib4FAZSOvKZVV4o5d28vYEe0mxp+Nt8HvurDI4vs4mzobsS0UnzNp6T6 AZOU0pROcB2GMnOKkm4pmm29+EzjdIJjk9ImyxxDPaXkdXQLY2HCyqrj6NMvTIrLfhmG JlOdgV4+9y3e5AF8DJ8NRm6JyFuchtrzbT9pJCx8rEcR69YnZGdQaYpn+j9M5sGl5BWw kHlg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id o18-20020aa79792000000b0063b669ec9a0si1280099pfp.103.2023.05.29.23.49.18; Mon, 29 May 2023 23:49:32 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230082AbjE3GnP (ORCPT + 99 others); Tue, 30 May 2023 02:43:15 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60990 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229752AbjE3GnM (ORCPT ); Tue, 30 May 2023 02:43:12 -0400 Received: from bg4.exmail.qq.com (bg4.exmail.qq.com [43.154.221.58]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D967AB2; Mon, 29 May 2023 23:43:09 -0700 (PDT) X-QQ-mid: bizesmtp82t1685428979t23ocw7f Received: from linux-lab-host.localdomain ( [119.123.130.226]) by bizesmtp.qq.com (ESMTP) with id ; Tue, 30 May 2023 14:42:58 +0800 (CST) X-QQ-SSF: 01200000000000D0V000000A0000000 X-QQ-FEAT: QityeSR92A2o5sTwmGCD+PqYMSq7MB3IEE8O3t1qtWOzFpvckQlLvvdZrNOgE uarJb402gzy9fGIWVhjEYpQDyVh3pANl+z9B3bRnf03I3oT4Z8IS23/bof7tQtzq8n306zg rfkF9nyJz0EwgB6+lRhH48uRW1Yn26Wa63FhSP+VEpWjL4h88ydg+O9QTlN1tjcPMc1t78H Lu0IRV35MhW/3iu3iLPjt2I6GN62hUKHRs8usz00u+QHRmd27bfqhcoZ1YUR/uHt3KJZ/Vw tQDkvr5b+CSZZca3/Zlcg1e1Kta/IIJVePMt3sGEWhxF7kPE1xfj8pZlQvEA7kEfwwJmTWj SiRjvuntBLs2VvV4oWQ47+LPVOAvuJ4gnoct3RfMo8LyztoU7oMHjwGgkJujDhOIhrVpOhd X-QQ-GoodBg: 0 X-BIZMAIL-ID: 9349735140151722294 From: Zhangjin Wu To: w@1wt.eu Cc: falcon@tinylab.org, arnd@arndb.de, linux-kernel@vger.kernel.org, linux-kselftest@vger.kernel.org, linux-riscv@lists.infradead.org, thomas@t-8ch.de Subject: [PATCH 2/2] selftests/nolibc: add sizeof test for the new 64bit data types Date: Tue, 30 May 2023 14:42:56 +0800 Message-Id: X-Mailer: git-send-email 2.25.1 In-Reply-To: References: MIME-Version: 1.0 X-QQ-SENDSIZE: 520 Feedback-ID: bizesmtp:tinylab.org:qybglogicsvrsz:qybglogicsvrsz3a-3 X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1767300790368721289?= X-GMAIL-MSGID: =?utf-8?q?1767300790368721289?= These test cases are required to make sure the new added data types are really 64bit based. Signed-off-by: Zhangjin Wu --- tools/testing/selftests/nolibc/nolibc-test.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/tools/testing/selftests/nolibc/nolibc-test.c b/tools/testing/selftests/nolibc/nolibc-test.c index 20d184da9a2b..43ce4d34b596 100644 --- a/tools/testing/selftests/nolibc/nolibc-test.c +++ b/tools/testing/selftests/nolibc/nolibc-test.c @@ -721,6 +721,14 @@ int run_stdlib(int min, int max) #else # warning "__SIZEOF_LONG__ is undefined" #endif /* __SIZEOF_LONG__ */ + CASE_TEST(sizeof_time_t); EXPECT_EQ(1, 8, sizeof(time_t)); break; + CASE_TEST(sizeof_timespec); EXPECT_EQ(1, 16, sizeof(struct timespec)); break; +#ifdef NOLIBC + CASE_TEST(sizeof_itimerspec); EXPECT_EQ(1, 32, sizeof(struct itimerspec)); break; +#endif + CASE_TEST(sizeof_timeval); EXPECT_EQ(1, 16, sizeof(struct timeval)); break; + CASE_TEST(sizeof_itimerval); EXPECT_EQ(1, 32, sizeof(struct itimerval)); break; + CASE_TEST(sizeof_off_t); EXPECT_EQ(1, 8, sizeof(off_t)); break; case __LINE__: return ret; /* must be last */ /* note: do not set any defaults so as to permit holes above */