aboutsummaryrefslogtreecommitdiff
path: root/gdb
diff options
context:
space:
mode:
authorBhuvanendra Kumar N <Bhuvanendra.KumarN@amd.com>2021-05-11 17:26:46 +0530
committerAlok Kumar Sharma <AlokKumar.Sharma@amd.com>2021-05-11 17:50:00 +0530
commitabb894a4703ddf1d2f4b9c103d63f911c017e26a (patch)
treebf97208bef9ef24c9a77a8e6d19a19f88c13bfcf /gdb
parent8ca5537ba56b72518353541784b2b0a49c978893 (diff)
downloadgdb-abb894a4703ddf1d2f4b9c103d63f911c017e26a.zip
gdb-abb894a4703ddf1d2f4b9c103d63f911c017e26a.tar.gz
gdb-abb894a4703ddf1d2f4b9c103d63f911c017e26a.tar.bz2
gdb/fortran: Breakpoint location is modified.
Breakpoint location is modified to "return" statement which is outside the DO loop. Because the label 100 of DO loop should get executed for each iteration as shared in this external link: http://www-pnp.physics.ox.ac.uk/~gronbech/intfor/node18.html. flang compiler is following this fortran standard, whereas gfortran compiler is not following, hence the test case is passing with gfortran and failing with flang. but to correct this gfortran behavior, bug has been filed in bugzilla (https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99816). As reported in the bug, with gfortran, label 100 of DO loop is reached only after the completion of the entire DO loop. Hence at label 100, all the array elements are set and printing of array element a(2) succeeds. whereas with flang, when we are at label 100 for first time, array element a(2) is not yet set, only a(1) is set, hence moving the breakpoint location to outside the DO loop, so that once we are outside the DO loop, we can print any of the array elements. This change in test case is done irrespective of any fortran compiler. gdb/testsuite/ChangeLog: * gdb.fortran/array-element.exp: Breakpoint location is modified.
Diffstat (limited to 'gdb')
-rw-r--r--gdb/testsuite/ChangeLog4
-rw-r--r--gdb/testsuite/gdb.fortran/array-element.exp4
2 files changed, 6 insertions, 2 deletions
diff --git a/gdb/testsuite/ChangeLog b/gdb/testsuite/ChangeLog
index c188719..ee963ee 100644
--- a/gdb/testsuite/ChangeLog
+++ b/gdb/testsuite/ChangeLog
@@ -1,3 +1,7 @@
+2021-05-11 Bhuvanendra Kumar <Bhuvanendra.KumarN@amd.com>
+
+ * gdb.fortran/array-element.exp: Breakpoint location is modified.
+
2021-05-10 Lancelot Six <lsix@lancelotsix.com>
PR gdb/27614
diff --git a/gdb/testsuite/gdb.fortran/array-element.exp b/gdb/testsuite/gdb.fortran/array-element.exp
index 28b0e6f..9518b87 100644
--- a/gdb/testsuite/gdb.fortran/array-element.exp
+++ b/gdb/testsuite/gdb.fortran/array-element.exp
@@ -31,8 +31,8 @@ if ![runto sub_] then {
continue
}
-gdb_breakpoint [gdb_get_line_number "continue"]
-gdb_continue_to_breakpoint "continue"
+gdb_breakpoint [gdb_get_line_number "return"]
+gdb_continue_to_breakpoint "return"
gdb_test "print a(1)" ".*1 = 1.*" "print the first element of array a"
gdb_test "print a(2)" ".*2 = 2.*" "print the second element of array a"