From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp-out2.suse.de (smtp-out2.suse.de [IPv6:2001:67c:2178:6::1d]) by sourceware.org (Postfix) with ESMTPS id A42593858439 for ; Mon, 28 Aug 2023 12:12:30 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org A42593858439 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=suse.de Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=suse.de Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by smtp-out2.suse.de (Postfix) with ESMTPS id 329DA1F8A6 for ; Mon, 28 Aug 2023 12:12:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1693224749; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=efk1GmprX2ULMp6GErg8vjH6hjBvS1zA3fHuh1EtzAY=; b=ghNBttnfQ5yOnGOWcchz6gYuctYBi2Lj5C4mEhLGuZWS9JKiVDofsK3UDXYrkyKsbsLekz n15p6apeDU+1B3QveJJz7fCiBtK6Pjh2CvqP5rOri0GqDgo6KCW4ZYo9oNBgvWqgXeqQpF oyMNahMUOUMwlB4td2aaCovjdl5xnrE= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1693224749; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=efk1GmprX2ULMp6GErg8vjH6hjBvS1zA3fHuh1EtzAY=; b=+IwWqlfb0xXDUOz8bbq5pm2xpXRNoVRetk3oIKdhiHy09jHgF7tWqF6tEZ0iravKLuad1F YxNlE41gM9UOOICw== Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id 13A7F139CC for ; Mon, 28 Aug 2023 12:12:29 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id W7eOAy2P7GSSDwAAMHmgww (envelope-from ) for ; Mon, 28 Aug 2023 12:12:29 +0000 From: Tom de Vries To: gdb-patches@sourceware.org Subject: [PATCH] [gdb/testsuite] Improve xfail in gdb.cp/nsusing.exp Date: Mon, 28 Aug 2023 14:12:53 +0200 Message-Id: <20230828121253.8127-1-tdevries@suse.de> X-Mailer: git-send-email 2.35.3 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-11.9 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,GIT_PATCH_0,SPF_HELO_NONE,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 List-Id: In test-case gdb.cp/nsusing.exp I came across these xfails without PRMS mentioned: ... XFAIL: gdb.cp/nsusing.exp: print x, before using statement XFAIL: gdb.cp/nsusing.exp: print x, only using M ... Add the missing PRMS, such that we have: ... XFAIL: gdb.cp/nsusing.exp: print x, before using statement (PRMS gcc/108716) XFAIL: gdb.cp/nsusing.exp: print x, only using M (PRMS gcc/108716) ... and limit the xfail to unfixed versions. The PR is fixed starting gcc 13, but it has been backported to release branches stretching back to gcc 10. For simplicity we just stick to testing for the major version and ignore the backported fixes. Tested on x86_64-linux. --- gdb/testsuite/gdb.cp/nsusing.exp | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/gdb/testsuite/gdb.cp/nsusing.exp b/gdb/testsuite/gdb.cp/nsusing.exp index f34910bac0d..d44e389a8bb 100644 --- a/gdb/testsuite/gdb.cp/nsusing.exp +++ b/gdb/testsuite/gdb.cp/nsusing.exp @@ -122,14 +122,23 @@ if { [test_compiler_info {gcc-[0-3]-*}] || return } +# Xfail for incorrect decl_line on DW_TAG_imported_module, +# gcc PR debug/108716. +set have_gcc108716_xfail \ + [expr [test_compiler_info gcc-*] && [gcc_major_version] < 13] + gdb_test_multiple "print x" "print x, before using statement" { -re -wrap "No symbol .x. in current context.*" { pass $gdb_test_name } -re -wrap "Reference to .x. is ambiguous.*" { - # GCC doesn't properly set the decl_line for namespaces, so GDB believes - # that the "using namespace M" line has already passed at this point. - xfail $gdb_test_name + if { $have_gcc108716_xfail } { + # GCC doesn't properly set the decl_line for namespaces, so GDB + # believes that the "using namespace M" line has already passed at + # this point. + setup_xfail *-*-* gcc/108716 + } + fail $gdb_test_name } } gdb_test "next" ".*" "using namespace M" @@ -138,7 +147,10 @@ gdb_test_multiple "print x" "print x, only using M" { pass $gdb_test_name } -re -wrap "Reference to .x. is ambiguous.*" { - xfail $gdb_test_name + if { $have_gcc108716_xfail } { + setup_xfail *-*-* gcc/108716 + } + fail $gdb_test_name } } gdb_test "next" ".*" "using namespace N" base-commit: f5362c933e2280398d7aea3cc0748bec8f66a1ab -- 2.35.3