51 lines · plain
1! Test dummy procedures that are not an argument in every entry.2! This requires creating a mock value in the entries where it is3! not an argument.4! RUN: bbc -emit-fir -hlfir=false %s -o - | FileCheck %s5 6subroutine dummy_with_iface()7 interface8 real function x()9 end function10 end interface11 entry dummy_with_iface_entry(x)12 call takes_real(x())13end subroutine14! CHECK-LABEL: func @_QPdummy_with_iface() {15! CHECK: %[[VAL_0:.*]] = fir.alloca f32 {adapt.valuebyref}16! CHECK: %[[VAL_1:.*]] = fir.undefined !fir.boxproc<() -> ()>17! CHECK: br ^bb118! CHECK: ^bb1:19! CHECK: %[[VAL_2:.*]] = fir.box_addr %[[VAL_1]] : (!fir.boxproc<() -> ()>) -> (() -> f32)20! CHECK: %[[VAL_3:.*]] = fir.call %[[VAL_2]]() {{.*}}: () -> f3221! CHECK: fir.store %[[VAL_3]] to %[[VAL_0]] : !fir.ref<f32>22! CHECK: fir.call @_QPtakes_real(%[[VAL_0]]) {{.*}}: (!fir.ref<f32>) -> ()23 24! CHECK-LABEL: func @_QPdummy_with_iface_entry(25! CHECK-SAME: %[[VAL_0:.*]]: !fir.boxproc<() -> ()>) {26! CHECK: %[[VAL_1:.*]] = fir.alloca f32 {adapt.valuebyref}27! CHECK: br ^bb128! CHECK: ^bb1:29! CHECK: %[[VAL_2:.*]] = fir.box_addr %[[VAL_0]] : (!fir.boxproc<() -> ()>) -> (() -> f32)30! CHECK: %[[VAL_3:.*]] = fir.call %[[VAL_2]]() {{.*}}: () -> f3231! CHECK: fir.store %[[VAL_3]] to %[[VAL_1]] : !fir.ref<f32>32! CHECK: fir.call @_QPtakes_real(%[[VAL_1]]) {{.*}}: (!fir.ref<f32>) -> ()33 34subroutine subroutine_dummy()35 entry subroutine_dummy_entry(x)36 call x()37end subroutine38! CHECK-LABEL: func @_QPsubroutine_dummy() {39! CHECK: %[[VAL_0:.*]] = fir.undefined !fir.boxproc<() -> ()>40! CHECK: br ^bb141! CHECK: ^bb1:42! CHECK: %[[VAL_1:.*]] = fir.box_addr %[[VAL_0]] : (!fir.boxproc<() -> ()>) -> (() -> ())43! CHECK: fir.call %[[VAL_1]]() {{.*}}: () -> ()44 45! CHECK-LABEL: func @_QPsubroutine_dummy_entry(46! CHECK-SAME: %[[VAL_0:.*]]: !fir.boxproc<() -> ()>) {47! CHECK: br ^bb148! CHECK: ^bb1:49! CHECK: %[[VAL_1:.*]] = fir.box_addr %[[VAL_0]] : (!fir.boxproc<() -> ()>) -> (() -> ())50! CHECK: fir.call %[[VAL_1]]() {{.*}}: () -> ()51