1 ! Test dummy procedures that are not an argument in every entry.
2 ! This requires creating a mock value in the entries where it is
4 ! RUN: bbc -emit-fir %s -o - | FileCheck %s
6 subroutine dummy_with_iface()
11 entry dummy_with_iface_entry(x
)
14 ! CHECK-LABEL: func @_QPdummy_with_iface() {
15 ! CHECK: %[[VAL_0:.*]] = fir.alloca f32 {adapt.valuebyref}
16 ! CHECK: %[[VAL_1:.*]] = fir.undefined !fir.boxproc<() -> ()>
19 ! CHECK: %[[VAL_2:.*]] = fir.box_addr %[[VAL_1]] : (!fir.boxproc<() -> ()>) -> (() -> f32)
20 ! CHECK: %[[VAL_3:.*]] = fir.call %[[VAL_2]]() {{.*}}: () -> f32
21 ! CHECK: fir.store %[[VAL_3]] to %[[VAL_0]] : !fir.ref<f32>
22 ! CHECK: fir.call @_QPtakes_real(%[[VAL_0]]) {{.*}}: (!fir.ref<f32>) -> ()
24 ! CHECK-LABEL: func @_QPdummy_with_iface_entry(
25 ! CHECK-SAME: %[[VAL_0:.*]]: !fir.boxproc<() -> ()>) {
26 ! CHECK: %[[VAL_1:.*]] = fir.alloca f32 {adapt.valuebyref}
29 ! CHECK: %[[VAL_2:.*]] = fir.box_addr %[[VAL_0]] : (!fir.boxproc<() -> ()>) -> (() -> f32)
30 ! CHECK: %[[VAL_3:.*]] = fir.call %[[VAL_2]]() {{.*}}: () -> f32
31 ! CHECK: fir.store %[[VAL_3]] to %[[VAL_1]] : !fir.ref<f32>
32 ! CHECK: fir.call @_QPtakes_real(%[[VAL_1]]) {{.*}}: (!fir.ref<f32>) -> ()
34 subroutine subroutine_dummy()
35 entry subroutine_dummy_entry(x
)
38 ! CHECK-LABEL: func @_QPsubroutine_dummy() {
39 ! CHECK: %[[VAL_0:.*]] = fir.undefined !fir.boxproc<() -> ()>
42 ! CHECK: %[[VAL_1:.*]] = fir.box_addr %[[VAL_0]] : (!fir.boxproc<() -> ()>) -> (() -> ())
43 ! CHECK: fir.call %[[VAL_1]]() {{.*}}: () -> ()
45 ! CHECK-LABEL: func @_QPsubroutine_dummy_entry(
46 ! CHECK-SAME: %[[VAL_0:.*]]: !fir.boxproc<() -> ()>) {
49 ! CHECK: %[[VAL_1:.*]] = fir.box_addr %[[VAL_0]] : (!fir.boxproc<() -> ()>) -> (() -> ())
50 ! CHECK: fir.call %[[VAL_1]]() {{.*}}: () -> ()