30 lines · plain
1! Verifies that proper `omp.map.bounds` ops are emitted when an allocatable is2! implicitly mapped by a `do concurrent` loop.3 4! RUN: %flang_fc1 -emit-hlfir -fopenmp -fdo-concurrent-to-openmp=device %s -o - \5! RUN: | FileCheck %s6program main7 implicit none8 9 integer,parameter :: n = 100000010 real, allocatable, dimension(:) :: y11 integer :: i12 13 allocate(y(1:n))14 15 do concurrent(i=1:n)16 y(i) = 4217 end do18 19 deallocate(y)20end program main21 22! CHECK: %[[Y_DECL:.*]]:2 = hlfir.declare %{{.*}} {fortran_attrs = #fir.var_attrs<allocatable>, uniq_name = "_QFEy"}23! CHECK: %[[Y_VAL:.*]] = fir.load %[[Y_DECL]]#024! CHECK: %[[Y_DIM0:.*]]:3 = fir.box_dims %[[Y_VAL]], %{{c0_.*}}25! CHECK: %[[Y_LB:.*]] = arith.constant 0 : index26! CHECK: %[[Y_UB:.*]] = arith.subi %[[Y_DIM0]]#1, %{{c1_.*}} : index27! CHECK: %[[Y_BOUNDS:.*]] = omp.map.bounds lower_bound(%[[Y_LB]] : index) upper_bound(%[[Y_UB]] : index) extent(%[[Y_DIM0]]#1 : index)28! CHECK: %[[MEM_MAP:.*]] = omp.map.info {{.*}} bounds(%[[Y_BOUNDS]])29! CHECK: omp.map.info var_ptr(%[[Y_DECL]]#1 : {{.*}}) {{.*}} members(%[[MEM_MAP]] : {{.*}})30