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

    <tr>
        <th>Summary</th>
        <td>
            [OMPIRBuilder][clang] Verification failure with nowait on target construct and -g.
        </td>
    </tr>

    <tr>
      <th>Labels</th>
      <td>
            clang
      </td>
    </tr>

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

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

<pre>
    Consider the following program.

```
int test() {
  int c;

#pragma omp target data map(tofrom: c)
{
  #pragma omp target nowait
  {
      c = 2;
 }
}
  return c;
}
```

When compiled with  `clang -cc1 -triple x86_64-unknown-linux-gnu -emit-llvm-bc -debug-info-kind=standalone -fopenmp -fopenmp-targets=amdgcn-amd-amdhsa`, it fails with the following errors.

`!dbg attachment points at wrong subprogram for function`
</pre>
<img width="1" height="1" alt="" src="http://email.email.llvm.org/o/eJxsUsGOnDgQ_RpzKbllDDT0gUP3oJb2sNrVHjbHqLANOGNsZBfTk7-PaMhkIgUZgaqox3uvHqZkR29My6obkxJ7qycmJau6DFeaQmyfpawP-nv7Enyy2kSgycAQnAsP60dYYhgjzicmrts5i-OIq_UEZBIx2TB5AVbfmLgCbGXFitsxIIsl4jgjhHkBwjgaAo2EMOPCZENhiGFmxRUUk5dt4ID546APD7S094_vtksBKzqQ-0-B1d0Tp3v2o6E1-g9Ge--TCiauXybjQYV5sc5oeFiaANhZKId-BK5UDpyiXZyB9-b89Vzy1b_68PDcWb--89GvwM1siTv3NvNeAdemX0du_RD4q_WaFV0i9Bpd8Ab4EBbj5-Xjhe_qEis6nPWoPMdZb_eUcCMpX8ASDGhd2tn9viETY4jp04JkrvsRkAjVNBtPsATrKQESPGLwI6S1P9YKQ4gwrF6RDZ6dRabbQl-KC2amzeuqvMi6qZtsamtx1qZpDKLQhTBlX5ZDJcvcDMacUWJmWylkJZo8z6uqrppT0dRDY7REFHjBi2SlMDNad9pcOoU4Zjal1bR5VYiyyBz2xqUjqU_rj6TGdrd1HRMrhbOJ0i8IsuSe8f7n73__-u-2WqdNZFXHqtuOUXXwv4l2sAo3iU8X12h2H_c4QfA_86WCTxRXRYBeAx9P2RpdOxEtiRVXJu9M3kdL09qfVJiZvG9EjgdfYvhmFDF5fwpLTN4PbW-t_BEAAP__-XEe-Q">