Patch 2/3 of the transition step 1 described in https://discourse.llvm.org/t/rfc-enabling-the-hlfir-lowering-by-default/72778/7. All the modified tests are still here since coverage for the direct lowering to FIR was still needed while it was default. Some already have an HLFIR version, some have not and will need to be ported in step 2 described in the RFC. Note that another 147 lit tests use -emit-fir/-emit-llvm outputs but do not need a flag since the HLFIR/no HLFIR output is the same for what is being tested.
22 lines
937 B
Fortran
22 lines
937 B
Fortran
! Test property inquiries on variables
|
|
! RUN: bbc -emit-fir -hlfir=false %s -o - | FileCheck %s
|
|
|
|
module inquired
|
|
real(8), allocatable :: a(:)
|
|
end module
|
|
|
|
! CHECK-LABEL: @_QPissue844()
|
|
subroutine issue844()
|
|
use inquired
|
|
! Verify that evaluate::DescriptorInquiry are made using the symbol mapped
|
|
! in lowering (the use associated one, and not directly the ultimate
|
|
! symbol).
|
|
|
|
! CHECK: %[[a:.*]] = fir.address_of(@_QMinquiredEa) : !fir.ref<!fir.box<!fir.heap<!fir.array<?xf64>>>>
|
|
! CHECK: %[[box_load:.*]] = fir.load %[[a]] : !fir.ref<!fir.box<!fir.heap<!fir.array<?xf64>>>>
|
|
! CHECK: %[[dim:.*]]:3 = fir.box_dims %[[box_load]], %c0{{.*}} : (!fir.box<!fir.heap<!fir.array<?xf64>>>, index) -> (index, index, index)
|
|
! CHECK: %[[cast:.*]] = fir.convert %[[dim]]#1 : (index) -> i64
|
|
! CHECK: fir.call @_FortranAioOutputInteger64(%{{.*}}, %[[cast]]) {{.*}}: (!fir.ref<i8>, i64) -> i1
|
|
print *, size(a, kind=8)
|
|
end subroutine
|