brintos

brintos / llvm-project-archived public Read only

0
0
Text · 1.0 KiB · 6783699 Raw
37 lines · plain
1! RUN: bbc -emit-hlfir -fopenmp %s -o - | FileCheck %s2! RUN: %flang_fc1 -emit-hlfir -fopenmp %s -o - | FileCheck %s3 4! CHECK: omp.wsloop private({{.*}}) reduction(mod: inscan, @add_reduction_i32 %{{.*}} -> %[[RED_ARG_1:.*]] : {{.*}}) {5! CHECK: %[[RED_DECL_1:.*]]:2 = hlfir.declare %[[RED_ARG_1]]6! CHECK: omp.scan inclusive(%[[RED_DECL_1]]#0 : {{.*}})7 8subroutine inclusive_scan(a, b, n)9 implicit none10 integer a(:), b(:)11 integer x, k, n12 13 !$omp parallel do reduction(inscan, +: x)14 do k = 1, n15   x = x + a(k)16   !$omp scan inclusive(x)17   b(k) = x18 end do19end subroutine inclusive_scan20 21 22! CHECK: omp.wsloop private({{.*}}) reduction(mod: inscan, @add_reduction_i32 %{{.*}} -> %[[RED_ARG_2:.*]] : {{.*}}) {23! CHECK: %[[RED_DECL_2:.*]]:2 = hlfir.declare %[[RED_ARG_2]]24! CHECK: omp.scan exclusive(%[[RED_DECL_2]]#0 : {{.*}})25subroutine exclusive_scan(a, b, n)26 implicit none27 integer a(:), b(:)28 integer x, k, n29 30 !$omp parallel do reduction(inscan, +: x)31 do k = 1, n32   x = x + a(k)33   !$omp scan exclusive(x)34   b(k) = x35 end do36end subroutine exclusive_scan37