aboutsummaryrefslogtreecommitdiff
path: root/gdb/testsuite
diff options
context:
space:
mode:
Diffstat (limited to 'gdb/testsuite')
-rw-r--r--gdb/testsuite/ChangeLog6
-rw-r--r--gdb/testsuite/gdb.fortran/module.exp13
-rw-r--r--gdb/testsuite/gdb.fortran/module.f9012
3 files changed, 28 insertions, 3 deletions
diff --git a/gdb/testsuite/ChangeLog b/gdb/testsuite/ChangeLog
index b5983cd..3e1c756 100644
--- a/gdb/testsuite/ChangeLog
+++ b/gdb/testsuite/ChangeLog
@@ -1,5 +1,11 @@
2013-12-19 Keven Boell <keven.boell@intel.com>
+ * gdb.fortran/module.exp: Completion matches fortran module
+ names as well. ptype/whatis on modules return a proper type.
+ Add new check for having the correct scope.
+
+2013-12-19 Keven Boell <keven.boell@intel.com>
+
* gdb.fortran/type.f90: New file.
* gdb.fortran/whatis_type.f90: New file.
diff --git a/gdb/testsuite/gdb.fortran/module.exp b/gdb/testsuite/gdb.fortran/module.exp
index 6a2b87d..8f5f1b7 100644
--- a/gdb/testsuite/gdb.fortran/module.exp
+++ b/gdb/testsuite/gdb.fortran/module.exp
@@ -43,6 +43,13 @@ gdb_breakpoint [gdb_get_line_number "i-is-2"]
gdb_continue_to_breakpoint "i-is-2" ".*i-is-2.*"
gdb_test "print var_i" " = 2" "print var_i value 2"
+gdb_breakpoint [gdb_get_line_number "i-is-3"]
+gdb_continue_to_breakpoint "i-is-3" ".*i-is-3.*"
+# Ensure that the scope is correctly resolved.
+gdb_test "p mod3" "Attempt to use a type name as an expression" "print mod3"
+gdb_test "p mod2" " = 3" "print mod2"
+gdb_test "p mod1" " = 3" "print mod1"
+
gdb_breakpoint [gdb_get_line_number "a-b-c-d"]
gdb_continue_to_breakpoint "a-b-c-d" ".*a-b-c-d.*"
gdb_test "print var_a" "No symbol \"var_a\" in current context\\."
@@ -54,7 +61,7 @@ gdb_test "print var_x" " = 30" "print var_x value 30"
gdb_test "print var_y" "No symbol \"var_y\" in current context\\."
gdb_test "print var_z" " = 31" "print var_x value 31"
-gdb_test "ptype modmany" {No symbol "modmany" in current context.}
+gdb_test "ptype modmany" "type = module modmany"
proc complete {expr list} {
set cmd "complete p $expr"
@@ -62,8 +69,8 @@ proc complete {expr list} {
gdb_test $cmd $expect "complete $expr"
}
set modmany_list {modmany::var_a modmany::var_b modmany::var_c modmany::var_i}
-complete "modm" $modmany_list
-complete "modmany" $modmany_list
+complete "modm" "modmany $modmany_list"
+complete "modmany" "modmany $modmany_list"
complete "modmany::" $modmany_list
complete "modmany::var" $modmany_list
diff --git a/gdb/testsuite/gdb.fortran/module.f90 b/gdb/testsuite/gdb.fortran/module.f90
index ada7262..d10b1fb 100644
--- a/gdb/testsuite/gdb.fortran/module.f90
+++ b/gdb/testsuite/gdb.fortran/module.f90
@@ -23,6 +23,12 @@ module mod2
integer :: var_i = 2
end module mod2
+module mod3
+ integer :: mod2 = 3
+ integer :: mod1 = 3
+ integer :: var_i = 3
+end module mod3
+
module modmany
integer :: var_a = 10, var_b = 11, var_c = 12, var_i = 14
end module modmany
@@ -43,6 +49,11 @@ end module moduse
var_i = var_i ! i-is-2
end
+ subroutine sub3
+ USE mod3
+ var_i = var_i ! i-is-3
+ END
+
program module
use modmany, only: var_b, var_d => var_c, var_i
@@ -50,6 +61,7 @@ end module moduse
call sub1
call sub2
+ call sub3
if (var_b .ne. 11) call abort
if (var_d .ne. 12) call abort