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

    <tr>
        <th>Summary</th>
        <td>
            [Flang] Missing error for MODULE prefix in abstract interface body
        </td>
    </tr>

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

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

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

<pre>
    Flang fails to diagnose an invalid `MODULE` prefix on a function declared inside an ABSTRACT INTERFACE block.

Expected behavior: The code should be rejected at compile time. Per the Fortran standard, MODULE may appear only in the function or subroutine of a module subprogram, or of a nonabstract interface body declared in the scoping unit of a module or submodule.

Actual behavior: Flang compiles the program successfully with no diagnostic.

Reproducer:

```Fortran
Module mod_test
Abstract Interface
  Pure Integer Module Function f1(i)
    Integer, Intent(In) :: i
  End Function
End Interface
End Module

```
</pre>
<img width="1" height="1" alt="" src="http://email.email.llvm.org/o/eJx0U91unDwQfRpzM8rKGNhlL7ggySJF-vI1SrfXlcEDODU28s82-_aVgU2bSpWQsMczZ86cmeHOyUEjVqS4J8VjwoMfja3wzTikLGmNuFaN4nqAnkvlwBsQkg_aOASuQeoLV1IA2dPnL4_f_juRPYXZYi_fwWjg0AfdeWk0COwUtyhAaifFElzffz2_1g9nePr_fHpt6ocTtMp0P3aE1oTWp_cZO48CWhz5RRpLshrOI0JnBIIbTVDxDSy-rX7cQ2emWSoELyfcwQta8CNCY6y3XIPzXAtuBWEPsNKFiV-BzzNyC0arK0i9RHzQNhZcaK0JXmoE0wOHyYigMJpnawbLpwhn7Pqojeat85Z3HqT2aHveIUQZ_1RgyeE6M0s9QNDSf0Jec66XTYu684GrT0qsXdkKdgvixgdc6Dp0rg9KXeGn9CPoj7Z52W2YrzhbI0KHEW41kT1dv00xQuvnldNkxHePzkcut_qebvURWgO8BIuLaUALW1Rzk7FPCSslYcfFFW5-Ubl41J6w8kkTdoTIJatBLo4nLT4w4kRo8SlpvK-Z_qKfiCoTx-zIE6zSQ5kVaUqPx2SsOC9ZgeKQ5lj2Jc3znrI2b4s0S1tsaZ_IilG2pwdapmmeF8dddqBFgW27zwpWlCklOcWJS7VT6jLtjB0S6VzAitGSUZoo3qJyyzYx1scWEcbiYtkqBty1YXAkp0o6735DeOnVsoJLU0nxCM_SuTgcaK2x0Bt7G9htuaSGf8xZEqyqRu9nF6VkDWHNIP0Y2l1nJsKamHT73c3WxN0hrFmKcIQ1Wx2Xiv0KAAD__770Wsk">