brintos

brintos / llvm-project-archived public Read only

0
0
Text · 1.6 KiB · c10c0a9 Raw
39 lines · plain
1! RUN: bbc -emit-fir -hlfir=false %s -o - | FileCheck %s2 3! CHECK-LABEL: func @_QPpointer_forall_degenerated_assignment() {4 5subroutine pointer_forall_degenerated_assignment()6  integer, pointer :: p7  integer, target :: t(1)8  forall (i=1:1)9     ! Test hits a TODO when uncommented.10     ! p => t(i)11  end forall12end subroutine13 14! CHECK-LABEL: func @_QPlogical_forall_degenerated_assignment() {15! CHECK:         %[[VAL_0:.*]] = fir.alloca i32 {adapt.valuebyref, bindc_name = "i"}16! CHECK:         %[[VAL_1:.*]] = fir.alloca !fir.logical<4> {bindc_name = "l", uniq_name = "_QFlogical_forall_degenerated_assignmentEl"}17! CHECK:         %[[VAL_2:.*]] = arith.constant 1 : i3218! CHECK:         %[[VAL_3:.*]] = fir.convert %[[VAL_2]] : (i32) -> index19! CHECK:         %[[VAL_4:.*]] = arith.constant 1 : i3220! CHECK:         %[[VAL_5:.*]] = fir.convert %[[VAL_4]] : (i32) -> index21! CHECK:         %[[VAL_6:.*]] = arith.constant 1 : index22! CHECK:         fir.do_loop %[[VAL_7:.*]] = %[[VAL_3]] to %[[VAL_5]] step %[[VAL_6]] unordered {23! CHECK:           %[[VAL_8:.*]] = fir.convert %[[VAL_7]] : (index) -> i3224! CHECK:           fir.store %[[VAL_8]] to %[[VAL_0]] : !fir.ref<i32>25! CHECK:           %[[VAL_9:.*]] = arith.constant true26! CHECK:           %[[VAL_10:.*]] = fir.convert %[[VAL_9]] : (i1) -> !fir.logical<4>27! CHECK:           fir.store %[[VAL_10]] to %[[VAL_1]] : !fir.ref<!fir.logical<4>>28! CHECK:         }29! CHECK:         return30! CHECK:       }31 32subroutine logical_forall_degenerated_assignment()33  logical :: l34  forall (i=1:1)35    l = .true.36  end forall37end subroutine38 39