[flang] Accept polymorphic component element in storage_size
[llvm-project.git] / flang / test / Lower / always-execute-loop-body.f90
blob7c4ef1af33929c2d84e149049e33df7cdf76bf8f
1 ! RUN: bbc --always-execute-loop-body --emit-fir %s -o - | FileCheck %s
2 ! RUN: %flang_fc1 -mmlir --always-execute-loop-body -emit-fir %s -o - | FileCheck %s
4 ! Given the flag `--always-execute-loop-body` the compiler emits an extra
5 ! code to change to tripcount, test tries to verify the extra emitted FIR.
7 ! CHECK-LABEL: func @_QPsome
8 subroutine some()
9 integer :: i
11 ! CHECK: [[tripcount:%[0-9]+]] = arith.divsi
12 ! CHECK: [[one:%c1_i32[_0-9]*]] = arith.constant 1 : i32
13 ! CHECK: [[cmp:%[0-9]+]] = arith.cmpi slt, [[tripcount]], [[one]] : i32
14 ! CHECK: [[newtripcount:%[0-9]+]] = arith.select [[cmp]], [[one]], [[tripcount]] : i32
15 ! CHECK: fir.store [[newtripcount]] to %{{[0-9]+}} : !fir.ref<i32>
16 do i=4,1,1
17 stop 2
18 end do
19 return
20 end