Debian Codegraph @

flang/test/Lower/HLFIR/assumed-rank-entry.f90

raw
1 ! Test assumed-rank dummy argument that is not present in
2 ! all ENTRY statements.
3 ! RUN: bbc -emit-hlfir -allow-assumed-rank -o - %s | FileCheck %s
4
5 subroutine test_main_entry(x)
6 real :: x(..)
7 interface
8 subroutine some_proc(x)
9 real :: x(..)
10 end subroutine
11 end interface
12 call some_proc(x)
13 entry test_alternate_entry()
14 call the_end()
15 end subroutine
16 ! CHECK-LABEL: func.func @_QPtest_main_entry(
17 ! CHECK-SAME: %[[VAL_0:.*]]: !fir.box<!fir.array<*:f32>> {fir.bindc_name = "x"}) {
18 ! CHECK: %[[VAL_1:.*]] = fir.dummy_scope : !fir.dscope
19 ! CHECK: %[[VAL_2:.*]]:2 = hlfir.declare %[[VAL_0]] dummy_scope %[[VAL_1]] {uniq_name = "_QFtest_main_entryEx"} : (!fir.box<!fir.array<*:f32>>, !fir.dscope) -> (!fir.box<!fir.array<*:f32>>, !fir.box<!fir.array<*:f32>>)
20
21 ! CHECK-LABEL: func.func @_QPtest_alternate_entry() {
22 ! CHECK: %[[VAL_0:.*]] = fir.alloca !fir.box<!fir.heap<!fir.array<*:f32>>>
23 ! CHECK: %[[VAL_1:.*]] = fir.zero_bits !fir.heap<f32>
24 ! CHECK: %[[VAL_2:.*]] = fir.embox %[[VAL_1]] : (!fir.heap<f32>) -> !fir.box<!fir.heap<f32>>
25 ! CHECK: %[[VAL_3:.*]] = fir.convert %[[VAL_2]] : (!fir.box<!fir.heap<f32>>) -> !fir.box<!fir.heap<!fir.array<*:f32>>>
26 ! CHECK: fir.store %[[VAL_3]] to %[[VAL_0]] : !fir.ref<!fir.box<!fir.heap<!fir.array<*:f32>>>>
27 ! CHECK: %[[VAL_4:.*]] = fir.load %[[VAL_0]] : !fir.ref<!fir.box<!fir.heap<!fir.array<*:f32>>>>
28 ! CHECK: %[[VAL_5:.*]]:2 = hlfir.declare %[[VAL_4]] {uniq_name = "_QFtest_main_entryEx"} : (!fir.box<!fir.heap<!fir.array<*:f32>>>) -> (!fir.box<!fir.heap<!fir.array<*:f32>>>, !fir.box<!fir.heap<!fir.array<*:f32>>>)