OpenCores
URL https://opencores.org/ocsvn/openrisc/openrisc/trunk

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-old/] [gcc-4.2.2/] [gcc/] [testsuite/] [gfortran.dg/] [namelist_20.f90] - Rev 868

Go to most recent revision | Compare with Previous | Blame | View Log

!{ dg-do run }
! Tests namelist io for an explicit shape array with negative bounds
! provided by Paul Thomas - pault@gcc.gnu.org

program namelist_20
  integer, dimension (-4:-2) :: x
  integer                    :: i, ier
  namelist /a/ x

  open (10, status = "scratch")
  write (10, '(A)') "&a x(-5)=0 /"            !-ve index below lbound
  write (10, '(A)') "&a x(-1)=0 /"            !-ve index above ubound
  write (10, '(A)') "&a x(1:2)=0 /"           !+ve indices
  write (10, '(A)') "&a x(-4:-2)= -4,-3,-2 /" !correct
  write (10, '(A)') " "
  rewind (10)

  ier=0
  read(10, a, iostat=ier)
  if (ier == 0) call abort ()
  ier=0
  read(10, a, iostat=ier)
  if (ier == 0) call abort ()
  ier=0
  read(10, a, iostat=ier)
  if (ier == 0) call abort ()

  ier=0
  read(10, a, iostat=ier)
  if (ier /= 0) call abort ()
  do i = -4,-2
    if (x(i) /= i) call abort ()
  end do

end program namelist_20 

Go to most recent revision | Compare with Previous | Blame | View Log

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.