1 ! Note: flang will issue warnings for the following subroutines. These
2 ! are accepted regardless to maintain backwards compatibility with
3 ! other Fortran implementations.
5 ! RUN: bbc -emit-fir -hlfir=false %s -o - | FileCheck %s
7 ! CHECK-LABEL: func @_QPs1() {
8 ! CHECK: %[[cast:.*]] = fir.convert %{{.*}} : (!fir.ref<f32>) -> !fir.ref<!fir.char<1,?>>
9 ! CHECK: %[[undef:.*]] = fir.undefined index
10 ! CHECK: %[[box:.*]] = fir.emboxchar %[[cast]], %[[undef]] : (!fir.ref<!fir.char<1,?>>, index) -> !fir.boxchar<1>
11 ! CHECK: fir.call @_QPs3(%[[box]]) {{.*}}: (!fir.boxchar<1>) -> ()
13 ! Pass a REAL by reference to a subroutine expecting a CHARACTER
18 ! CHECK-LABEL: func @_QPs2(
19 ! CHECK: %[[ptr:.*]] = fir.box_addr %{{.*}} : (!fir.box<!fir.ptr<f32>>) -> !fir.ptr<f32>
20 ! CHECK: %[[cast:.*]] = fir.convert %[[ptr]] : (!fir.ptr<f32>) -> !fir.ref<!fir.char<1,?>>
21 ! CHECK: %[[undef:.*]] = fir.undefined index
22 ! CHECK: %[[box:.*]] = fir.emboxchar %[[cast]], %[[undef]] : (!fir.ref<!fir.char<1,?>>, index) -> !fir.boxchar<1>
23 ! CHECK: fir.call @_QPs3(%[[box]]) {{.*}}: (!fir.boxchar<1>) -> ()
25 ! Pass a REAL, POINTER data reference to a subroutine expecting a CHARACTER
31 ! CHECK-LABEL: func @_QPs3(
32 ! CHECK-SAME: !fir.boxchar<1>