From patchwork Wed Feb 1 14:38:31 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hans-Peter Nilsson X-Patchwork-Id: 64085 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 5CFC73858004 for ; Wed, 1 Feb 2023 14:39:02 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 5CFC73858004 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1675262342; bh=15BjiSOxVKJcYbwT4VJRZPI/VY+jkkyNY1hTPaJwVJ4=; h=To:Subject:Date:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:From; b=aYr2vOiET9iqgLNp8KmuKppCx+tMhDaIJpcNW1Iqxi9gKmHmP0lV6BsFz7B61w6A2 jG8D9eng6uEjmlwBJ7MJyGSPL4n9I55tdvczE7sUyvYTbtYk98paophU88+MgbGfeL ReS/PCOsjICl+kni13N/pXqBbuMh0SL8KnE9eMnM= X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from smtp2.axis.com (smtp2.axis.com [195.60.68.18]) by sourceware.org (Postfix) with ESMTPS id 5E6D13858C36; Wed, 1 Feb 2023 14:38:33 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 5E6D13858C36 To: , Subject: [PATCH] libstdc++ testsuite: Correct S0 in std/time/hh_mm_ss/1.cc MIME-Version: 1.0 Message-ID: <20230201143831.BDA3A20423@pchp3.se.axis.com> Date: Wed, 1 Feb 2023 15:38:31 +0100 X-Spam-Status: No, score=-10.9 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, SPF_HELO_PASS, 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: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: Hans-Peter Nilsson via Gcc-patches From: Hans-Peter Nilsson Reply-To: Hans-Peter Nilsson Errors-To: gcc-patches-bounces+patchwork=sourceware.org@gcc.gnu.org Sender: "Gcc-patches" Tested cris-elf and native x86_64-pc-linux-gnu. Ok to commit? -----8< ------ For targets where the ABI mandates structure layout that has no padding, like cris-elf, this test started failing when introduced as an add-on to the existing 1.cc, thereby effectively causing a regression in testsuite results. Adding an empty structure to S0, corresponds better to the layout of hh_mm_ss. PR testsuite/108632 * testsuite/std/time/hh_mm_ss/1.cc (size): Add empty struct at end of S0. --- libstdc++-v3/testsuite/std/time/hh_mm_ss/1.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libstdc++-v3/testsuite/std/time/hh_mm_ss/1.cc b/libstdc++-v3/testsuite/std/time/hh_mm_ss/1.cc index d97a9057f472..26a4555576c8 100644 --- a/libstdc++-v3/testsuite/std/time/hh_mm_ss/1.cc +++ b/libstdc++-v3/testsuite/std/time/hh_mm_ss/1.cc @@ -103,7 +103,7 @@ size() { using namespace std::chrono; - struct S0 { long long h; char m; char s; bool neg; }; + struct S0 { long long h; char m; char s; bool neg; struct { } empty; }; static_assert(sizeof(hh_mm_ss) == sizeof(S0)); struct S1 { long long h; char m; char s; bool neg; char ss; }; static_assert(sizeof(hh_mm_ss>) == sizeof(S1));