From patchwork Tue May 21 15:44:12 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tom de Vries X-Patchwork-Id: 90617 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 D02D2384AB7A for ; Tue, 21 May 2024 15:45:12 +0000 (GMT) X-Original-To: gdb-patches@sourceware.org Delivered-To: gdb-patches@sourceware.org Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.223.131]) by sourceware.org (Postfix) with ESMTPS id 47346384B112 for ; Tue, 21 May 2024 15:43:07 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 47346384B112 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=suse.de Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=suse.de ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 47346384B112 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=195.135.223.131 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1716306189; cv=none; b=vjk1qPvlzleyFmVOb8h7t3yGI/gdf4YxXVRmXHnRmZL1oR0+nVIFiB4CBzxOMb/vr7RuJAGmlYMHoR4eILq/ZBP5xXhC5H8uutRz9eObKlmer/uBkNEG6GoaBHS3anvHGEcv9ekdfrGAmdAMtOfGhxbRdvLepdGKDEwP2mNwIRw= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1716306189; c=relaxed/simple; bh=gNLbYUO0e/THE3+Yp2CaCFxry+2s4YAdOcIfSt7lfcY=; h=DKIM-Signature:DKIM-Signature:DKIM-Signature:DKIM-Signature:From: To:Subject:Date:Message-Id:MIME-Version; b=tHpckkPG/ZnpPuI3K0N4sutZslZw6zqeKh4rB9mQ1ETs4pHY4zZDl8/QpFRopFKfF1BfwwbjDzaoPlupw7OMUq27mFf0tqlSD4MLQd22g6gBduc3Mje/fnCRIp4C7QOftTI0d7hwdlKv03disywsMhsWV8MesoY5GfaPLEAwOVc= ARC-Authentication-Results: i=1; server2.sourceware.org Received: from imap1.dmz-prg2.suse.org (unknown [10.150.64.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by smtp-out2.suse.de (Postfix) with ESMTPS id D2DE25C294 for ; Tue, 21 May 2024 15:43:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1716306183; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=YhYHCBjRcB8V0J1R0FyejK+V4yYWu3+NMbvHSZ2TJI0=; b=nrhoSQ+szEz9yd4nJlkrVeyyAdtFrkNKiSHHoy8Ljxshgm+VtlNwmhDY2xzuLwzucjC+b5 I0NQxFaL/uofEF1fN4NVL0ts6z3A9/wHNQadlNMqqzX+itfZ3kJTvuJzmAaenRmNJ6IhsD sFNLvT9iSm9dySmgmOg+OKS+qx2Z4zA= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1716306183; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=YhYHCBjRcB8V0J1R0FyejK+V4yYWu3+NMbvHSZ2TJI0=; b=Fd2FQeGsRm7WLb8rS8ZNd5ZeVU+9ljNzcyU1QXVkZptJrT0jj/akq8Wu+mDeQRcUT3Wysx D/nzWelKAeuaX7Bg== Authentication-Results: smtp-out2.suse.de; none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1716306183; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=YhYHCBjRcB8V0J1R0FyejK+V4yYWu3+NMbvHSZ2TJI0=; b=nrhoSQ+szEz9yd4nJlkrVeyyAdtFrkNKiSHHoy8Ljxshgm+VtlNwmhDY2xzuLwzucjC+b5 I0NQxFaL/uofEF1fN4NVL0ts6z3A9/wHNQadlNMqqzX+itfZ3kJTvuJzmAaenRmNJ6IhsD sFNLvT9iSm9dySmgmOg+OKS+qx2Z4zA= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1716306183; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=YhYHCBjRcB8V0J1R0FyejK+V4yYWu3+NMbvHSZ2TJI0=; b=Fd2FQeGsRm7WLb8rS8ZNd5ZeVU+9ljNzcyU1QXVkZptJrT0jj/akq8Wu+mDeQRcUT3Wysx D/nzWelKAeuaX7Bg== Received: from imap1.dmz-prg2.suse.org (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by imap1.dmz-prg2.suse.org (Postfix) with ESMTPS id BCE7013A75 for ; Tue, 21 May 2024 15:43:03 +0000 (UTC) Received: from dovecot-director2.suse.de ([2a07:de40:b281:106:10:150:64:167]) by imap1.dmz-prg2.suse.org with ESMTPSA id YJLRLAfBTGbJGwAAD6G6ig (envelope-from ) for ; Tue, 21 May 2024 15:43:03 +0000 From: Tom de Vries To: gdb-patches@sourceware.org Subject: [PATCH 08/11] [gdb/testsuite] Extend gdb.base/fission-macro.exp Date: Tue, 21 May 2024 17:44:12 +0200 Message-Id: <20240521154415.9543-8-tdevries@suse.de> X-Mailer: git-send-email 2.35.3 In-Reply-To: <20240521154415.9543-1-tdevries@suse.de> References: <20240521154415.9543-1-tdevries@suse.de> MIME-Version: 1.0 X-Spam-Score: -2.80 X-Spam-Level: X-Spamd-Result: default: False [-2.80 / 50.00]; BAYES_HAM(-3.00)[100.00%]; NEURAL_HAM_LONG(-1.00)[-1.000]; MID_CONTAINS_FROM(1.00)[]; R_MISSING_CHARSET(0.50)[]; NEURAL_HAM_SHORT(-0.20)[-1.000]; MIME_GOOD(-0.10)[text/plain]; ARC_NA(0.00)[]; RCPT_COUNT_ONE(0.00)[1]; RCVD_VIA_SMTP_AUTH(0.00)[]; MIME_TRACE(0.00)[0:+]; DKIM_SIGNED(0.00)[suse.de:s=susede2_rsa,suse.de:s=susede2_ed25519]; PREVIOUSLY_DELIVERED(0.00)[gdb-patches@sourceware.org]; FROM_EQ_ENVFROM(0.00)[]; FROM_HAS_DN(0.00)[]; FUZZY_BLOCKED(0.00)[rspamd.com]; RCVD_COUNT_TWO(0.00)[2]; TO_MATCH_ENVRCPT_ALL(0.00)[]; TO_DN_NONE(0.00)[]; RCVD_TLS_ALL(0.00)[] X-Spam-Status: No, score=-12.3 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, KAM_SHORT, 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 X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gdb-patches-bounces+patchwork=sourceware.org@sourceware.org Add a header file to test-case gdb.base/fission-macro.exp, and check that the macros defined there are properly listed. Tested on x86_64-linux. Tested test-case using a current gcc trunk build, and gcc 14. --- gdb/testsuite/gdb.base/fission-macro.c | 2 ++ gdb/testsuite/gdb.base/fission-macro.exp | 16 +++++++++++++++- gdb/testsuite/gdb.base/fission-macro.h | 19 +++++++++++++++++++ 3 files changed, 36 insertions(+), 1 deletion(-) create mode 100644 gdb/testsuite/gdb.base/fission-macro.h diff --git a/gdb/testsuite/gdb.base/fission-macro.c b/gdb/testsuite/gdb.base/fission-macro.c index 9c8cbece5c5..8c34679d57c 100644 --- a/gdb/testsuite/gdb.base/fission-macro.c +++ b/gdb/testsuite/gdb.base/fission-macro.c @@ -18,6 +18,8 @@ #define FIRST 1 #define SECOND 2 +#include "fission-macro.h" + extern int foo (void); int diff --git a/gdb/testsuite/gdb.base/fission-macro.exp b/gdb/testsuite/gdb.base/fission-macro.exp index 2434a329b7e..5474baf21d5 100644 --- a/gdb/testsuite/gdb.base/fission-macro.exp +++ b/gdb/testsuite/gdb.base/fission-macro.exp @@ -16,7 +16,7 @@ # Gcc 14 is the first release containing the fix for PR debug/111409. require {expr [gcc_major_version] >= 14} -standard_testfile .c -2.c +standard_testfile .c -2.c .h proc do_tests { dwarf_version dwarf_bits strict_dwarf } { set opts {} @@ -56,6 +56,20 @@ proc do_tests { dwarf_version dwarf_bits strict_dwarf } { gdb_test "info macro FIRST" "#define FIRST 1" gdb_test "info macro SECOND" "#define SECOND 2" + gdb_test "p FIFTH" " = 5" + gdb_test "p SIXTH" " = 6" + + gdb_test "info macro FIFTH" \ + [multi_line \ + "Defined at \[^\r\n\]*$::srcfile3:$::decimal" \ + " included at \[^\r\n\]*$::srcfile:$::decimal" \ + "#define FIFTH 5"] + gdb_test "info macro SIXTH" \ + [multi_line \ + "Defined at \[^\r\n\]*$::srcfile3:$::decimal" \ + " included at \[^\r\n\]*$::srcfile:$::decimal" \ + "#define SIXTH 6"] + gdb_breakpoint foo gdb_continue_to_breakpoint "foo" diff --git a/gdb/testsuite/gdb.base/fission-macro.h b/gdb/testsuite/gdb.base/fission-macro.h new file mode 100644 index 00000000000..66f15483b1c --- /dev/null +++ b/gdb/testsuite/gdb.base/fission-macro.h @@ -0,0 +1,19 @@ +/* This testcase is part of GDB, the GNU debugger. + + Copyright 2024 Free Software Foundation, Inc. + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . */ + +#define FIFTH 5 +#define SIXTH 6