From patchwork Wed Mar 27 11:16:44 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jakub Jelinek X-Patchwork-Id: 1916707 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=cM4l+uVv; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=gcc.gnu.org (client-ip=8.43.85.97; helo=server2.sourceware.org; envelope-from=gcc-patches-bounces+incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=patchwork.ozlabs.org) Received: from server2.sourceware.org (server2.sourceware.org [8.43.85.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4V4PJx3xG9z1yWr for ; Wed, 27 Mar 2024 22:17:19 +1100 (AEDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id DA6503861C56 for ; Wed, 27 Mar 2024 11:17:17 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by sourceware.org (Postfix) with ESMTPS id 9049A385DC06 for ; Wed, 27 Mar 2024 11:16:58 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 9049A385DC06 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=redhat.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 9049A385DC06 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=170.10.129.124 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1711538220; cv=none; b=eFOllozWJWfrPJmYLQ1ZL1jAgbHnSthBGpAXKVmNKc7CdosYJfS/kUX/iLcfpDPk+fFKHVgI20eY1ZkBfh9IOOtHfE+F/3XZmN2Xpb21Kb1sgxnmzy/J6gNS3Dz7tbvfkDrESvep93S2d5C7X5sBiviefcIdVjD9S2qikCgQecA= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1711538220; c=relaxed/simple; bh=9p3Pl4PZ0f8o6+vm/plLZQjZLMKDvngb8EQfjHb/5iY=; h=DKIM-Signature:Date:From:To:Subject:Message-ID:MIME-Version; b=xIB7hdmRpH0ecQMgBUvfza6NUt0I6IYtsyZHzyuq5jH700z/sH24q3daa/KCvtLP16yRdy498b1GzpccVsUckwPzS8HZsNpPoYqeTnVADZbkCJpPvy+e4G2+IKJb+G6V41yNgRqkM6msA+L27wU+sXDqgnU23VVwUmCPhpgCVKk= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1711538218; h=from:from:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type:in-reply-to:in-reply-to: references:references; bh=mjtdoLOFEyADPVrcCB6BImMeHjIH29bbS6JQX1OqZhc=; b=cM4l+uVvjiPAWY6BJq9OWVRXdu+XlBpwZWXXVRKRtoSUb6b0aCzicL+XHUp4LtdKXGwJPA 9Ts2hs9orvmvyWYCLTjQZn0HXIK/FV/mWYG4dfYQsFP5rXGJ9vXHKNO0BsZUTYe1r+0dhg XmbQbgjjhKSYUju7O/rfGSuYA3HG7Vk= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-149-ao2GnpDeO9CLgR6x8JxMTQ-1; Wed, 27 Mar 2024 07:16:52 -0400 X-MC-Unique: ao2GnpDeO9CLgR6x8JxMTQ-1 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.rdu2.redhat.com [10.11.54.5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 6C7AE8007A4; Wed, 27 Mar 2024 11:16:52 +0000 (UTC) Received: from tucnak.zalov.cz (unknown [10.39.192.57]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 2EF841074E; Wed, 27 Mar 2024 11:16:52 +0000 (UTC) Received: from tucnak.zalov.cz (localhost [127.0.0.1]) by tucnak.zalov.cz (8.17.1/8.17.1) with ESMTPS id 42RBGjRs1693855 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NOT); Wed, 27 Mar 2024 12:16:45 +0100 Received: (from jakub@localhost) by tucnak.zalov.cz (8.17.1/8.17.1/Submit) id 42RBGiSe1693854; Wed, 27 Mar 2024 12:16:44 +0100 Date: Wed, 27 Mar 2024 12:16:44 +0100 From: Jakub Jelinek To: indu.bhagat@oracle.com, david.faust@oracle.com Cc: gcc-patches@gcc.gnu.org Subject: [PATCH] btf: Fix up btf-datasec-1.c test on x86 Message-ID: References: <20240326142852.418737-1-cupertino.miranda@oracle.com> MIME-Version: 1.0 In-Reply-To: X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.5 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Disposition: inline X-Spam-Status: No, score=-3.2 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, KAM_NUMSUBJECT, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H4, RCVD_IN_MSPIKE_WL, SPF_HELO_NONE, SPF_NONE, TXREP autolearn=no 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.30 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: Jakub Jelinek Errors-To: gcc-patches-bounces+incoming=patchwork.ozlabs.org@gcc.gnu.org On Wed, Mar 27, 2024 at 11:18:49AM +0100, Jakub Jelinek wrote: > > -/* The offset entry for each variable in a DATSEC should be 0 at compile time. */ > > -/* { dg-final { scan-assembler-times "0\[\t \]+\[^\n\]*bts_offset" 7 } } */ > > +/* The offset entry for each variable in a DATSEC should contain a label. */ > > +/* { dg-final { scan-assembler-times ".4byte\[\t \]\[a-e\]\[\t \]+\[^\n\]*bts_offset" 5 } } */ > > 4byte is used only on some targets, what exact assembler directive is used > for 4byte unaligned data is heavily target dependent. Now in patch form, tested on x86_64-linux with make check-gcc RUNTESTFLAGS='--target_board=unix\{-m32,-m64\} btf.exp' ok for trunk? 2024-03-27 Jakub Jelinek * gcc.dg/debug/btf/btf-cvr-quals-1.c: Use dg-additional-options instead of multiple dg-options. * gcc.dg/debug/btf/btf-datasec-1.c: Likewise. Accept all supported unaligned 4 byte assembler directives rather than assuming it must be .4byte. Jakub --- gcc/testsuite/gcc.dg/debug/btf/btf-cvr-quals-1.c.jj 2021-07-12 22:57:26.056103708 +0200 +++ gcc/testsuite/gcc.dg/debug/btf/btf-cvr-quals-1.c 2024-03-27 12:09:25.383278017 +0100 @@ -23,7 +23,7 @@ /* { dg-do compile } */ /* { dg-options "-O0 -gbtf -dA" } */ -/* { dg-options "-O0 -gbtf -gdwarf-4 -dA" { target { *-*-darwin* } } } */ +/* { dg-additional-options "-gdwarf-4" { target { *-*-darwin* } } } */ /* { dg-final { scan-assembler-times "ascii \"int.0\"\[\t \]+\[^\n\]*btf_string" 1 } } */ --- gcc/testsuite/gcc.dg/debug/btf/btf-datasec-1.c.jj 2024-03-26 22:34:47.925757342 +0100 +++ gcc/testsuite/gcc.dg/debug/btf/btf-datasec-1.c 2024-03-27 12:12:09.761045873 +0100 @@ -11,16 +11,16 @@ /* { dg-do compile ) */ /* { dg-options "-O0 -gbtf -dA" } */ -/* { dg-options "-O0 -gbtf -dA -msdata=none" { target { { powerpc*-*-* } && ilp32 } } } */ -/* { dg-options "-O0 -gbtf -dA -msmall-data-limit=0" { target { riscv*-*-* } } } */ -/* { dg-options "-O0 -gbtf -dA -G0" { target { nios2-*-* } } } */ +/* { dg-additional-options "-msdata=none" { target { { powerpc*-*-* } && ilp32 } } } */ +/* { dg-additional-options "-msmall-data-limit=0" { target { riscv*-*-* } } } */ +/* { dg-additional-options "-G0" { target { nios2-*-* } } } */ /* Check for two DATASEC entries with vlen 3, and one with vlen 1. */ /* { dg-final { scan-assembler-times "0xf000003\[\t \]+\[^\n\]*btt_info" 2 } } */ /* { dg-final { scan-assembler-times "0xf000001\[\t \]+\[^\n\]*btt_info" 1 } } */ /* The offset entry for each variable in a DATSEC should contain a label. */ -/* { dg-final { scan-assembler-times ".4byte\[\t \]\[a-e\]\[\t \]+\[^\n\]*bts_offset" 5 } } */ +/* { dg-final { scan-assembler-times "(?:(?:\\.4byte|\\.long|data4\\.ua|\\.ualong|\\.uaword|\\.dword|long|dc\\.l|\\.word)\[\t \]|\\.vbyte\t4,\[\t \]?)\[a-e\]\[\t \]+\[^\n\]*bts_offset" 5 } } */ /* { dg-final { scan-assembler-times "my_cstruct\[\t \]+\[^\n\]*bts_offset" 1 } } */ /* { dg-final { scan-assembler-times "bigarr\[\t \]+\[^\n\]*bts_offset" 1 } } */