llvm-project/flang/test/Lower/OpenMP/wsloop-ordered.f90
Kareem Ergawy dcb124e820
[flang][OpenMP] Enable delayed privatization by default omp.wsloop (#125732)
Reapplies #122471

This is based on https://github.com/llvm/llvm-project/pull/125699, only
the latest commit is relevant.

With changes in this PR and the parent one, the previously reported
failures in the Fujitsu(*) test suite should hopefully be resolved (I
verified all the 14 reported failures and they pass now).

(*) https://linaro.atlassian.net/browse/LLVM-1521
2025-02-06 19:11:04 +01:00

45 lines
1.1 KiB
Fortran

! This test checks lowering of worksharing-loop construct with ordered clause.
! RUN: bbc -fopenmp -emit-hlfir %s -o - | FileCheck %s
! This checks lowering ordered clause specified without parameter
subroutine wsloop_ordered_no_para()
integer :: a(10), i
! CHECK: omp.wsloop ordered(0) private({{.*}}) {
! CHECK-NEXT: omp.loop_nest (%{{.*}}) : i32 = (%{{.*}}) to (%{{.*}}) inclusive step (%{{.*}}) {
! CHECK: omp.yield
! CHECK: }
! CHECK: }
!$omp do ordered
do i = 2, 10
!$omp ordered
a(i) = a(i-1) + 1
!$omp end ordered
end do
!$omp end do
end
! This checks lowering ordered clause specified with a parameter
subroutine wsloop_ordered_with_para()
integer :: a(10), i
! CHECK: func @_QPwsloop_ordered_with_para() {
! CHECK: omp.wsloop ordered(1) private({{.*}}) {
! CHECK-NEXT: omp.loop_nest (%{{.*}}) : i32 = (%{{.*}}) to (%{{.*}}) inclusive step (%{{.*}}) {
! CHECK: omp.yield
! CHECK: }
! CHECK: }
!$omp do ordered(1)
do i = 2, 10
!!$omp ordered depend(sink: i-1)
a(i) = a(i-1) + 1
!!$omp ordered depend(source)
end do
!$omp end do
end