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

    <tr>
        <th>Summary</th>
        <td>
            [OpenMP][Offload] Generic mode with multiple parallel regions is broken
        </td>
    </tr>

    <tr>
      <th>Labels</th>
      <td>
            openmp:libomptarget
      </td>
    </tr>

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

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

<pre>
    ```
__attribute__((optnone)) void optnone(void) {}

int main() {
#pragma omp target teams num_teams(1)
  {
    optnone();
#pragma omp parallel
 {}
#pragma omp parallel
    __builtin_trap();
 }
}
```
This crashes under O3 with something other than the trap, and w/o O3 it runs fine. Neither behavior is expected. (Tested on MI250x)
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJx8Uk1vnDAQ_TXDZZSVMbALBw5JV1v1kKaH3JGBAZwa27KHJP33FbDaNFVVybLH43nveT5UjHq0RDUUDyDlS-8oDBQYpITinKiFJxfqmztpXf-rhqO4LnEGcd80ijnodmFqGpAlyNJ5ts4SyApkha9O93hzlet1dcPpAU7nnWPftWWclbYbyR6wv8rMBzXOCt3skVUYiZFJzRHtMjebBbJMV70NgB9YRPxDe43I_snqVVDGkLmiPn3uf4GI2DTtog1r23BQ_i8V_KC5GZ_r9zzpiF1QcaKIi-0p4FOGb5onjG4mnrQd0fFEAXlSFnki3IW-oLI9voG8uBWiGcNiIw7a0gG_k94wLU3qVbuAOiK9e-qY-gOCLJ8pMvXoLD5-k4V4B1klfZ31VVaphOr0WJVlmpdSJlMtT9lw7E9VnuZVmw1SibwQ3bFKh2NFdOoSXUshszQVqSiEkOlhGEpKqzw7FqoXohSQC5qVNgdjXueDC2OiY1yoPomyyhOjWjLxOoXOk509ZPdGt272e7-vExnqFX_XLmOEXBgdOX4wsmazjfKTJ_v4A4rzag-DcaqH4oxfyVLQHc6up73A82JYe0O3rmKgUTsb12q1wf0kmyzB1BOzj5Ddg7yAvIyap6U9dG4GeVnVr8edD-6FOgZ52ZKLIC9bfr8DAAD__9HEC4o">