<table border="1" cellspacing="0" cellpadding="8">
    <tr>
        <th>Issue</th>
        <td>
            <a href=https://github.com/llvm/llvm-project/issues/75136>75136</a>
        </td>
    </tr>

    <tr>
        <th>Summary</th>
        <td>
            [Flang] Incorrect execution result of namelist output statement
        </td>
    </tr>

    <tr>
      <th>Labels</th>
      <td>
            flang
      </td>
    </tr>

    <tr>
      <th>Assignees</th>
      <td>
      </td>
    </tr>

    <tr>
      <th>Reporter</th>
      <td>
          ohno-fj
      </td>
    </tr>
</table>

<pre>
    ```
Version of flang-new : 18.0.0(770dc47659d41a5ca7b7daf5b3134c900ca8c33d)
```

`Namelist output` statement does not output `namelist-group-name` after an ampersand character.  
The output is expected to be AA, not XXX.

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

snen_mod_n067_2.f90:
```fortran
module mod0
real a
real b
namelist /aa/a,b
end

module mod3
use mod0,xxx=>aa
end

use mod3
implicit none
a=1.0
b=2.0
write(6,xxx)
end
```

```
$ flang-new snen_mod_n067_2.f90; ./a.out
&XXX A= 1.,B= 2./
$
```

```
$ gfortran snen_mod_n067_2.f90; ./a.out
&AA
 A=  1.00000000    ,
 B=  2.00000000    ,
 /
$
```

```
$ ifort snen_mod_n067_2.f90; ./a.out
 &AA
 A       =   1.000000    ,
 B       =   2.000000
 /
$
```

</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJyclMuO6zYPx59G2RAxZMqXZOFFJvnyoZuuiiK7gSzRjg9syZDkTvr2hXyZmQzOAaY1gliiSP5_ImhK77vWEFUsf2H5ZSencLeusndj982PXW313xUr-PrjF8ZPf5LznTVgG2h6adq9oTdg4gTpIeEJZ3goS65VVhb5UWepzJUs61LLJq9FKjJ15FzJgxJCMzwuKb8ovBt_lwP1nQ9gpzBOgRUcfJCBBjIBtCUPxm6HwApuVv996-w07uM2xsgmkANpQA4jOS-NBnWXTqpALgFY5P6405ap80CPkVQgDcFCTXA6MTzPYrfbLflMGcMa2_f2rTMtSEcQ7gSBfIDR2dbJIUZet0LFzf8b64KLOEZDFzeg7DB2vQydNQyv9CA1xTU48lMfngS9IfM6WP1qeFG-YtIcOROnL3VcFRbrYPXUEwxWr_V1JHuQn9b1st7KBwyvUsY_huf1jIz-TPGRUyyGya8KeH48HkxcmPiflD-NXV3XwG4Y-051AYw1tJgkE5c0WWFrJi64bd5cF4jhoVhltgb6UPhFJz0ZMfvUuT-t5wsk8fqJncIWU9xuNzgxcYE0YXh-iSuMXu9J_x1Bu3XBtwFOa7KFAtKErw8AAMPzejqTAf7i9L8DL536PVp4woXlmbnesb9AP_ls8N9l3ulK6KM4yh1VaclR5HlWZLt7lWrSqFClhcgyKdXhmOtcHwt5EKjKVO66CjmKFFPkmUh5lmBTiLTEHMscRV1nLOM0yK5P-v6vIbGu3XXeT1SVeSqKXS9r6v08PBHnnmKIcY66Kvrv66n1LOPxo_IfGUIX-nnizmOB5Rf4zSjrHKkAX7_9OGbN8xj8mIG7yfXVPYTRxxGAV4bXtgv3qU6UHRheo-L62o_O_iAVGF7nC3iG1_kO_wQAAP__9gmsuQ">