Closed
Description
The value written with E20.0 is "0.E+01" and IOSTAT is not set to non-zero.
However, with classic-flang and gfortran, IOSTAT is assigned a non-zero value. Sample.
Sample.f90
Program test_WRITE_IOSTAT
Integer, Parameter:: quad = selected_real_kind(22)
Integer :: i
Write(*,'(E20.0)',iostat=i) 1.0_quad
If (i==0) Then
Print '("bug quad")'
Else
Print '("ok quad")'
End if
Write(*,'(E20.0)',iostat=i) 1.0d0
If (i==0) Then
Print '("bug double")'
Else
Print '("ok double")'
End if
Write(*,'(E20.0)',iostat=i) 1.0
If (i==0) Then
Print '("bug real")'
Else
Print '("ok real")'
End if
End Program test_WRITE_IOSTAT
llvm-flang output:
0.10000000E+01
bug quad
0.10000000E+01
bug double
0.10000000E+01
bug real