namelist_20.f90

来自「用于进行gcc测试」· F90 代码 · 共 36 行

F90
36
字号
!{ dg-do run }! Tests namelist io for an explicit shape array with negative bounds! provided by Paul Thomas - pault@gcc.gnu.orgprogram 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 doend program namelist_20 

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?