brintos

brintos / llvm-project-archived public Read only

0
0
Text · 1.3 KiB · 863742c Raw
28 lines · plain
1!RUN: %flang_fc1 -emit-hlfir -fopenmp %s -o - | FileCheck %s2 3module foo4    implicit none5    contains6    subroutine test(I,A)7      implicit none8      real(4), optional, intent(inout) :: A(:)9      integer(kind=4), intent(in) :: I10 11     !$omp target data map(to: A) if (I>0)12     !$omp end target data13 14    end subroutine test15end module foo16 17! CHECK-LABEL:   func.func @_QMfooPtest(18! CHECK-SAME:                           %[[VAL_0:.*]]: !fir.ref<i32> {fir.bindc_name = "i"},19! CHECK-SAME:                           %[[VAL_1:.*]]: !fir.box<!fir.array<?xf32>> {fir.bindc_name = "a", fir.optional}) {20! CHECK:           %[[VAL_2:.*]] = fir.alloca !fir.box<!fir.array<?xf32>>21! CHECK:           %[[VAL_3:.*]]:2 = hlfir.declare %[[VAL_1]] dummy_scope %{{.*}} {fortran_attrs = #fir.var_attrs<intent_inout, optional>, uniq_name = "_QMfooFtestEa"} : (!fir.box<!fir.array<?xf32>>, !fir.dscope) -> (!fir.box<!fir.array<?xf32>>, !fir.box<!fir.array<?xf32>>)22! CHECK:           %{{.*}} = fir.is_present %{{.*}}#1 : (!fir.box<!fir.array<?xf32>>) -> i123! CHECK:           %{{.*}}:5 = fir.if %{{.*}}24! CHECK:           %[[VAL_4:.*]] = fir.is_present %[[VAL_3]]#1 : (!fir.box<!fir.array<?xf32>>) -> i125! CHECK:           fir.if %[[VAL_4]] {26! CHECK:             fir.store %[[VAL_3]]#1 to %[[VAL_2]] : !fir.ref<!fir.box<!fir.array<?xf32>>>27! CHECK:           }28