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

26 lines
804 B
Fortran

! RUN: bbc -emit-hlfir -fopenmp -o - %s | FileCheck %s
! RUN: %flang_fc1 -emit-hlfir -fopenmp -o - %s | FileCheck %s
program firstprivateallocatable
Integer, Allocatable :: a,u
a = 137
!$omp parallel firstprivate(a,u)
u = a**2
!$omp end parallel
end program
! CHECK-LABEL: func.func @_QQmain()
! [...]
! CHECK: omp.parallel {{.*}} {
! [...]
! CHECK: %[[VAL_50:.*]] = arith.constant 2 : i32
! CHECK: %[[VAL_51:.*]] = math.ipowi %{{.*}}, %[[VAL_50]] : i32
! this is what we are really checking: the hlfir.assign must have realloc so that
! u is allocated when the assignment occurs
! CHECK: hlfir.assign %[[VAL_51]] to %{{.*}}#0 realloc : i32, !fir.ref<!fir.box<!fir.heap<i32>>>
! [...]
! CHECK: omp.terminator
! CHECK: }