brintos

brintos / llvm-project-archived public Read only

0
0
Text · 1.1 KiB · cd1bd4f Raw
46 lines · plain
1! RUN: %flang_fc1 -emit-hlfir -fopenmp -fdo-concurrent-to-openmp=host %s -o - \2! RUN:   | FileCheck %s3 4program main5    implicit none6 7    call foo(10)8 9    contains10        subroutine foo(n)11            implicit none12            integer :: n13            integer :: i14            integer, dimension(n) :: a15 16            do concurrent(i=1:n)17                a(i) = i18            end do19        end subroutine20 21end program main22 23! CHECK: %[[N_DECL:.*]]:2 = hlfir.declare %{{.*}} dummy_scope %{{.*}} {uniq_name = "_QFFfooEn"}24 25! CHECK: fir.load26 27! CHECK: %[[LB:.*]] = fir.convert %{{c1_.*}} : (i32) -> index28! CHECK: %[[N_VAL:.*]] = fir.load %[[N_DECL]]#0 : !fir.ref<i32>29! CHECK: %[[UB:.*]] = fir.convert %[[N_VAL]] : (i32) -> index30! CHECK: %[[C1:.*]] = arith.constant 1 : index31 32! CHECK: omp.parallel {33 34 35! Verify that we resort to using the outside value for the upper bound since it36! is not originally a constant.37 38! CHECK:   omp.wsloop {39! CHECK:     omp.loop_nest (%{{.*}}) : index = (%[[LB]]) to (%[[UB]]) inclusive step (%{{.*}}) {40! CHECK:       omp.yield41! CHECK:     }42! CHECK:   }43! CHECK:   omp.terminator44! CHECK: }45 46