1 ! RUN: bbc --always-execute-loop-body --emit-fir -hlfir=false %s -o - | FileCheck %s
2 ! RUN: %flang_fc1 -mmlir --always-execute-loop-body -emit-fir -flang-deprecated-no-hlfir %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
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>