From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 7862) id A646638555B6; Fri, 11 Nov 2022 09:17:32 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org A646638555B6 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1668158252; bh=SOReYuQ6qSCL5CGaiiZe5tzFGORELc0bz/IKisSFleI=; h=From:To:Subject:Date:From; b=eQdtOgOrri4m1x2P7iOS5K+Tbx5yEWw6lNX+WxdXDvXggTrGWd+DH4uw9boVmW2EH 3Bh9knd+4BQRTVCqt6OxTQDJUSum2Q3Ymwrra4PK9w+eS1IpcZ95NAF79W5FZOIey1 axMFddIkCO8P0AjheuRsLrd5wjTu0vRpRfjFxKTE= Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable From: Bruno Larsen To: gdb-cvs@sourceware.org Subject: [binutils-gdb] gdb/testsuite: skip gdb.cp/anon-struct.exp when using Clang X-Act-Checkin: binutils-gdb X-Git-Author: Bruno Larsen X-Git-Refname: refs/heads/master X-Git-Oldrev: f2f2eb6b0e77eebbbe06a2515053dc874598bee9 X-Git-Newrev: ad9421bb1532bfd6ff14c6d841177a6e6d07fd27 Message-Id: <20221111091732.A646638555B6@sourceware.org> Date: Fri, 11 Nov 2022 09:17:32 +0000 (GMT) List-Id: https://sourceware.org/git/gitweb.cgi?p=3Dbinutils-gdb.git;h=3Dad9421bb1532= bfd6ff14c6d841177a6e6d07fd27 commit ad9421bb1532bfd6ff14c6d841177a6e6d07fd27 Author: Bruno Larsen Date: Thu Sep 29 13:05:42 2022 +0200 gdb/testsuite: skip gdb.cp/anon-struct.exp when using Clang =20 When Clang compiles anonymous structures, it does not add linkage names= in their dwarf representations. This is compounded by Clang not adding lin= kage 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 =20 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 mar= ked as untested. =20 Since I was already touching the file, I also added a comment at the top of the file explaining what it is testing for. =20 Approved-by: Tom Tromey Diff: --- 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/an= on-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 . =20 +# This test is used to verify GDB's ability to refer to linkage names +# for types and functions within anonymous structures. + standard_testfile .cc =20 if { [prepare_for_testing "failed to prepare" ${testfile} ${srcfile} {debu= g c++}] } { return -1 } =20 +# 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 =3D struct t {\r\n C m;\r\n} \\*\\(t \\= * const\\)" \ "print type of t::t"