brintos

brintos / llvm-project-archived public Read only

0
0
Text · 1.5 KiB · 41657d3 Raw
36 lines · plain
1! RUN: bbc -emit-hlfir -fopenmp -fopenmp-version=50 -o - %s 2>&1 | FileCheck %s2! RUN: %flang_fc1 -emit-hlfir -fopenmp -fopenmp-version=50 -o - %s 2>&1 | FileCheck %s3 4!CHECK-LABEL: omp.declare_reduction5!CHECK-SAME:  @[[RED_I32_NAME:.*]] : i32 init {6!CHECK:       ^bb0(%{{.*}}: i32):7!CHECK:         %[[C0_1:.*]] = arith.constant 0 : i328!CHECK:         omp.yield(%[[C0_1]] : i32)9!CHECK:       } combiner {10!CHECK:       ^bb0(%[[ARG0:.*]]: i32, %[[ARG1:.*]]: i32):11!CHECK:          %[[RES:.*]] = arith.addi %[[ARG0]], %[[ARG1]] : i3212!CHECK:          omp.yield(%[[RES]] : i32)13!CHECK:         }14 15!CHECK-LABEL:  func.func @_QPomp_task_in_reduction() {16!                [...]17!CHECK:          omp.task in_reduction(@[[RED_I32_NAME]] %[[VAL_1:.*]]#0  -> %[[ARG0]] : !fir.ref<i32>) {18!CHECK:            %[[VAL_4:.*]]:2 = hlfir.declare %[[ARG0]]19!CHECK-SAME:       {uniq_name = "_QFomp_task_in_reductionEi"} : (!fir.ref<i32>) -> (!fir.ref<i32>, !fir.ref<i32>)20!CHECK:            %[[VAL_5:.*]] = fir.load %[[VAL_4]]#0 : !fir.ref<i32>21!CHECK:            %[[VAL_6:.*]] = arith.constant 1 : i3222!CHECK:            %[[VAL_7:.*]] = arith.addi %[[VAL_5]], %[[VAL_6]] : i3223!CHECK:            hlfir.assign %[[VAL_7]] to %[[VAL_4]]#0 : i32, !fir.ref<i32>24!CHECK:            omp.terminator25!CHECK:           }26!CHECK:           return27!CHECK:          }28 29subroutine omp_task_in_reduction()30   integer i31   i = 032   !$omp task in_reduction(+:i)33   i = i + 134   !$omp end task35end subroutine omp_task_in_reduction36