From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id mO3HB7F2emIAdAUAWB0awg (envelope-from ) for ; Tue, 10 May 2022 10:29:05 -0400 Received: by simark.ca (Postfix, from userid 112) id 1CE571E21F; Tue, 10 May 2022 10:29:05 -0400 (EDT) Authentication-Results: simark.ca; dkim=pass (1024-bit key; secure) header.d=sourceware.org header.i=@sourceware.org header.a=rsa-sha256 header.s=default header.b=dDVkUZz8; dkim-atps=neutral X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on simark.ca X-Spam-Level: X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,RDNS_DYNAMIC,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 Received: from sourceware.org (ip-8-43-85-97.sourceware.org [8.43.85.97]) (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 simark.ca (Postfix) with ESMTPS id A4C371E01D for ; Tue, 10 May 2022 10:29:04 -0400 (EDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 554A13949F28 for ; Tue, 10 May 2022 14:29:04 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 554A13949F28 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1652192944; bh=IJwYx/L/KFr1EdYiRfqKWt1/jFTlsCCUPL9HHNin50E=; h=To:Subject:Date:In-Reply-To:References:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc: From; b=dDVkUZz89ZYNuOHh6bLma2uODL3TFlhyAKPTuuaVcWnhYsMzfL6K2Zmrn1EpjQAkk L7g1u6WZU4dn9fFOah4jh600n48/PD/G+3kxNPUsfOJD66dHnKTww1raqMv8OAaKYc X9vQGWxh79oIUfU0zz9IlK6PHaoVTrAvFUn/JROo= Received: from mga18.intel.com (mga18.intel.com [134.134.136.126]) by sourceware.org (Postfix) with ESMTPS id 96FA93954406 for ; Tue, 10 May 2022 14:25:26 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 96FA93954406 X-IronPort-AV: E=McAfee;i="6400,9594,10342"; a="251435912" X-IronPort-AV: E=Sophos;i="5.91,214,1647327600"; d="scan'208";a="251435912" Received: from orsmga001.jf.intel.com ([10.7.209.18]) by orsmga106.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 10 May 2022 07:25:25 -0700 X-IronPort-AV: E=Sophos;i="5.91,214,1647327600"; d="scan'208";a="602490453" Received: from labpcdell3650-003.iul.intel.com (HELO localhost) ([172.28.49.87]) by orsmga001-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 10 May 2022 07:25:24 -0700 To: gdb-patches@sourceware.org Subject: [PATCH 08/18] testsuite, fortran: make print-formatted.exp more robust Date: Tue, 10 May 2022 16:24:27 +0200 Message-Id: <20220510142437.1397399-9-nils-christian.kempke@intel.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220510142437.1397399-1-nils-christian.kempke@intel.com> References: <20220510142437.1397399-1-nils-christian.kempke@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , From: Nils-Christian Kempke via Gdb-patches Reply-To: Nils-Christian Kempke Cc: JiniSusan.George@amd.com, aburgess@redhat.com Errors-To: gdb-patches-bounces+public-inbox=simark.ca@sourceware.org Sender: "Gdb-patches" The test was written in a way that assumed, that going to main and issuing a single next command would automatically end up after the assign statement for ii. This was true for gfortran and ifort, but not for ifx leading to a failed test. For ifx, GDB actually was at the assign statment (not past it) and printing 'ii' there would lead to GDB displaying it as 0 (instead of 10), failing the test. I changed this to become more robust and added a line past the assignment with a comment, as is commonly done all over the testsuite. After this change the test passes for all, gfortran/ifort/ifx/flang. --- gdb/testsuite/gdb.fortran/print-formatted.exp | 3 ++- gdb/testsuite/gdb.fortran/print-formatted.f90 | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/gdb/testsuite/gdb.fortran/print-formatted.exp b/gdb/testsuite/gdb.fortran/print-formatted.exp index eaeca1ede2..59b7148852 100644 --- a/gdb/testsuite/gdb.fortran/print-formatted.exp +++ b/gdb/testsuite/gdb.fortran/print-formatted.exp @@ -29,7 +29,8 @@ if { ![fortran_runto_main] } { return -1 } -gdb_test "next" ".*" "go to the end of the program" +gdb_breakpoint [gdb_get_line_number "End of program"] +gdb_continue_to_breakpoint "End of program" ".*End of program.*" gdb_test "set output-radix 16" \ "Output radix now set to decimal 16, hex 10, octal 20." \ diff --git a/gdb/testsuite/gdb.fortran/print-formatted.f90 b/gdb/testsuite/gdb.fortran/print-formatted.f90 index 63048032b1..f37fdafe97 100644 --- a/gdb/testsuite/gdb.fortran/print-formatted.f90 +++ b/gdb/testsuite/gdb.fortran/print-formatted.f90 @@ -17,4 +17,5 @@ program printformatted integer :: ii ii = 10 + print *, ii ! End of program. end program printformatted -- 2.25.1 Intel Deutschland GmbH Registered Address: Am Campeon 10, 85579 Neubiberg, Germany Tel: +49 89 99 8853-0, www.intel.de Managing Directors: Christin Eisenschmid, Sharon Heck, Tiffany Doon Silva Chairperson of the Supervisory Board: Nicole Lau Registered Office: Munich Commercial Register: Amtsgericht Muenchen HRB 186928