diff options
author | Christoph Weinmann <christoph.t.weinmann@intel.com> | 2013-12-04 11:47:15 +0000 |
---|---|---|
committer | Bernhard Heckel <bernhard.heckel@intel.com> | 2016-09-07 12:08:48 +0200 |
commit | dbfd7140bf4c0500d1f5d192be781f83f78f7922 (patch) | |
tree | 91598aa77cf447ac1d578601a87958e2ac22e3d5 /gdb/testsuite/gdb.fortran/static-arrays.f90 | |
parent | 3067104c36cd8405ef1a90f39917ee0d3b1c6b13 (diff) | |
download | binutils-users/bheckel/fortran-strides.zip binutils-users/bheckel/fortran-strides.tar.gz binutils-users/bheckel/fortran-strides.tar.bz2 |
fortran: test cases for subarray strides and slicesusers/bheckel/fortran-strides
Add test cases for subarray creation with range, literal and
stride value permutations for one, two, and three dimensional
arrays.
2013-12-04 Christoph Weinmann <christoph.t.weinmann@intel.com>
testsuite/gdb.fortran/
* static-arrays.exp: New test.
* static-arrays.f90: New file.
Signed-off-by: Christoph Weinmann <christoph.t.weinmann@intel.com>
Diffstat (limited to 'gdb/testsuite/gdb.fortran/static-arrays.f90')
-rw-r--r-- | gdb/testsuite/gdb.fortran/static-arrays.f90 | 55 |
1 files changed, 55 insertions, 0 deletions
diff --git a/gdb/testsuite/gdb.fortran/static-arrays.f90 b/gdb/testsuite/gdb.fortran/static-arrays.f90 new file mode 100644 index 0000000..f22fcbe --- /dev/null +++ b/gdb/testsuite/gdb.fortran/static-arrays.f90 @@ -0,0 +1,55 @@ +! Copyright 2015 Free Software Foundation, Inc. +! +! Contributed by Intel Corp. <christoph.t.weinmann@intel.com> +! +! 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/>. + +subroutine sub + integer, dimension(9) :: ar1 + integer, dimension(9,9) :: ar2 + integer, dimension(9,9,9) :: ar3 + integer, dimension(10,-7:3, -15:-5) :: ar4 + integer :: i,j,k + + ar1 = 1 + ar2 = 1 + ar3 = 1 + ar4 = 4 + + ! Resulting array ar3 looks like ((( 111, 112, 113, 114,...))) + do i = 1, 9, 1 + ar1(i) = i + do j = 1, 9, 1 + ar2(i,j) = i*10 + j + do k = 1, 9, 1 + ar3(i,j,k) = i*100 + j*10 + k + end do + end do + end do + + do i = 1, 10, 1 + do j = -7, 3, 1 + do k = -15, -5, 1 + ar4(i,j,k) = i*100 + (j+8)*10 + (k+16) + end do + end do + end do + + ar1(1) = 11 !BP1 + return +end + +program testprog + call sub +end |