Files
clang-p2996/flang/test/Lower/OpenMP/associate.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

39 lines
1.1 KiB
Fortran

! Check that constructs with associate and variables that have implicitly
! determined DSAs are lowered properly.
! RUN: %flang_fc1 -emit-hlfir -fopenmp -o - %s 2>&1 | FileCheck %s
!CHECK-LABEL: func @_QPtest_parallel_assoc
!CHECK: omp.parallel {
!CHECK-NOT: hlfir.declare {{.*}} {uniq_name = "_QFtest_parallel_assocEa"}
!CHECK-NOT: hlfir.declare {{.*}} {uniq_name = "_QFtest_parallel_assocEb"}
!CHECK: omp.wsloop private({{.*}}) {
!CHECK: }
!CHECK: }
!CHECK: omp.parallel {{.*}} {
!CHECK-NOT: hlfir.declare {{.*}} {uniq_name = "_QFtest_parallel_assocEb"}
!CHECK: omp.wsloop private({{.*}}) {
!CHECK: }
!CHECK: }
subroutine test_parallel_assoc()
integer, parameter :: l = 3
integer :: a(l)
integer :: i
a = 1
!$omp parallel do
do i = 1,l
associate (b=>a)
b(i) = b(i) * 2
end associate
enddo
!$omp end parallel do
!$omp parallel do default(private)
do i = 1,l
associate (b=>a)
b(i) = b(i) * 2
end associate
enddo
!$omp end parallel do
end subroutine