From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id kB4fI+crD2O8WDAAWB0awg (envelope-from ) for ; Wed, 31 Aug 2022 05:37:43 -0400 Received: by simark.ca (Postfix, from userid 112) id 8DD081E4A7; Wed, 31 Aug 2022 05:37:43 -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=OwBdHdXW; 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 39B951E222 for ; Wed, 31 Aug 2022 05:37:43 -0400 (EDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 66B5A38582A7 for ; Wed, 31 Aug 2022 09:37:42 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 66B5A38582A7 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1661938662; bh=zKo2wWuwesc+arfVXCDOG/pCfeEQyar5f3QZsGr4TU0=; 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=OwBdHdXWdOAqjJWclnmdKwTBBinl805mKWh4Pr7QcCDkAusjcZouQ7IyojpNxar6K LX96jWQ4yFggo+3mYZmnQMLnnd2szggBCjxGpOy6aGDxlTNMaMl2HDGXgbH7C2xVK4 bqi4nkXZjJjQWctxMs16J5C6GNQNO769GuxwPzhU= Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by sourceware.org (Postfix) with ESMTPS id F364B383CCEA for ; Wed, 31 Aug 2022 09:37:18 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org F364B383CCEA X-IronPort-AV: E=McAfee;i="6500,9779,10455"; a="292988058" X-IronPort-AV: E=Sophos;i="5.93,277,1654585200"; d="scan'208";a="292988058" Received: from orsmga008.jf.intel.com ([10.7.209.65]) by fmsmga102.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 31 Aug 2022 02:37:17 -0700 X-IronPort-AV: E=Sophos;i="5.93,277,1654585200"; d="scan'208";a="641781523" Received: from labpcdell3650-003.iul.intel.com (HELO localhost) ([172.28.49.87]) by orsmga008-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 31 Aug 2022 02:37:16 -0700 To: gdb-patches@sourceware.org Subject: [PATCH v2 3/4] testsuite, fortran: adapt tests for ifort's 'start' behavior Date: Wed, 31 Aug 2022 11:36:49 +0200 Message-Id: <20220831093650.674582-4-nils-christian.kempke@intel.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220831093650.674582-1-nils-christian.kempke@intel.com> References: <20220831093650.674582-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: tom@tromey.com 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. This patch remove the fortran_runto_main in the two tests and instead uses runto to directly run to the first breakpoint set at the first program statement. This works with both compiler behaviors and makes the tests more robust. --- gdb/testsuite/gdb.fortran/array-slices-bad.exp | 13 +++++-------- gdb/testsuite/gdb.fortran/vla-type.exp | 11 +++-------- 2 files changed, 8 insertions(+), 16 deletions(-) diff --git a/gdb/testsuite/gdb.fortran/array-slices-bad.exp b/gdb/testsuite/gdb.fortran/array-slices-bad.exp index b832fea292a..a9da37bc3dd 100644 --- a/gdb/testsuite/gdb.fortran/array-slices-bad.exp +++ b/gdb/testsuite/gdb.fortran/array-slices-bad.exp @@ -28,20 +28,17 @@ if {[prepare_for_testing ${testfile}.exp ${testfile} ${srcfile} \ # Avoid shared lib symbols. gdb_test_no_output "set auto-solib-add off" -if ![fortran_runto_main] { - return -1 -} - # Avoid libc symbols, in particular the 'array' type. gdb_test_no_output "nosharedlibrary" -# gdb_breakpoint [gdb_get_line_number "Display Message Breakpoint"] -gdb_breakpoint [gdb_get_line_number "First Breakpoint"] +if {![runto [gdb_get_line_number "First Breakpoint"]]} { + perror "couldn't run to breakpoint First Breakpoint" + return -1 +} + gdb_breakpoint [gdb_get_line_number "Second Breakpoint"] gdb_breakpoint [gdb_get_line_number "Final Breakpoint"] -gdb_continue_to_breakpoint "First Breakpoint" - # Access not yet allocated array. gdb_test "print other" " = " gdb_test "print other(0:4,2:3)" "array not allocated" diff --git a/gdb/testsuite/gdb.fortran/vla-type.exp b/gdb/testsuite/gdb.fortran/vla-type.exp index fc8494fe36c..1bc30dc7f15 100755 --- a/gdb/testsuite/gdb.fortran/vla-type.exp +++ b/gdb/testsuite/gdb.fortran/vla-type.exp @@ -23,19 +23,14 @@ if { [prepare_for_testing "failed to prepare" ${testfile} ${srcfile} \ return -1 } -if ![fortran_runto_main] { - return -1 -} - # Depending on the compiler being used, the type names can be printed differently. 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] } { - gdb_breakpoint [gdb_get_line_number "before-allocated"] - gdb_continue_to_breakpoint "before-allocated" +if {![runto [gdb_get_line_number "before-allocated"]]} { + perror "couldn't run to breakpoint before-allocated" + return -1 } gdb_test "print twov" " = \\\( ivla1 = , ivla2 = \\\)" \ -- 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