31 lines · plain
1! Test that reductions and delayed privatization work properly togehter. Since2! both types of clauses add block arguments to the OpenMP region, we make sure3! that the block arguments are added in the proper order (reductions first and4! then delayed privatization.5 6! RUN: bbc -emit-hlfir -fopenmp --force-byref-reduction --enable-delayed-privatization -o - %s 2>&1 | FileCheck %s7 8subroutine red_and_delayed_private9 integer :: red10 integer :: prv11 12 red = 013 prv = 1014 15 !$omp parallel reduction(+:red) private(prv)16 red = red + 117 prv = 2018 !$omp end parallel19end subroutine20 21! CHECK-LABEL: omp.private {type = private}22! CHECK-SAME: @[[PRIVATIZER_SYM:.*]] : i3223 24! CHECK-LABEL: omp.declare_reduction25! CHECK-SAME: @[[REDUCTION_SYM:.*]] : !fir.ref<i32> attributes {byref_element_type = i32} alloc26 27! CHECK-LABEL: _QPred_and_delayed_private28! CHECK: omp.parallel29! CHECK-SAME: private(@[[PRIVATIZER_SYM]] %{{.*}} -> %arg0 : !fir.ref<i32>)30! CHECK-SAME: reduction(byref @[[REDUCTION_SYM]] %{{.*}} -> %arg1 : !fir.ref<i32>) {31