gdb/testsuite/ChangeLog:

2010-10-19  Andrew Burgess  <aburgess@broadcom.com>

	* gdb.fortran/multi-dim.f90: New test program.
	* gdb.fortran/multi-dim.exp: Run new test to check basic printing
          of multi-dimensional fortran arrays. Tests PR gdb/11104.


diff -uNr clean/gdb-7.2.50.20101019/gdb/testsuite/gdb.fortran/multi-dim.exp working/gdb-7.2.50.20101019/gdb/testsuite/gdb.fortran/multi-dim.exp
--- clean/gdb-7.2.50.20101019/gdb/testsuite/gdb.fortran/multi-dim.exp	1970-01-01 01:00:00.000000000 +0100
+++ working/gdb-7.2.50.20101019/gdb/testsuite/gdb.fortran/multi-dim.exp	2010-10-19 15:53:13.928699000 +0100
@@ -0,0 +1,79 @@
+# Copyright 2010 Free Software Foundation, Inc.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program.  If not, see <http://www.gnu.org/licenses/>.
+
+# This file was written by Wu Zhou. (woodzltc@cn.ibm.com)
+
+# This file is part of the gdb testsuite.  It contains tests for evaluating
+# Fortran subarray expression.
+
+if $tracelevel then {
+	strace $tracelevel
+}
+
+if { [skip_fortran_tests] } { return -1 }
+
+set testfile "multi-dim"
+set srcfile ${testfile}.f90
+set binfile ${objdir}/${subdir}/${testfile}
+
+if {[gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" \
+	executable {debug f77}] != ""} {
+    return -1
+}
+
+gdb_exit
+gdb_start
+gdb_reinitialize_dir $srcdir/$subdir
+gdb_load ${binfile}
+
+if ![runto MAIN__] then {
+    perror "Couldn't run to MAIN__"
+    continue
+}
+
+gdb_test "break 20" \
+    "Breakpoint.*at.* file .*$srcfile, line 20\\." \
+    "breakpoint at line 20"
+
+gdb_test "continue" \
+    "Breakpoint 2, test \(\).*at.*multi-dim\.f90:20.*" \
+    "Continue to breakpoint"
+
+gdb_test "print foo(2,3,4)" \
+    "\\\$1 = 20" \
+    "print the contents of the array"
+
+gdb_test "print foo(0,0,0)" \
+    "no such vector element" \
+    "print an invalid array index (0,0,0)"
+
+gdb_test "print foo(2,3,5)" \
+    "no such vector element" \
+    "print an invalid array index (2,3,5)"
+
+gdb_test "print foo(2,4,4)" \
+    "no such vector element" \
+    "print an invalid array index (2,4,4)"
+
+gdb_test "print foo(3,3,4)" \
+    "no such vector element" \
+    "print an invalid array index (3,3,4)"
+
+gdb_test "print foo" \
+    "\\\$2 = \\(\\( \\( 10, 10\\) \\( 10, 10\\) \\( 10, 10\\) \\) \\( \\( 10, 10\\) \\( 10, 10\\) \\( 10, 10\\) \\) \\( \\( 10, 10\\) \\( 10, 10\\) \\( 10, 10\\) \\) \\( \\( 10, 10\\) \\( 10, 10\\) \\( 10, 20\\) \\) \\)" \
+    "print full contents of the array"
+
+gdb_exit
+
diff -uNr clean/gdb-7.2.50.20101019/gdb/testsuite/gdb.fortran/multi-dim.f90 working/gdb-7.2.50.20101019/gdb/testsuite/gdb.fortran/multi-dim.f90
--- clean/gdb-7.2.50.20101019/gdb/testsuite/gdb.fortran/multi-dim.f90	1970-01-01 01:00:00.000000000 +0100
+++ working/gdb-7.2.50.20101019/gdb/testsuite/gdb.fortran/multi-dim.f90	2010-10-19 15:53:13.972696000 +0100
@@ -0,0 +1,21 @@
+! Copyright 2010 Free Software Foundation, Inc.
+!
+! This program is free software; you can redistribute it and/or modify
+! it under the terms of the GNU General Public License as published by
+! the Free Software Foundation; either version 3 of the License, or
+! (at your option) any later version.
+! 
+! This program is distributed in the hope that it will be useful,
+! but WITHOUT ANY WARRANTY; without even the implied warranty of
+! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+! GNU General Public License for more details.
+! 
+! You should have received a copy of the GNU General Public License
+! along with this program.  If not, see <http://www.gnu.org/licenses/>.
+
+program test
+  integer :: foo (2, 3, 4)
+  foo (:, :, :) = 10
+  foo (2, 3, 4) = 20
+  foo (2, 3, 4) = 20
+end
