brintos

brintos / llvm-project-archived public Read only

0
0
Text · 1.4 KiB · 2be154f Raw
37 lines · plain
1! RUN: bbc -emit-hlfir -fopenmp -o - %s | FileCheck %s2! RUN: %flang_fc1 -emit-hlfir -fopenmp -o - %s | FileCheck %s3 4module m15  intrinsic max6end module m17program main8  use m1, ren=>max9  n=010  !$omp parallel reduction(ren:n)11  print *, "par"12  !$omp end parallel13end program main14 15! test that we understood that this should be a max reduction16 17! CHECK-LABEL:   omp.declare_reduction @max_i32 : i32 init {18! CHECK:         ^bb0(%[[VAL_0:.*]]: i32):19! CHECK:           %[[VAL_1:.*]] = arith.constant -2147483648 : i3220! CHECK:           omp.yield(%[[VAL_1]] : i32)21 22! CHECK-LABEL:   } combiner {23! CHECK:         ^bb0(%[[VAL_0:.*]]: i32, %[[VAL_1:.*]]: i32):24! CHECK:           %[[VAL_2:.*]] = arith.maxsi %[[VAL_0]], %[[VAL_1]] : i3225! CHECK:           omp.yield(%[[VAL_2]] : i32)26! CHECK:         }27 28! CHECK-LABEL:   func.func @_QQmain() attributes {fir.bindc_name = "MAIN"} {29! CHECK:           %[[VAL_0:.*]] = fir.alloca i32 {bindc_name = "n", uniq_name = "_QFEn"}30! CHECK:           %[[VAL_1:.*]]:2 = hlfir.declare %[[VAL_0]] {uniq_name = "_QFEn"} : (!fir.ref<i32>) -> (!fir.ref<i32>, !fir.ref<i32>)31! CHECK:           %[[VAL_2:.*]] = arith.constant 0 : i3232! CHECK:           hlfir.assign %[[VAL_2]] to %[[VAL_1]]#0 : i32, !fir.ref<i32>33! CHECK:           omp.parallel reduction(@max_i32 %[[VAL_1]]#0 -> %[[VAL_3:.*]] : !fir.ref<i32>) {34! ...35! CHECK:             omp.terminator36 37