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

    <tr>
        <th>Summary</th>
        <td>
            [flang] [OpenMP] Compilation Error (LLVM-16.0.4 vs trunk)
        </td>
    </tr>

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

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

    <tr>
      <th>Reporter</th>
      <td>
          k-arrows
      </td>
    </tr>
</table>

<pre>
    Consider the following program:
```console
$ cat test.f90
program main
   integer, allocatable :: x(:, :)

   allocate(x(2:3, 4:5))

   !$omp task private(x)
     if (lbound(x, dim=1) /= 2) stop 1
     if (ubound(x, dim=1) /= 3) stop 2

     if (lbound(x, dim=2) /= 4) stop 3
     if (ubound(x, dim=2) /= 5) stop 4
   !$omp end task

   !$omp taskwait
end program main
```

Flang-new of LLVM-16.0.4 can handle this program:
```console
$ flang-new --version
flang-new version 16.0.4 (https://github.com/llvm/llvm-project ae42196bc493ffe877a7e3dff8be32035dea4d07)
Target: x86_64-unknown-linux-gnu
Thread model: posix
InstalledDir: /home/sykmr/llvm-16.0.4/llvm-16.0.4/bin
$ flang-new -fopenmp test.f90
$ ./a.out
$
```

However, the latest flang-new emits the following error message:
```console
$ flang-new -fopenmp test.f90
error: loc("./test.f90":4:4): operation with block successors must terminate its parent block
error: verification of lowering to FIR failed
```

Feel free to close this issue if this change is intentional. 
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJyUVVFvpDYQ_jXmZbSIHQwLDzzkskU96U6tqqqvlYEB3DU2ss1u7t9Xhg2XS05pIyVamPm-mfHM50E4JwdNVLHsE8vOkVj8aGx1OQhrzc1Fjem-VY9GO9mRBT8S9EYpc5N6gNmawYqJpQ8sObPkgeXJ9tca7YyiuxU5tMKDJ-fjvkw2650Lk5B6swCA1J4GsgwfQShlWuFFowhCgvQBnhgW4REfVwuW9_jP7DuFGBYB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