<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/65035>65035</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
[Flang] Compilation error of multiple program units in one line
</td>
</tr>
<tr>
<th>Labels</th>
<td>
flang:frontend
</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(c07062a2e9bf9aa1211b958f6bb4c5746139c180)
```
Writing more than one program unit in one line results in a compilation error.
If one program unit is written in one line, Flang-new can compile successfully. ifort has similar results.
The following are the test program, Flang-new, Gfortran and ifort compilation result.
listing01_.f90:
```fortran
program main;i=1;call sub(i);end program;subroutine sub(i);integer i;write(6,*) "i=",i;end subroutine
```
```
$ flang-new listing01_.f90
error: Could not parse listing01_.f90
./listing01_.f90:1:42: error: expected end of line
program main;i=1;call sub(i);end program;subroutine sub(i);integer i;write(6,*) "i=",i;end subroutine
^
$
```
```
$ gfortran listing01_.f90
$
```
```
$ ifort listing01_.f90
listing01_.f90(1): error #5141: Program unit END statement must be the last statement on a line
program main;i=1;call sub(i);end program;subroutine sub(i);integer i;write(6,*) "i=",i;end subroutine
-----------------------------------------^
compilation aborted for listing01_.f90 (code 1)
$
```
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJzMVU2v4zYM_DXyhYghU7ZjH3zIx6bopeihaI-FbFOJFrIUSPJu998XspO8vPS16N42CBKEkYecITmSIeizJepYtWfVMZNzvDjfuYt1G_U56934rWM1v735kfHd7-SDdhacAmWkPW8sfQUmdlA0Oc85w2bgW16jRGp71UpZYFH0bdWouu_LodqWdSHaoWg4w3aFfMmwfv7hddT2DJPzBPEiLThLcPXu7OUEs9UR9Boz2hJ4CrOJIcUkDG66aiNjqpO8dz5fMX9WH4AE-Op1jGSf8Rge4PSgN0h7wyQI8zBQCGo25lsOWjkf4SIDBD1pI_29kPyZy28XAuWMcV8TI7kQIogU4r2Wd_nSj58SsJcWpB1vWZ5ZrVneJTE6JMF48WeuWs7E7kXcG-AavUswSW2Z2GsmjgUT-0EaA2HuGTY6tUfsyY6PGsU-zL13c0yCvzulbaQzedBM7JOaxLCpGR4Y7hi2wBBTBobI8KBvqG9Y_zEFr0Esn6buhfFyYml3GseDm80I1kW4Sh_ow8M5w9M_ZCuY2JWYIB5Y9NeVhkgjpLqdWidkQQD4AZUEVn166PV94p7vY_eRXN-Nts7tR1AvMWyKhf5Nc2AoqqJMnYBfn5f10y9HCFFGmshGmOYQoV-XycgQn_5yyQbe2vQDNmnzf1-PZj7vv-ydTwOpnH_RF5IDu5GgePPXf-lbNnZibEUrM-qKuhVY8IJvs0u37UmVVdm3SowtIYntWNeqrKt-VEJgmekOOQreYMMb3uA2H0aFQg7jOOBWtSVnJadJapMb82XKnT9nOoSZurriosqM7MmE5dJBXPaZiZ3yzkayY5KtOma-S49u-vkcWMkTx_AGFnU0y6W1eCarjnB4tfy0p9Nsor6a944fnn0-m73pLjFeQzJMPDE8nXW8zH0-uCm5g_ly_9pcvftMQ2R4WrgEhqeFzt8BAAD__yelLm4">