[flang] Accept polymorphic component element in storage_size
[llvm-project.git] / flang / test / Lower / call-suspect.f90
blob1a2a35c25b73f5f86c8e215798a4a706be14dae2
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 %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
14 subroutine s1
15 call s3(r)
16 end subroutine s1
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
26 subroutine s2(p)
27 real, pointer :: p
28 call s3(p)
29 end subroutine s2
31 ! CHECK-LABEL: func @_QPs3(
32 ! CHECK-SAME: !fir.boxchar<1>
33 subroutine s3(c)
34 character(8) c
35 end subroutine s3