From: Bernhard Heckel <bernhard.heckel@intel.com>
To: qiyaoltc@gmail.com, brobecker@adacore.com
Cc: gdb-patches@sourceware.org, Bernhard Heckel <bernhard.heckel@intel.com>
Subject: [PATCH V4 1/6] Fortran: Testsuite, fix differences in type naming.
Date: Wed, 07 Sep 2016 06:38:00 -0000 [thread overview]
Message-ID: <1473230295-809-2-git-send-email-bernhard.heckel@intel.com> (raw)
In-Reply-To: <1473230295-809-1-git-send-email-bernhard.heckel@intel.com>
Continued on 0c13f7e559afe5f973a59311b0e401296c48d96c
(fortran: Testsuite, fix different type naming across compilers).
2016-06-08 Bernhard Heckel <bernhard.heckel@intel.com>
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 | 12 ++++++++----
gdb/testsuite/gdb.mi/mi-var-child-f.exp | 7 +++----
gdb/testsuite/gdb.mi/mi-vla-fortran.exp | 18 +++++++++++-------
3 files changed, 22 insertions(+), 15 deletions(-)
diff --git a/gdb/testsuite/gdb.fortran/vla-value.exp b/gdb/testsuite/gdb.fortran/vla-value.exp
index 0945181..275f738 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 <http://www.gnu.org/licenses/>.
standard_testfile "vla.f90"
+load_lib "fortran.exp"
if { [prepare_for_testing ${testfile}.exp ${testfile} ${srcfile} \
{debug f90 quiet}] } {
@@ -25,12 +26,15 @@ 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" " = <not allocated>" "print non-allocated vla1"
gdb_test "print &vla1" \
- " = \\\(PTR TO -> \\\( real\\\(kind=4\\\) \\\(<not allocated>\\\)\\\)\\\) $hex" \
+ " = \\\(PTR TO -> \\\( $real \\\(<not allocated>\\\)\\\)\\\) $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 +55,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 +75,7 @@ gdb_test "print vla1(9, 9, 9)" " = 999" \
# Try to access values in undefined pointer to VLA (dangling)
gdb_test "print pvla" " = <not associated>" "print undefined pvla"
gdb_test "print &pvla" \
- " = \\\(PTR TO -> \\\( real\\\(kind=4\\\) \\\(<not associated>\\\)\\\)\\\) $hex" \
+ " = \\\(PTR TO -> \\\( $real \\\(<not associated>\\\)\\\)\\\) $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 +84,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 f3ed7c2..bc44c6b 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,8 @@ 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 333b71a..1779ec0 100644
--- a/gdb/testsuite/gdb.mi/mi-vla-fortran.exp
+++ b/gdb/testsuite/gdb.mi/mi-vla-fortran.exp
@@ -18,6 +18,7 @@
load_lib mi-support.exp
set MIFLAGS "-i=mi"
+load_lib "fortran.exp"
gdb_exit
if [mi_gdb_start] {
@@ -32,6 +33,9 @@ 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 +62,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 +75,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 +87,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 +152,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 +177,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\"" \
--
2.7.1.339.g0233b80
next prev parent reply other threads:[~2016-09-07 6:38 UTC|newest]
Thread overview: 32+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-09-07 6:38 [PATCH V4 0/6] Fortran: Resolve target types of pointers Bernhard Heckel
2016-09-07 6:38 ` [PATCH V4 4/6] Fortran: Typeprint, fix dangling types Bernhard Heckel
2016-10-13 13:53 ` Yao Qi
2016-09-07 6:38 ` [PATCH V4 5/6] Resolve dynamic target types of pointers Bernhard Heckel
2016-09-07 14:24 ` Eli Zaretskii
2016-10-13 14:07 ` Yao Qi
2016-10-13 14:57 ` Bernhard Heckel
2016-10-17 10:32 ` Yao Qi
2016-10-17 11:25 ` Bernhard Heckel
2016-10-17 12:18 ` Bernhard Heckel
2016-10-20 11:52 ` Bernhard Heckel
2016-10-20 15:33 ` Yao Qi
2016-11-08 7:07 ` Bernhard Heckel
2016-11-08 11:26 ` Yao Qi
2016-11-08 12:27 ` Bernhard Heckel
2016-11-16 12:16 ` Bernhard Heckel
2016-11-21 15:03 ` Bernhard Heckel
2016-09-07 6:38 ` [PATCH V4 2/6] Fortran: Resolve dynamic properties of pointer types Bernhard Heckel
2016-10-05 8:44 ` Yao Qi
2016-10-05 9:36 ` Yao Qi
2016-10-05 10:07 ` Bernhard Heckel
2016-09-07 6:38 ` [PATCH V4 3/6] Typeprint: Resolve any dynamic target type of a pointer Bernhard Heckel
[not found] ` <861szvayzg.fsf@gmail.com>
2016-10-05 11:03 ` Bernhard Heckel
2016-10-13 13:41 ` Yao Qi
2016-09-07 6:38 ` [PATCH V4 6/6] Fortran: Testsuite, add cyclic pointers Bernhard Heckel
2016-10-13 14:08 ` Yao Qi
2016-09-07 6:38 ` Bernhard Heckel [this message]
2016-09-21 15:57 ` [PATCH V4 1/6] Fortran: Testsuite, fix differences in type naming Yao Qi
2016-09-14 12:55 ` [PING][PATCH V4 0/6] Fortran: Resolve target types of pointers Bernhard Heckel
2016-09-28 12:45 ` Bernhard Heckel
2016-10-05 6:03 ` [ping 2][PATCH " Bernhard Heckel
2016-09-21 9:49 ` [ping 2] [PATCH " Bernhard Heckel
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1473230295-809-2-git-send-email-bernhard.heckel@intel.com \
--to=bernhard.heckel@intel.com \
--cc=brobecker@adacore.com \
--cc=gdb-patches@sourceware.org \
--cc=qiyaoltc@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox