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

    <tr>
        <th>Summary</th>
        <td>
            In NAMELIST output editing, leading blank is missing.
        </td>
    </tr>

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

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

    <tr>
      <th>Reporter</th>
      <td>
          harishch4
      </td>
    </tr>
</table>

<pre>
    The first character written in a NAMELIST i/o record must be a blank. The words in the Standard are "**Except for continuation of delimited character sequences, each output record begins with a blank character to provide carriage control when the record is printed**" (F95) and **"Except for new records created by explicit formatting within a defined output procedure or by continuation of delimited character sequences, each output record begins with a blank character.**" (F2023).

The **_gfortran_** & **_llvm-flang_** compilers do not put a blank. The **_Intel compiler_** does put a blank for external units but misses the blank for internal units.

```
Program test_namelist_blank
  Integer :: i,j
 Character(300) ::s
  Namelist /nml1/i,j

  i = 99
  j = 42
 Write (s,NML=nml1)
  Write (*,'("Internal ",A)') Merge('ok ','bug',s(1:1)==' ')
  Write (*,NML=nml1)
End Program test_namelist_blank
```
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJy0VMGOozgQ_RpzKU3kGAjhwCHb6UgtTbdWmpH22DK4Au4xdtYuJj1_v7KBdFra1Z5GQgllv1d-rnqFDEH3FrFh5R-sPGZyosH5ZpBeh6Ebiqx16lfzfUA4ax8IukF62RF6uHpNhBa0BQkvh-fHr0_fvoNm4uTAY-e8gnEKBC2ChNZI-2MDMc_VeRUiiwaEbyStkl6B9AhMCCYOTBwe3zu8EJydh85Z0naSpJ0FdwaFRo-aUN0pCfj3hLbDwMQDoOwGcBNdJlpltNhrG-CqaVil3LHJwcW7n1ohdNJ7LXtMp3pn4DrgrHPJpANcvLaEahbKhAAm9qe6ZKIGaRXc1u_uYPG6JAjQeZRRffsL8P1idKcTZpRE2vZJYyqowrO2qNabXLzrUE0ewfnI_e1l2Xy-oOAiZ6LeMH5k_DD_xmbOqNf-7Dx5aV_nGJjYrVvG_By_nI20_brZufGiDfoAyoF1BFHTJ4ss1CdLaG7wla4chntKKjG-E3orDUxWU4B2Ihh1CBhS9z5wsXcfuE_XYTu-PCn807veyxEIA71aOaLRgV5TphkAEPX16IHlB5YfovUf3pa9h7WOTOxzzqM7ZlRYyS9LSmDiZEezZeJ0l2BFaWD5Eep6jd9SXIgl_striuXaxx6_PH9l-XHOdSPcEKl6D0xU6V08rYVIQ_dwiJS4V8Mz-h4TqHI_IC1GWjv183tgYr9l-SGdkh_jI6oZ91-n_ouyR6vgf0t8a0mmmlzVeS0zbLYVL0RVbGueDQ0_7_muKHlXVWVR5GoX1_O2asuyKvm-y3QjuCj4lue8FnXJN3xbFGJfV_V2W-93RcUKjqPUZhONunG-z3QIEzbVrqr3mZEtmpA-jkIkF8d6lcfMN8nY7dQHVvAoPHxkIE0Gmyf78VlcJg-VjmMeB9KgVHHiZ2_qkPyqbb_JJm-agegSomPEiYlTr2mY2k3nRiZO8ZTl78vFuzfsKHonig5MnJLufwIAAP__D8DSew">