32 lines · plain
1! When a block variable is marked as implicit private, we can simply ignore2! privatizing that symbol within the context of the currrent OpenMP construct3! since the "private" allocation for the symbol will be emitted within the nested4! block anyway.5 6! RUN: %flang_fc1 -emit-hlfir -fopenmp %s -o - | FileCheck %s7 8subroutine block_implicit_privatization9 implicit none10 integer :: i11 12 !$omp task13 do i=1,1014 block15 integer :: j16 j = 017 end block18 end do19 !$omp end task20end subroutine21 22! CHECK-LABEL: func.func @_QPblock_implicit_privatization() {23! CHECK: %[[I_DECL:.*]]:2 = hlfir.declare %{{.*}} {uniq_name = "{{.*}}Ei"}24! CHECK: omp.task private(@{{.*}}Ei_private_i32 %[[I_DECL]]#0 -> %{{.*}} : !fir.ref<i32>) {25! CHECK: fir.do_loop {{.*}} {26! Verify that `j` is allocated whithin the same scope of its block (i.e. inside27! the `task` loop).28! CHECK: fir.alloca i32 {bindc_name = "j", {{.*}}}29! CHECK: }30! CHECK: }31! CHECK: }32