[flang] Accept polymorphic component element in storage_size
[llvm-project.git] / flang / test / Lower / Intrinsics / dimag.f90
blob535ca5f060ca2fe5de67b09f310346b3ee9c4fe4
1 ! RUN: bbc -emit-fir %s -o - | FileCheck %s
3 subroutine test_dimag(r, c)
4 real(8), intent(out) :: r
5 complex(8), intent(in) :: c
7 ! CHECK-LABEL: func @_QPtest_dimag(
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]], [1 : index] : (!fir.complex<8>) -> f64
12 ! CHECK: fir.store %[[VAL_1]] to %[[ARG_0]] : !fir.ref<f64>
13 ! CHECK: return
14 ! CHECK: }
16 r = dimag(c)
17 end