34 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: %flang_fc1 -emit-hlfir -fopenmp -mmlir --enable-delayed-privatization \7! RUN: -o - %s 2>&1 | FileCheck %s8! RUN: bbc -emit-hlfir -fopenmp --enable-delayed-privatization -o - %s 2>&1 \9! RUN: | FileCheck %s10 11subroutine red_and_delayed_private12 integer :: red13 integer :: prv14 15 red = 016 prv = 1017 18 !$omp parallel reduction(+:red) private(prv)19 red = red + 120 prv = 2021 !$omp end parallel22end subroutine23 24! CHECK-LABEL: omp.private {type = private}25! CHECK-SAME: @[[PRIVATIZER_SYM:.*]] : i3226 27! CHECK-LABEL: omp.declare_reduction28! CHECK-SAME: @[[REDUCTION_SYM:.*]] : i32 init29 30! CHECK-LABEL: _QPred_and_delayed_private31! CHECK: omp.parallel32! CHECK-SAME: private(@[[PRIVATIZER_SYM]] %{{.*}} -> %arg0 : !fir.ref<i32>)33! CHECK-SAME: reduction(@[[REDUCTION_SYM]] %{{.*}} -> %arg1 : !fir.ref<i32>) {34