Issue |
149164
|
Summary |
[flang] Runtime failure with stream formatted I/O
|
Labels |
flang:runtime
|
Assignees |
|
Reporter |
DanielCChen
|
Consider the following code
```
program main
use ieee_arithmetic
complex(4), pointer :: cx1(:,:), cx2(:)
character(:), allocatable :: string
10 format(dc, 12(" (", e22.15, " ; ", e22.15, " );"))
open (1, file='valueSeparator005.data', access='stream', form='formatted')
string = repeat(' ', 800)
allocate (cx1(2,5))
cx1 = cmplx(reshape((/(i, i=-10,-1)/), (/2,5/)), &
reshape((/(i**2, i=-10,-1)/), (/2,5/)), 4)
write (string, 10) cx1
!! now read in data from both external and internal files
allocate (cx2(10))
read (string, *, decimal='coMMA') cx2
end
```
Flang failed at the runtime with
```
> a.out
fatal Fortran runtime error(t.f:23): Bad real input data at column 51 of record 1
IOT/Abort trap(coredump)
```
All ifort, gfortran and XLF compile and execute the program successfully.
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs