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

    <tr>
        <th>Summary</th>
        <td>
            [flang][OpenMP] The compilation fails with nowait on target construct with -g.
        </td>
    </tr>

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

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

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

<pre>
    Please see the testcase below.

```
program nowait_reproducer
   implicit none
 real x

   !$omp target map(tofrom: x) nowait
      x = x + 1
   !$omp end target

end program nowait_reproducer
```

This is what I get when I try to compile it with -g.

```
flang -g -O0 test.f90 -fopenmp
flang-20: warning: OpenMP support in flang is still experimental [-Wexperimental-option]
inlinable function call in a function with debug info must have a !dbg location
  call void @__omp_offloading_10302_4986ae0__QQmain_l10(ptr %1)
error: failed to create the LLVM module
```
</pre>
<img width="1" height="1" alt="" src="http://email.email.llvm.org/o/eJx8U12L3DgQ_DXyS-NBlkfz8eCHWYaBQEISCHePpm21bR2yJCR5Z_PvD9ledjmOgPBH4S53VXdhjHq0RA2TL0wI7LSamBBM3gtc0uRCs0JF59Tv5ochjASRCNJEkCimPgMdGfc8MH7L58T3w28-uDHgDNY9Uac2kA9OLT0Fxm8AoGdvdK8TWGcpQ4HQwNvGAwBMVEwc3ewhYRgpwYyeiUtyQ3Azq2_wxsR1J98qAOANWH3PV_EC1X95yKqda_tJfv9Tk5_FMH77NekIOsJzwgRfILf0nMjCF0jhNyQHvZu9NgQ6wVOnCcrxf1wZDNoRyhHK73z18DBcOZSD82Rn__5BKXiW-MRgtR3z43dP9tsPiIv3LiTQFjYmHSEmbQzQm6egZ7IJDTD5Uv79GSmdT9pZJu-M37Q12mJnCIbF9hmHHo3JpPgBrRoUdcsI2g4O5iUmmPCVALOpqhvBuB5X2uz0SvHqtAJ25G3rZt-6YTAOlbZjW_Gai_Z4vZyQeNv-_Dmjtq2pOBMXnwIwISsmrnksIbiQJQ-oDanV2UCYtrX7-vWvbzA7tRj67Gyhmlpd6ysW1FTn-iLkseaXYmq6Wp5IiOvAz7VSKM9HKbE-KSWJqqqXhW4EF5JXNa9OQvLz4XiuThVWXcdPWElU7MhpRm0OxrzOBxfGQse4UFMJyS-XwmBHJu4JWmeyJyg0uaDsljGyIzc6pvhBkXQya-y2Cnln8mUbMZN3-DXRvk2rvasTcRvItqjg7HssemdjCkv_sXTFEkwzpeQjq29MPJh4jDpNS3fo3czEIzex30of3D_UJyYeq6jIxGPX9dqIfwMAAP__i39QOw">