-
Notifications
You must be signed in to change notification settings - Fork 15.1k
Closed
Labels
bugIndicates an unexpected problem or unintended behaviorIndicates an unexpected problem or unintended behaviorflang:runtime
Description
LLVM flang produces incorrect output while attempting to read to a namelist. Consider the following reproducer:
program main
type array_t
integer :: n = 0
real :: a = 0.
real :: b = 0.
end type array_t
type(array_t),save :: array_inp(1000)
character*20 :: name_inp = ''
namelist /params/ &
array_inp, &
name_inp
open(UNIT=10,FILE="input",STATUS='OLD')
read(10,NML=params)
close(10)
print *, name_inp
end program
For the input file named input having contents:
¶ms
array_inp =
22784, 6.00, 12.00,
4864, 8.00, 16.00,
name_inp = 'my-name',
/
Compiled with flang-new -g <filename>.f90 and run with ./a.out, empty newline is observed. As opposed, compiling with gfortran -g <filename>.f90 and running with ./a.out, correct output my-name is observed.
Metadata
Metadata
Assignees
Labels
bugIndicates an unexpected problem or unintended behaviorIndicates an unexpected problem or unintended behaviorflang:runtime