aboutsummaryrefslogtreecommitdiff
path: root/gdb/testsuite/gdb.fortran
diff options
context:
space:
mode:
authorJan Kratochvil <jan.kratochvil@redhat.com>2011-06-29 22:05:16 +0000
committerJan Kratochvil <jan.kratochvil@redhat.com>2011-06-29 22:05:16 +0000
commit32019081a7af77c58fc3b4dbbf43a77e6f1a7c86 (patch)
tree9de855a84068a36b94476a2b5338e8559b6e6040 /gdb/testsuite/gdb.fortran
parent70c622a3d28b08cb57b8c8569658aa767241e161 (diff)
downloadgdb-32019081a7af77c58fc3b4dbbf43a77e6f1a7c86.zip
gdb-32019081a7af77c58fc3b4dbbf43a77e6f1a7c86.tar.gz
gdb-32019081a7af77c58fc3b4dbbf43a77e6f1a7c86.tar.bz2
gdb/
Fix non-only rename list for Fortran modules import. * cp-namespace.c (cp_scan_for_anonymous_namespaces): Adjust the cp_add_using_directive caller. (cp_add_using_directive): New parameter excludes, describe it. New variables ix and param. Compare if also excludes match. Allocate NEW with variable size, initialize EXCLUDES there. (cp_lookup_symbol_imports): New variable excludep, test current->EXCLUDES with it. * cp-support.h: Include vec.h. (struct using_direct): New field excludes, describe it. (DEF_VEC_P (const_char_ptr)): New. (cp_add_using_directive): New parameter excludes. * defs.h (const_char_ptr): New typedef. * dwarf2read.c (read_import_statement): New variables child_die, excludes and cleanups, read in excludes. (read_namespace): Adjust the cp_add_using_directive caller. gdb/testsuite/ Fix non-only rename list for Fortran modules import. * gdb.fortran/module.exp (print var_x, print var_y, print var_z): New tests. * gdb.fortran/module.f90 (module moduse): New. (program module): use moduse, test var_x, var_y and var_z.
Diffstat (limited to 'gdb/testsuite/gdb.fortran')
-rw-r--r--gdb/testsuite/gdb.fortran/module.exp3
-rw-r--r--gdb/testsuite/gdb.fortran/module.f907
2 files changed, 10 insertions, 0 deletions
diff --git a/gdb/testsuite/gdb.fortran/module.exp b/gdb/testsuite/gdb.fortran/module.exp
index 364c59d..6df56b5 100644
--- a/gdb/testsuite/gdb.fortran/module.exp
+++ b/gdb/testsuite/gdb.fortran/module.exp
@@ -51,6 +51,9 @@ gdb_test "print var_b" " = 11"
gdb_test "print var_c" "No symbol \"var_c\" in current context\\."
gdb_test "print var_d" " = 12"
gdb_test "print var_i" " = 14" "print var_i value 14"
+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.}
diff --git a/gdb/testsuite/gdb.fortran/module.f90 b/gdb/testsuite/gdb.fortran/module.f90
index 843ad89..d9eb1b3 100644
--- a/gdb/testsuite/gdb.fortran/module.f90
+++ b/gdb/testsuite/gdb.fortran/module.f90
@@ -27,6 +27,10 @@ module modmany
integer :: var_a = 10, var_b = 11, var_c = 12, var_i = 14
end module modmany
+module moduse
+ integer :: var_x = 30, var_y = 31
+end module moduse
+
subroutine sub1
use mod1
if (var_i .ne. 1) call abort
@@ -42,6 +46,7 @@ end module modmany
program module
use modmany, only: var_b, var_d => var_c, var_i
+ use moduse, var_z => var_y
call sub1
call sub2
@@ -49,5 +54,7 @@ end module modmany
if (var_b .ne. 11) call abort
if (var_d .ne. 12) call abort
if (var_i .ne. 14) call abort
+ if (var_x .ne. 30) call abort
+ if (var_z .ne. 31) call abort
var_b = var_b ! a-b-c-d
end