From patchwork Mon Aug 21 12:19:24 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Wiederhake, Tim" X-Patchwork-Id: 22259 Received: (qmail 32615 invoked by alias); 21 Aug 2017 12:20:18 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Delivered-To: mailing list gdb-patches@sourceware.org Received: (qmail 32235 invoked by uid 89); 21 Aug 2017 12:20:15 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-25.6 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, KAM_LAZY_DOMAIN_SECURITY, RP_MATCHES_RCVD autolearn=ham version=3.3.2 spammy=7110, Hx-languages-length:7088 X-HELO: mga14.intel.com Received: from mga14.intel.com (HELO mga14.intel.com) (192.55.52.115) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Mon, 21 Aug 2017 12:20:13 +0000 Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by fmsmga103.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 21 Aug 2017 05:20:12 -0700 X-ExtLoop1: 1 Received: from irvmail001.ir.intel.com ([163.33.26.43]) by fmsmga002.fm.intel.com with ESMTP; 21 Aug 2017 05:20:10 -0700 Received: from ulvlx001.iul.intel.com (ulvlx001.iul.intel.com [172.28.207.17]) by irvmail001.ir.intel.com (8.14.3/8.13.6/MailSET/Hub) with ESMTP id v7LCK7iG032629; Mon, 21 Aug 2017 13:20:07 +0100 Received: from ulvlx001.iul.intel.com (localhost [127.0.0.1]) by ulvlx001.iul.intel.com with ESMTP id v7LCJxuY012943; Mon, 21 Aug 2017 14:19:59 +0200 Received: (from twiederh@localhost) by ulvlx001.iul.intel.com with LOCAL id v7LCJxdt012939; Mon, 21 Aug 2017 14:19:59 +0200 From: Tim Wiederhake To: gdb-patches@sourceware.org Cc: Bernhard Heckel Subject: [PATCH 2/4] Fortran: Testsuite, fix differences in type naming. Date: Mon, 21 Aug 2017 14:19:24 +0200 Message-Id: <1503317966-12486-3-git-send-email-tim.wiederhake@intel.com> In-Reply-To: <1503317966-12486-1-git-send-email-tim.wiederhake@intel.com> References: <1503317966-12486-1-git-send-email-tim.wiederhake@intel.com> X-IsSubscribed: yes From: Bernhard Heckel xxxx-yy-zz Bernhard Heckel gdb/Testsuite/Changelog: * gdb.fortran/vla-value.exp: Use type names defined in libfortran. * gdb.mi/mi-var-child-f.exp: Likewise. * gdb.mi/mi-vla-fortran.exp: Likewise. --- gdb/testsuite/gdb.fortran/vla-value.exp | 13 +++++++++---- gdb/testsuite/gdb.mi/mi-var-child-f.exp | 8 ++++---- gdb/testsuite/gdb.mi/mi-vla-fortran.exp | 19 ++++++++++++------- 3 files changed, 25 insertions(+), 15 deletions(-) diff --git a/gdb/testsuite/gdb.fortran/vla-value.exp b/gdb/testsuite/gdb.fortran/vla-value.exp index 6ceceab..3dd1aae 100644 --- a/gdb/testsuite/gdb.fortran/vla-value.exp +++ b/gdb/testsuite/gdb.fortran/vla-value.exp @@ -14,6 +14,7 @@ # along with this program. If not, see . standard_testfile "vla.f90" +load_lib "fortran.exp" if { [prepare_for_testing "failed to prepare" ${testfile} ${srcfile} \ {debug f90 quiet}] } { @@ -25,12 +26,16 @@ if ![runto_main] { return -1 } +# Depending on the compiler being used, +# the type names can be printed differently. +set real [fortran_real4] + # Try to access values in non allocated VLA gdb_breakpoint [gdb_get_line_number "vla1-init"] gdb_continue_to_breakpoint "vla1-init" gdb_test "print vla1" " = " "print non-allocated vla1" gdb_test "print &vla1" \ - " = \\\(PTR TO -> \\\( real\\\(kind=4\\\) \\\(\\\)\\\)\\\) $hex" \ + " = \\\(PTR TO -> \\\( $real \\\(\\\)\\\)\\\) $hex" \ "print non-allocated &vla1" gdb_test "print vla1(1,1,1)" "no such vector element \\\(vector not allocated\\\)" \ "print member in non-allocated vla1 (1)" @@ -51,7 +56,7 @@ with_timeout_factor 15 { "step over value assignment of vla1" } gdb_test "print &vla1" \ - " = \\\(PTR TO -> \\\( real\\\(kind=4\\\) \\\(10,10,10\\\)\\\)\\\) $hex" \ + " = \\\(PTR TO -> \\\( $real \\\(10,10,10\\\)\\\)\\\) $hex" \ "print allocated &vla1" gdb_test "print vla1(3, 6, 9)" " = 1311" "print allocated vla1(3,6,9)" gdb_test "print vla1(1, 3, 8)" " = 1311" "print allocated vla1(1,3,8)" @@ -71,7 +76,7 @@ gdb_test "print vla1(9, 9, 9)" " = 999" \ # Try to access values in undefined pointer to VLA (dangling) gdb_test "print pvla" " = " "print undefined pvla" gdb_test "print &pvla" \ - " = \\\(PTR TO -> \\\( real\\\(kind=4\\\) \\\(\\\)\\\)\\\) $hex" \ + " = \\\(PTR TO -> \\\( $real \\\(\\\)\\\)\\\) $hex" \ "print non-associated &pvla" gdb_test "print pvla(1, 3, 8)" "no such vector element \\\(vector not associated\\\)" \ "print undefined pvla(1,3,8)" @@ -80,7 +85,7 @@ gdb_test "print pvla(1, 3, 8)" "no such vector element \\\(vector not associated gdb_breakpoint [gdb_get_line_number "pvla-associated"] gdb_continue_to_breakpoint "pvla-associated" gdb_test "print &pvla" \ - " = \\\(PTR TO -> \\\( real\\\(kind=4\\\) \\\(10,10,10\\\)\\\)\\\) $hex" \ + " = \\\(PTR TO -> \\\( $real \\\(10,10,10\\\)\\\)\\\) $hex" \ "print associated &pvla" gdb_test "print pvla(3, 6, 9)" " = 42" "print associated pvla(3,6,9)" gdb_test "print pvla(1, 3, 8)" " = 1001" "print associated pvla(1,3,8)" diff --git a/gdb/testsuite/gdb.mi/mi-var-child-f.exp b/gdb/testsuite/gdb.mi/mi-var-child-f.exp index dd56c35..a4a9a89 100644 --- a/gdb/testsuite/gdb.mi/mi-var-child-f.exp +++ b/gdb/testsuite/gdb.mi/mi-var-child-f.exp @@ -17,6 +17,7 @@ load_lib mi-support.exp set MIFLAGS "-i=mi" +load_lib "fortran.exp" if { [skip_fortran_tests] } { return -1 } @@ -40,10 +41,9 @@ mi_runto MAIN__ mi_create_varobj "array" "array" "create local variable array" -# Depending on the compiler version being used, the name of the 4-byte integer -# and real types can be printed differently. For instance, gfortran-4.1 uses -# "int4" whereas gfortran-4.3 uses "integer(kind=4)". -set int4 "(int4|integer\\(kind=4\\))" +# Depending on the compiler being used, +# the type names can be printed differently. +set int4 [fortran_int4] set children [list [list "array.-1" "-1" 2 "$int4 \\(2\\)"] \ [list "array.0" "0" 2 "$int4 \\(2\\)"] \ diff --git a/gdb/testsuite/gdb.mi/mi-vla-fortran.exp b/gdb/testsuite/gdb.mi/mi-vla-fortran.exp index b81165e..9d47eba 100644 --- a/gdb/testsuite/gdb.mi/mi-vla-fortran.exp +++ b/gdb/testsuite/gdb.mi/mi-vla-fortran.exp @@ -17,6 +17,7 @@ # Array (VLA). load_lib mi-support.exp +load_lib fortran.exp set MIFLAGS "-i=mi" gdb_exit @@ -32,6 +33,10 @@ if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable \ return -1 } +# Depending on the compiler being used, +# the type names can be printed differently. +set real [fortran_real4] + mi_delete_breakpoints mi_gdb_reinitialize_dir $srcdir/$subdir mi_gdb_load ${binfile} @@ -58,7 +63,7 @@ mi_gdb_test "503-var-evaluate-expression vla1_not_allocated" \ "503\\^done,value=\"\\\[0\\\]\"" \ "eval variable vla1_not_allocated" mi_list_array_varobj_children_with_index "vla1_not_allocated" "0" "1" \ - "real\\\(kind=4\\\)" "get children of vla1_not_allocated" + "$real" "get children of vla1_not_allocated" @@ -71,10 +76,10 @@ mi_expect_stop "breakpoint-hit" "vla" "" ".*vla.f90" "$bp_lineno" \ mi_gdb_test "510-data-evaluate-expression vla1" \ "510\\^done,value=\"\\(.*\\)\"" "evaluate allocated vla" -mi_create_varobj_checked vla1_allocated vla1 "real\\\(kind=4\\\) \\\(5\\\)" \ +mi_create_varobj_checked vla1_allocated vla1 "$real \\\(5\\\)" \ "create local variable vla1_allocated" mi_gdb_test "511-var-info-type vla1_allocated" \ - "511\\^done,type=\"real\\\(kind=4\\\) \\\(5\\\)\"" \ + "511\\^done,type=\"$real \\\(5\\\)\"" \ "info type variable vla1_allocated" mi_gdb_test "512-var-show-format vla1_allocated" \ "512\\^done,format=\"natural\"" \ @@ -83,7 +88,7 @@ mi_gdb_test "513-var-evaluate-expression vla1_allocated" \ "513\\^done,value=\"\\\[5\\\]\"" \ "eval variable vla1_allocated" mi_list_array_varobj_children_with_index "vla1_allocated" "5" "1" \ - "real\\\(kind=4\\\)" "get children of vla1_allocated" + "$real" "get children of vla1_allocated" set bp_lineno [gdb_get_line_number "vla1-filled"] @@ -148,7 +153,7 @@ gdb_expect { "583\\^done,value=\"\\\[0\\\]\"" \ "eval variable pvla2_not_associated" mi_list_array_varobj_children_with_index "pvla2_not_associated" "0" "1" \ - "real\\\(kind=4\\\)" "get children of pvla2_not_associated" + "$real" "get children of pvla2_not_associated" } -re "580\\^error,msg=\"value contents too large \\(\[0-9\]+ bytes\\).*${mi_gdb_prompt}$" { # Undefined behaviour in gfortran. @@ -173,9 +178,9 @@ mi_gdb_test "590-data-evaluate-expression pvla2" \ "evaluate associated vla" mi_create_varobj_checked pvla2_associated pvla2 \ - "real\\\(kind=4\\\) \\\(5,2\\\)" "create local variable pvla2_associated" + "$real \\\(5,2\\\)" "create local variable pvla2_associated" mi_gdb_test "591-var-info-type pvla2_associated" \ - "591\\^done,type=\"real\\\(kind=4\\\) \\\(5,2\\\)\"" \ + "591\\^done,type=\"$real \\\(5,2\\\)\"" \ "info type variable pvla2_associated" mi_gdb_test "592-var-show-format pvla2_associated" \ "592\\^done,format=\"natural\"" \