[flang] Accept polymorphic component element in storage_size
[llvm-project.git] / flang / test / Lower / Intrinsics / dreal.f90
blob65d05c900e51aabf0c7bb3ed37ebccda8983d4c9
1 ! RUN: bbc -emit-fir %s -o - | FileCheck %s
3 subroutine test_dreal(r, c)
4 real(8), intent(out) :: r
5 complex(8), intent(in) :: c
7 ! CHECK-LABEL: func @_QPtest_dreal(
8 ! CHECK-SAME: %[[ARG_0:.*]]: !fir.ref<f64> {fir.bindc_name = "r"},
9 ! CHECK-SAME: %[[ARG_1:.*]]: !fir.ref<!fir.complex<8>> {fir.bindc_name = "c"}) {
10 ! CHECK: %[[VAL_0:.*]] = fir.load %[[ARG_1]] : !fir.ref<!fir.complex<8>>
11 ! CHECK: %[[VAL_1:.*]] = fir.extract_value %[[VAL_0]], [0 : index] : (!fir.complex<8>) -> f64
12 ! CHECK: fir.store %[[VAL_1]] to %[[ARG_0]] : !fir.ref<f64>
13 ! CHECK: return
14 ! CHECK: }
16 r = dreal(c)
17 end