forked from Imagelibrary/binutils-gdb
2014-05-28 Bernhard Heckel <bernhard.heckel@intel.com> Sanimir Agovic <sanimir.agovic@intel.com> Keven Boell <keven.boell@intel.com> gdb/Changelog: * dwarf2read.c (read_subrange_type): Read dynamic stride attributes. * gdbtypes.c (create_array_type_with_stride): Add stride support (create_range_type): Add stride parameter. (create_static_range_type): Pass default stride parameter. (resolve_dynamic_range): Evaluate stride baton. * gdbtypes.h (TYPE_BYTE_STRIDE): New macro. (TYPE_BYTE_STRIDE_BLOCK): New macro. (TYPE_BYTE_STRIDE_LOCLIST): New macro. (TYPE_BYTE_STRIDE_KIND): New macro. * valarith.c (value_subscripted_rvalue): Use stride. gdb/testsuite/Changelog: * vla-stride.exp: New file. * vla-stride.f90: New file. Change-Id: I3cd90c5514dc8ea8c0f7b67f450d9a45822257dc
30 lines
1.0 KiB
Fortran
30 lines
1.0 KiB
Fortran
! Copyright 2016 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 vla_stride
|
|
integer, target, allocatable :: vla (:)
|
|
integer, pointer :: pvla (:)
|
|
|
|
allocate(vla(10))
|
|
vla = (/ (I, I = 1,10) /)
|
|
|
|
pvla => vla(10:1:-1)
|
|
pvla => pvla(10:1:-1)
|
|
pvla => vla(1:10:2) ! re-reverse-elements
|
|
pvla => vla(5:4:-2) ! odd-elements
|
|
|
|
pvla => null() ! single-element
|
|
end program vla_stride
|