Files
clang-p2996/flang/test/Lower/OpenMP/associate.f90
Kareem Ergawy 10df320743 [flang][OpenMP] Enable delayed privatization for omp parallel by default (#90945)
Flips the delayed privatization switch to be on by default. After the
recent fixes related to delayed privatization, the gfortran test suite
runs successfully with delayed privatization turned on by defuault for
`omp parallel`.
2024-08-02 09:46:34 +02:00

39 lines
1.0 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 {
!CHECK: }
!CHECK: }
!CHECK: omp.parallel {{.*}} {
!CHECK-NOT: hlfir.declare {{.*}} {uniq_name = "_QFtest_parallel_assocEb"}
!CHECK: omp.wsloop {
!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