flang icon indicating copy to clipboard operation
flang copied to clipboard

A bug with no advance WRITE

Open ghost opened this issue 4 years ago • 0 comments

Here is test case which can not output the right result. It is expected output "abcxxx", but the result it just "abc".

program test
  character(len=20) :: rslts
  ! write something no advance
  open(10,file="fort.10",position="rewind")
  write(10, '(a,t1,a)',advance='no') 'xxxxxx', 'abc'
  close(10)
  ! check what is in the first record
  open(10,file="fort.10",position="rewind")
  read(10,'(a)') rslts
  close(10, status="delete")
  if (rslts .ne. "abcxxx") STOP 1
end program

ghost avatar Feb 04 '21 07:02 ghost