[ConstraintElim] Add support for decomposing gep nuw (#118639)
[llvm-project.git] / flang / test / Lower / variable-inquiries.f90
blob590256a80ff38191e8abf8328c622af81095a203
1 ! Test property inquiries on variables
2 ! RUN: bbc -emit-fir -hlfir=false %s -o - | FileCheck %s
4 module inquired
5 real(8), allocatable :: a(:)
6 end module
8 ! CHECK-LABEL: @_QPissue844()
9 subroutine issue844()
10 use inquired
11 ! Verify that evaluate::DescriptorInquiry are made using the symbol mapped
12 ! in lowering (the use associated one, and not directly the ultimate
13 ! symbol).
15 ! CHECK: %[[a:.*]] = fir.address_of(@_QMinquiredEa) : !fir.ref<!fir.box<!fir.heap<!fir.array<?xf64>>>>
16 ! CHECK: %[[box_load:.*]] = fir.load %[[a]] : !fir.ref<!fir.box<!fir.heap<!fir.array<?xf64>>>>
17 ! CHECK: %[[dim:.*]]:3 = fir.box_dims %[[box_load]], %c0{{.*}} : (!fir.box<!fir.heap<!fir.array<?xf64>>>, index) -> (index, index, index)
18 ! CHECK: %[[cast:.*]] = fir.convert %[[dim]]#1 : (index) -> i64
19 ! CHECK: fir.call @_FortranAioOutputInteger64(%{{.*}}, %[[cast]]) {{.*}}: (!fir.ref<i8>, i64) -> i1
20 print *, size(a, kind=8)
21 end subroutine