llvm-project/flang/test/Lower/OpenMP/wsloop-collapse-continue.f90
Michael Kruse 69a53b8d54
[Flang] Fix perfect loop nest detection (#161554)
PR #160283 uses `Unwrap` to detect a `continue` statement, but it
applied it on the loop body itelf which sometimes finds a trailing
continue statement, but not always. Apply `Unwrap` on the last body
statement instead, where the `continue` is expected.

Fixes #161529
2025-10-01 23:27:25 +02:00

20 lines
511 B
Fortran

! RUN: bbc -fopenmp -emit-hlfir %s -o - | FileCheck %s
program wsloop_collapse_continue
integer i, j
! CHECK: omp.wsloop {{.*}} {
! CHECK: omp.loop_nest ({{.*}}) : i32 = ({{.*}}) to ({{.*}}) inclusive step ({{.*}}) collapse(2) {
!$omp do collapse(2)
do 50 i = 1, 42
do 51 j = 1, 84
! CHECK: fir.call @_FortranAioOutputInteger32(
print *, i
! CHECK: fir.call @_FortranAioOutputInteger32(
print *, j
51 continue
50 continue
!$omp end do
end program wsloop_collapse_continue