Issue 74272
Summary [Flang] Execution error of namelist input statement
Labels flang:frontend
Assignees
Reporter ohno-fj
    ```
Version of flang-new : 18.0.0(770dc47659d41a5ca7b7daf5b3134c900ca8c33d)
```

For `namelist input statement`, execution terminates normally if the input file is:
```
&abc xx=111,yy=222,zz=333,/
```
Execution ends abnormally if the input file is:
```
&abc
x=111,
yy=222,
zz=333,
/
```

Gfortran and ifort terminate normally for all input files.

The following are the test program, Flang-new, Gfortran and ifort compilation/execution result.

ioct149_31.f90:
```fortran
program main
  integer(4) :: xx,yy,zz
  namelist/abc/ xx,yy,zz

  read(5,nml=abc)
  print *,xx
  print *,yy
  print *,zz
end program main
```

```
$ cat data1
&abc xx=111,yy=222,zz=333,/
$
```

```
$ cat data2
&abc
x=111,
yy=222,
zz=333,
/
$
```

```
$ flang-new ioct149_31.f90
$ ./a.out < data1
 111
 222
 333
$ ./a.out < data2

fatal Fortran runtime error(/work/home/ohno/CT/test/fort/tp/reproducerJ/Metro/ioct/ioct149_31.f90:5): 'x' is not an item in NAMELIST group 'abc'
Aborted (core dumped)
$
```

```
$ gfortran ioct149_31.f90
& ./a.out < data1
         111
         222
         333
$ ./a.out < data2
         111
         222
 333
$
```

```
$ ifort ioct149_31.f90
$ ./a.out < data1
 111
         222
         333
$ ./a.out < data2
 111
         222
         333
$
```

_______________________________________________
llvm-bugs mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to