From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id cHtIDYhno2LBLgEAWB0awg (envelope-from ) for ; Fri, 10 Jun 2022 11:47:20 -0400 Received: by simark.ca (Postfix, from userid 112) id 32E051E223; Fri, 10 Jun 2022 11:47:20 -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=WaXkxIFf; 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=-3.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 Received: from sourceware.org (server2.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 B53291E143 for ; Fri, 10 Jun 2022 11:47:19 -0400 (EDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 655EE39421E9 for ; Fri, 10 Jun 2022 15:47:19 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 655EE39421E9 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1654876039; bh=DVgsuzd3zrl3e4xXbVxK6/zaDcMpcu9pXMibff619kM=; h=To:Subject:Date:In-Reply-To:References:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To: From; b=WaXkxIFfWBFy2KjDP72tXC4ReaDX7K5w4ovVGjCZiFw4eiXgTwXQqfRAO84bNGGvy MOe1AgeqJwvfCsEbnoB6cAMC9IVzjqn2UIrdH981dTKc4HmesVhSVf4RiF0TqY+6gw VA2hJpO3JnhuGJAjlVjrHY3HKfIHs0p8F7xvbNak= Received: from mga06.intel.com (mga06b.intel.com [134.134.136.31]) by sourceware.org (Postfix) with ESMTPS id C3BED39421C7 for ; Fri, 10 Jun 2022 15:45:50 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org C3BED39421C7 X-IronPort-AV: E=McAfee;i="6400,9594,10374"; a="339415503" X-IronPort-AV: E=Sophos;i="5.91,290,1647327600"; d="scan'208";a="339415503" Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by orsmga104.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 10 Jun 2022 08:45:50 -0700 X-IronPort-AV: E=Sophos;i="5.91,290,1647327600"; d="scan'208";a="725017043" Received: from labpcdell3650-003.iul.intel.com (HELO localhost) ([172.28.49.87]) by fmsmga001-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 10 Jun 2022 08:45:48 -0700 To: gdb-patches@sourceware.org Subject: [PATCH 3/4] testsuite, fortran: adapt tests for ifort's 'start' behavior Date: Fri, 10 Jun 2022 17:44:59 +0200 Message-Id: <20220610154500.374897-4-nils-christian.kempke@intel.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220610154500.374897-1-nils-christian.kempke@intel.com> References: <20220610154500.374897-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 Errors-To: gdb-patches-bounces+public-inbox=simark.ca@sourceware.org Sender: "Gdb-patches" The modified tests array-slices-bad.exp and vla-type.exp both set a breakpoint at the first real statement in the respective executables. Normally, the expected behavior of fortran_runto_main for these would be the stopping of the debugger at exactly the first statment in the code. Strangely, neither gfortran nor ifx seem to do this for these tests. Instead, issuing 'start' in ifx (for either of the 2 tests) lets GDB stop at the 'program ...' line and gfortran stops at a variable declaration line. E.g. for vla-type it stops at 41 type(five) :: fivearr (2) So, actually, ifort's behavior can be considered to be a bit more 'correct' here. The changes skip running to the first breakpoint when compiling with ifort, which improves test performance for ifort. A similar skip already existed for flang in vla-type.exp. --- gdb/testsuite/gdb.fortran/array-slices-bad.exp | 5 ++++- gdb/testsuite/gdb.fortran/vla-type.exp | 5 +++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/gdb/testsuite/gdb.fortran/array-slices-bad.exp b/gdb/testsuite/gdb.fortran/array-slices-bad.exp index b832fea292..514f208577 100644 --- a/gdb/testsuite/gdb.fortran/array-slices-bad.exp +++ b/gdb/testsuite/gdb.fortran/array-slices-bad.exp @@ -40,7 +40,10 @@ gdb_breakpoint [gdb_get_line_number "First Breakpoint"] gdb_breakpoint [gdb_get_line_number "Second Breakpoint"] gdb_breakpoint [gdb_get_line_number "Final Breakpoint"] -gdb_continue_to_breakpoint "First Breakpoint" +# Ifort is already at this line after runto_main. +if { ![test_compiler_info {ifort-*} f90] } { + gdb_continue_to_breakpoint "First Breakpoint" +} # Access not yet allocated array. gdb_test "print other" " = " diff --git a/gdb/testsuite/gdb.fortran/vla-type.exp b/gdb/testsuite/gdb.fortran/vla-type.exp index fc8494fe36..884e0dc113 100755 --- a/gdb/testsuite/gdb.fortran/vla-type.exp +++ b/gdb/testsuite/gdb.fortran/vla-type.exp @@ -32,8 +32,9 @@ set int [fortran_int4] # Check if not allocated VLA in type does not break # the debugger when accessing it. -# break main for Flang compiler already breaks here -if { ![test_compiler_info {flang-*} f90] } { +# Run to main for for Flang and ifort compilers already breaks here. +if { ![test_compiler_info {flang-*} f90] + && ![test_compiler_info {ifort-*} f90]} { gdb_breakpoint [gdb_get_line_number "before-allocated"] gdb_continue_to_breakpoint "before-allocated" } -- 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