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

    <tr>
        <th>Summary</th>
        <td>
            flang fails to lower to FIR on empty module contains
        </td>
    </tr>

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

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

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

<pre>
    On using `flang` version `18.1.2` on Windows, distributed through `conda-forge` I am unable to compile a fortran module with an empty contains section, it fails to lowering.

For example, this simple code fails:

```fortran
module test
integer, public :: N
end module
```
with the error message:
```
error: loc("Path\to\test.f90":2:20): block with no terminator, has "fir.has_value"(%0) : (i32) -> ()
error: verification of lowering to FIR failed
```

This also fails (with the same error):

```fortran
module test
integer, public :: N
contains
end module
```

But this compiles just fine:

```fortran
module test
integer, public :: N
contains
subroutine _placeholder()
end subroutine
end module
```
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJy8VMGOpDYQ_RpzKQ0C083CgcPsblraSxJFkXJcGbsAT4wL2eWZ7N9HBnpnMoqUXBKp2y0Xrx6v6lWXitHOHnEQ14_i-rlQiRcKw5NWW7DExUjm2_CThxStn0G01eSUn0VbwTOGaMnnWN2VdSlzkDz8Zr2hlyjkJzA2crBjYjTAS6A0LxmuyRv1MFGYMed8AbVC8mp0CEygad2sQ1AwUeCgPKxkkkN4sbyA8oDrxt9Ak2dlfYSImi35_D7LMCnrYqZx9ILB-rkU1WdRPR7njQLgH2rdHGY8LzZCtPkKmgwe2aJ5fJsj2ur4nHKO6KmJMfIRsJ5xxpBptzQ6qyHzNI_w4_EcvTkLeUd7XPfieEHAECjAijGqGV-l_BW9gzK5Iy1kJ6T8WfEirp-Y8oGRy6mvhJSiedy_lZB9xo-O9O9HJz0BY1itV0y77EVFEFJONpSLil-flUuYKTL_NRPkikDIzjYy3x5E8wPsT_t3qp4x2MlqlX0Bmr57kX25ffllbzOav63sOH_NxigX6fRTyO57g6Jazy4dNf0HXt1n6185d5wfEx_jdI5vhKcUGSbr8f_QGNMYKLH1CF83pzQu5EzOfuOON_AK-4fSCjM0pm96VeBQf6jrRjZV2xXL0Jumln1zrVFd2roep7pXddePE-rqMo2msIOs5KVq5EU2TV11pW7afjL99cOEXYu6FZcKV2Vd6dzzWlKYCxtjwqFrL9e-cGpEF_dtJOWxa6TMiykMGf8wpjmKS-Vs5PjKwJYdDjv83Qa4jxzd98bZ6Hv7ihTcsDBv-99e3oS8zZaXNJaaViFv-RXnz8MW6Ak1C3nbFUchb7voPwMAAP__1rWcow">