24 lines · plain
1! RUN: bbc -emit-fir -hlfir=false %s -o - | FileCheck %s2 3! Check that assumed shape lower bounds are applied before passing the4! descriptor to the runtime call.5 6 real, target :: a(10:20,99:100)7 call s2(a,17,-100)8contains9 subroutine show(bounds)10 integer(8) :: bounds(:)11 print *, bounds12 end subroutine13 subroutine s2(a,n,n2)14 Real a(n:,n2:)15 call show(ubound(a, kind=8))16 End Subroutine17end18 19! CHECK-LABEL: func.func private @_QFPs220! CHECK-SAME: %[[ARG0:.*]]: !fir.box<!fir.array<?x?xf32>>21! CHECK: %[[BOX:.*]] = fir.rebox %[[ARG0]](%{{.*}}) : (!fir.box<!fir.array<?x?xf32>>, !fir.shift<2>) -> !fir.box<!fir.array<?x?xf32>>22! CHECK: %[[BOX_NONE:.*]] = fir.convert %[[BOX]] : (!fir.box<!fir.array<?x?xf32>>) -> !fir.box<none>23! CHECK: fir.call @_FortranAUbound(%{{.*}}, %[[BOX_NONE]], %{{.*}}, %{{.*}}, %{{.*}}) {{.*}}: (!fir.llvm_ptr<i8>, !fir.box<none>, i32, !fir.ref<i8>, i32) -> ()24