Files
clang-p2996/flang/test/Lower/OpenMP/firstprivate-alloc-comp.f90
jeanPerier d82d53b2e3 [flang][openmp] initialize allocatable components of firstprivate copies (#121808)
Descriptors of allocatable components of firstprivate derived type
copies need to be set-up. Otherwise the program later die when
manipulating them inside OpenMP region.
2025-01-07 10:04:27 +01:00

20 lines
673 B
Fortran

! Test delayed privatization for derived types with allocatable components.
! RUN: %flang_fc1 -emit-hlfir -fopenmp -o - %s | FileCheck %s
subroutine firstprivate_alloc_comp
type t1
integer, allocatable :: c(:)
end type
type(t1) :: x
!$omp parallel firstprivate(x)
print *, allocated(x%c)
!$omp end parallel
end
call firstprivate_alloc_comp()
end
! CHECK-LABEL: omp.private {type = firstprivate} @_QFfirstprivate_alloc_compEx_firstprivate_ref_rec__QFfirstprivate_alloc_compTt1 : !fir.ref<!fir.type<_QFfirstprivate_alloc_compTt1{c:!fir.box<!fir.heap<!fir.array<?xi32>>>}>> alloc {
! CHECK: fir.call @_FortranAInitialize(
! CHECK: } copy {
! ...