brintos

brintos / llvm-project-archived public Read only

0
0
Text · 795 B · 30b70fb Raw
21 lines · plain
1! RUN: bbc --always-execute-loop-body --emit-fir -hlfir=false %s -o - | FileCheck %s2! RUN: %flang_fc1 -mmlir --always-execute-loop-body -emit-fir -flang-deprecated-no-hlfir %s -o - | FileCheck %s3 4! Given the flag `--always-execute-loop-body` the compiler emits an extra5! code to change to tripcount, test tries to verify the extra emitted FIR.6 7! CHECK-LABEL: func @_QPsome8subroutine some()9  integer :: i10 11  ! CHECK: [[tripcount:%[0-9]+]] = arith.divsi12  ! CHECK: [[one:%c1_i32[_0-9]*]] = arith.constant 1 : i3213  ! CHECK: [[cmp:%[0-9]+]] = arith.cmpi slt, [[tripcount]], [[one]] : i3214  ! CHECK: [[newtripcount:%[0-9]+]] = arith.select [[cmp]], [[one]], [[tripcount]] : i3215  ! CHECK: fir.store [[newtripcount]] to %{{[0-9]+}} : !fir.ref<i32>16  do i=4,1,117    stop 218  end do19  return20end21