iomsg_1.f90

来自「linux下编程用 编译软件」· F90 代码 · 共 29 行

F90
29
字号
! { dg-do run }! Test implementation of the iomsg tag.program iomsg_test  character(len=70) ch  ! Test that iomsg is left unchanged with no error  ch = 'asdf'  open(10, status='scratch', iomsg=ch, iostat=i) ! { dg-warning "Fortran 2003: IOMSG tag" }  if (ch .ne. 'asdf') call abort  ! Test iomsg with data transfer statement  read(10,'(I2)', iomsg=ch, end=100) k ! { dg-warning "Fortran 2003: IOMSG tag" }  call abort100 continue  if (ch .ne. 'End of file') call abort  ! Test iomsg with open  open (-3, err=200, iomsg=ch) ! { dg-warning "Fortran 2003: IOMSG tag" }  call abort200 continue  if (ch .ne. 'Bad unit number in OPEN statement') call abort  ! Test iomsg with close  close(23,status="no_idea", err=500, iomsg=ch) ! { dg-warning "Fortran 2003: IOMSG tag" }500 continue  if (ch .ne. "Bad STATUS parameter in CLOSE statement") call abortend program iomsg_test

⌨️ 快捷键说明

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