From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by sourceware.org (Postfix) with ESMTPS id F06B0385828A for ; Mon, 7 Nov 2022 13:53:01 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org F06B0385828A Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=redhat.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1667829181; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=/jbdA+zlvrRNvfgLVlYxY3CA4CeXj/ubPDOYcGtbObM=; b=E3cK0yfhqNlg4jClZwsXUXOp4mCVfX9tq8OUh6DgdVIMo36lN+K7BZZ2j0KJwJXBVrXUhO Xk+McAJbJvN9hOZ6d5wF1lzY1ap8324O4Jb00/kZ7ft6D4/UvoAZwcWyMRaSKS6/m8p2YF j3fBH8+a4HtzUJ0Bg+j8pI5h6n1JqEg= Received: from mimecast-mx02.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-516-OXT_4lqaP4C2WSwx5JFerg-1; Mon, 07 Nov 2022 08:53:00 -0500 X-MC-Unique: OXT_4lqaP4C2WSwx5JFerg-1 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.rdu2.redhat.com [10.11.54.4]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 744482A59540 for ; Mon, 7 Nov 2022 13:53:00 +0000 (UTC) Received: from fedora.redhat.com (ovpn-193-251.brq.redhat.com [10.40.193.251]) by smtp.corp.redhat.com (Postfix) with ESMTPS id C8AAF2027063; Mon, 7 Nov 2022 13:52:59 +0000 (UTC) From: Bruno Larsen To: gdb-patches@sourceware.org Cc: Bruno Larsen Subject: [PATCH v2 6/9] gdb/testsuite: skip gdb.cp/anon-struct.exp when using Clang Date: Mon, 7 Nov 2022 14:46:02 +0100 Message-Id: <20221107134604.596986-7-blarsen@redhat.com> In-Reply-To: <20221107134604.596986-1-blarsen@redhat.com> References: <20221107134604.596986-1-blarsen@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.4 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset="US-ASCII"; x-default=true X-Spam-Status: No, score=-12.2 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,GIT_PATCH_0,KAM_SHORT,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_NONE,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 List-Id: When Clang compiles anonymous structures, it does not add linkage names in their dwarf representations. This is compounded by Clang not adding linkage names to subprograms of those anonymous structs (for instance, the constructor). With these 2 things together, GDB is unable to refer to any of them, so there is no way to pass any of the tests of gdb.cp/anon-struct.exp Since this isn't a bug on Clang or GDB according to the DWARF specifications as DW_AT_name is optional for all DIEs, the test was marked as untested. Since I was already touching the file, I also added a comment at the top of the file explaining what it is testing for. --- gdb/testsuite/gdb.cp/anon-struct.exp | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/gdb/testsuite/gdb.cp/anon-struct.exp b/gdb/testsuite/gdb.cp/anon-struct.exp index 2c709ab9ecc..2113957fed0 100644 --- a/gdb/testsuite/gdb.cp/anon-struct.exp +++ b/gdb/testsuite/gdb.cp/anon-struct.exp @@ -14,12 +14,22 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . +# This test is used to verify GDB's ability to refer to linkage names +# for types and functions within anonymous structures. + standard_testfile .cc if { [prepare_for_testing "failed to prepare" ${testfile} ${srcfile} {debug c++}] } { return -1 } +# Clang doesn't add any names for functions within anonymous structures, +# so there is no way to try and refer to them inside GDB. +if {[test_compiler_info clang-*-* c++]} { + untested "clang does not use linkage name in this case" + return +} + if { [is_aarch32_target] } { gdb_test "ptype t::t" "type = struct t {\r\n C m;\r\n} \\*\\(t \\* const\\)" \ "print type of t::t" -- 2.37.3