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

    <tr>
        <th>Summary</th>
        <td>
            [OpenMP] th_task_team inconsistency caught by a debug assert.
        </td>
    </tr>

    <tr>
      <th>Labels</th>
      <td>
            new issue
      </td>
    </tr>

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

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

<pre>
    ```cpp
#include <omp.h>
int main()
{
  #pragma omp parallel num_threads(1)
  {
    #pragma omp parallel num_threads(1)
    {
      omp_event_handle_t ev;
 #pragma omp task detach(ev)
      { }
      omp_fulfill_event(ev);
 }
  }
}
```
`clang -fopenmp t1.c -o t1  && ./t1`
```
Assertion failure at kmp_runtime.cpp(2459): master_th->th.th_task_team == team->t.t_task_team[master_th->th.th_task_state].
OMP: Error #13: Assertion failure at kmp_runtime.cpp(2459).
```

I've hit this assert when compiling with a debug build. In upstream
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJyck8GOozgQhp-muJSCjB2ScODQvelIcxhNvwEypsDeNgbZRVr99ivITNI92j3sSAjKKn9__fyWdUpuCEQ1lM9QnjO9sJ1iPbo3Pb1m7dR91HAQt8fMM4gziCeQygXjl44Q1F_TOOcW1Mut5wLjqF0AeQJZ_dx_fL4ViCDVHPUwapzGGWcdtffkMSxjwzaS7hLIU3EnET-xf0D_xuPKNXSlwI3VofPUMNIV1K89XwewTm_YEWtjQZ7o-kV4k0Y4nn-X7xffO-9vY-7cY8SDuJeP4lfW96XxOgy466eZwmqpyA3uJuRiTeMA8oA5yAsXn5nPEk8pUWQ3Bey180sk1Ixv49zEJbAbKV9PVZ7kvqw2m0846sQUG7Y7UC9sc7bNGkTDpEcEdQZ1xrXe2jk_mlA-_xebWDNBec5vpn58f10nvcQ4xTXzQq3L_2c1__fEtvc3kMcroXWMbF1CvSnju6WAZhpn510Y8N2xRY0dtcuA7eJ8l-O3gMucOJIes65WXaUqnVFdHKrjqdiLUmS2lpXqquIo-qMiXZZ7Q23VSSGLfdsdTd9nrpZCqkJIUZRClCI_KWGM6dr-VFR9JVvYCxq187n31zGf4pC5lBaqD9VRqczrlnzabqSUgd5xa4KU6wWN9crs2mVIsBfeJU4PFXbst6v8Y6bw_RXKM345PRfMFJJLTMF8oNHLYBnbj3sIt5zybIm-tsxzAvUE8gLyMji2S5ubaQR5Wef9_OzmOP1NhkFeNpcJ5GX7i38CAAD__3eQTm8">