From patchwork Thu Jun 23 21:21:18 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dimitar Dimitrov X-Patchwork-Id: 55345 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 9A1783850234 for ; Thu, 23 Jun 2022 21:22:00 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from server28.superhosting.bg (server28.superhosting.bg [217.174.156.11]) by sourceware.org (Postfix) with ESMTPS id 29A5A3850432 for ; Thu, 23 Jun 2022 21:21:44 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 29A5A3850432 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=dinux.eu Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=dinux.eu DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=dinux.eu; s=default; h=Content-Transfer-Encoding:MIME-Version:Message-Id:Date:Subject: Cc:To:From:Sender:Reply-To:Content-Type:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: In-Reply-To:References:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=Nf7MZOEXNkrkqT9FSRhxhSpYzLs9ZLAgCfBbJb8qlAA=; b=bNaRG5oL/1N20Ezn/7RGEaukAS aBt8MPDswR1vN5LY3+MRAPifL2UEqx+gGMBe4/tiSxCI7KB6N1Cwqg2xYmtiN4cMhUD6+79Gct8xp 0bnIKM1OtZ3wgt51neuQ1IgZttgxek1EpY1B0q7ueCk8hjqxV63K/SM9k1C9eCAzZUL53y2FL9G/A jvqy/grKsjrIcxQFvj4k+IoryR+IR5tVpTorxLiiRx2zlb87Tyrfimv1o6tpS3bV63e1xHaM0Sv1g iKyCGials68D7l/oOqRJurvNb34W/MsBS8JqGuccY60CBr17675VljsY8YLOPv+zetbyetQ+75cC2 /PxMQf3A==; Received: from [95.87.234.74] (port=58608 helo=kendros.lan) by server28.superhosting.bg with esmtpsa (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.95) (envelope-from ) id 1o4UGh-0000wH-5F; Fri, 24 Jun 2022 00:21:41 +0300 From: Dimitar Dimitrov To: gcc-patches@gcc.gnu.org Subject: [PATCH] testsuite: Adjust btf-bitfields-1.c for default_packed Date: Fri, 24 Jun 2022 00:21:18 +0300 Message-Id: <20220623212123.149019-1-dimitar@dinux.eu> X-Mailer: git-send-email 2.36.1 MIME-Version: 1.0 X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - server28.superhosting.bg X-AntiAbuse: Original Domain - gcc.gnu.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - dinux.eu X-Get-Message-Sender-Via: server28.superhosting.bg: authenticated_id: dimitar@dinux.eu X-Authenticated-Sender: server28.superhosting.bg: dimitar@dinux.eu X-Source: X-Source-Args: X-Source-Dir: X-Spam-Status: No, score=-12.0 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, 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 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: , Errors-To: gcc-patches-bounces+patchwork=sourceware.org@gcc.gnu.org Sender: "Gcc-patches" If target packs structures by default, the bitfield offset which the tests validates must be adjusted to not include padding. Ok for trunk? gcc/testsuite/ChangeLog: * gcc.dg/debug/btf/btf-bitfields-1.c: Adjust the checked offsets for targets which pack structures by default. CC: Jose E. Marchesi Signed-off-by: Dimitar Dimitrov --- gcc/testsuite/gcc.dg/debug/btf/btf-bitfields-1.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/gcc/testsuite/gcc.dg/debug/btf/btf-bitfields-1.c b/gcc/testsuite/gcc.dg/debug/btf/btf-bitfields-1.c index c6bf52130dc..4cb7ee84f83 100644 --- a/gcc/testsuite/gcc.dg/debug/btf/btf-bitfields-1.c +++ b/gcc/testsuite/gcc.dg/debug/btf/btf-bitfields-1.c @@ -5,7 +5,8 @@ (bit_size << 24) | bit_offset - (0xa << 24) | 0x20 - (0x7 << 24) | 0x2a - - (0x13 << 24) | 0x40 - note that this is aligned to 0x40. */ + - (0x13 << 24) | 0x40 - note that this is aligned to 0x40. + - (0x13 << 24) | 0x31 - in case structures are packed. */ /* { dg-do compile ) */ /* { dg-options "-O0 -gbtf -dA" } */ @@ -14,7 +15,8 @@ /* { dg-final { scan-assembler-times "\[\t \]0xa000020\[\t \]+\[^\n\]*btm_offset" 1 } } */ /* { dg-final { scan-assembler-times "\[\t \]0x700002a\[\t \]+\[^\n\]*btm_offset" 1 } } */ -/* { dg-final { scan-assembler-times "\[\t \]0x13000040\[\t \]+\[^\n\]*btm_offset" 1 } } */ +/* { dg-final { scan-assembler-times "\[\t \]0x13000040\[\t \]+\[^\n\]*btm_offset" 1 { target { ! default_packed } } } } */ +/* { dg-final { scan-assembler-times "\[\t \]0x13000031\[\t \]+\[^\n\]*btm_offset" 1 { target { default_packed } } } } */ struct bitt { int a;