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

    <tr>
        <th>Summary</th>
        <td>
            [Flang] Missing diagnostic on submodule name being the same as its extended module name
        </td>
    </tr>

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

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

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

<pre>
    Consider the following code
```
module m
end

submodule(m) m
end
```

Flang compiles the code successfully. 
Both module name and submodule name are global identifiers. They shall not be the same.

</pre>
<img width="1" height="1" alt="" src="http://email.email.llvm.org/o/eJxckcGunDoMhp8mbKKDjBmGYZEFZ0bs7u6-QEIMpArJCIfTzttXobQdVUJCsrE__P2a2c2BSInmUzSPQu9piZt66ODI3-8LhcJE-1L3GNhZ2mRaSE7R-_jdhVmO0ZKAXlzhfKBfo909yVVAT8HmJvS8m19lgbdVYPfefRsV0A9eH2vXp_PEBy0zJO_jSMzT7v2rlAL6z5gWebKCXknqYOUfzlnaSM4-Gu2lsxSSmxxtXMr_F3pJXrT3MsQkDR0c1iuVAvrCqtp2dacLUlVbd1i1t-ZSLErXuoX21tRoJzsZ3Xb1rYJxtLrV0I2mcAoBG8AKEOACtxKuVKGZWl3ZBkYAcQFatfOl919rGbe5cMw7qQqvTYeF14Y8H1EgTtmEqPtpiyFlV4g5oE3l2Q-zzywu4B0n_rstueSPKA-NonnI_xxzDso6PYfIyY0yhn89Gcqf_HYgNUuXWNKPjCX7brnYN6-WlJ4s6l7gIHCYXVp2U45xFTjkPzlfH88tfqMxCRyOI1ngcN75pfBnAAAA__8h0M2p">