Break circular dependency between FIR dialect and utilities
[llvm-project.git] / flang / test / Lower / variable-inquiries.f90
blobc3d63d4741c44881594447c48db354b5afa4bed5
1 ! Test property inquiries on variables
2 ! RUN: bbc -emit-fir %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