! RUN: bbc -emit-fir -hlfir=false %s -opt-transpose=false -o - | FileCheck %s ! RUN: %flang_fc1 -emit-fir -flang-deprecated-no-hlfir -O0 %s -o - | FileCheck %s ! CHECK-LABEL: func @_QPtranspose_test( ! CHECK-SAME: %[[source:.*]]: !fir.ref>{{.*}}) { subroutine transpose_test(mat) ! CHECK: %[[resultDescr:.*]] = fir.alloca !fir.box>> real :: mat(2,3) call bar_transpose_test(transpose(mat)) ! CHECK: %[[sourceBox:.*]] = fir.embox %[[source]]({{.*}}) : (!fir.ref>, !fir.shape<2>) -> !fir.box> ! CHECK: %[[zeroArray:.*]] = fir.zero_bits !fir.heap ! CHECK: %[[c0:.*]] = arith.constant 0 : index ! CHECK: %[[shapeResult:.*]] = fir.shape %[[c0]], %[[c0]] : (index, index) -> !fir.shape<2> ! CHECK: %[[resultBox:.*]] = fir.embox %[[zeroArray]](%[[shapeResult]]) : (!fir.heap>, !fir.shape<2>) -> !fir.box>> ! CHECK: fir.store %[[resultBox]] to %[[resultDescr]] : !fir.ref>>> ! CHECK: %[[resultOpaque:.*]] = fir.convert %[[resultDescr]] : (!fir.ref>>>) -> !fir.ref> ! CHECK: %[[sourceOpaque:.*]] = fir.convert %[[sourceBox]] : (!fir.box>) -> !fir.box ! CHECK: %{{.*}} = fir.call @_FortranATranspose(%[[resultOpaque]], %[[sourceOpaque]], %{{.*}}, %{{.*}}) {{.*}}: (!fir.ref>, !fir.box, !fir.ref, i32) -> none ! CHECK: %[[tmp1:.*]] = fir.load %[[resultDescr]] : !fir.ref>>> ! CHECK: %[[tmp2:.*]] = fir.box_addr %[[tmp1]] : (!fir.box>>) -> !fir.heap> ! CHECK: %[[tmp3:.*]] = fir.convert %[[tmp2]] : (!fir.heap>) -> !fir.ref> ! CHECK: fir.call @_QPbar_transpose_test(%[[tmp3]]) {{.*}}: (!fir.ref>) -> () ! CHECK: fir.freemem %[[tmp2]] : !fir.heap end subroutine