[flang] Accept polymorphic component element in storage_size
[llvm-project.git] / flang / test / Lower / Intrinsics / dconjg.f90
blobde33eeaf84c6b7fe3abe6daedd32725dfcac9168
1 ! RUN: bbc -emit-fir %s -o - | FileCheck %s
3 subroutine test_dconjg(r, c)
4 complex(8), intent(out) :: r
5 complex(8), intent(in) :: c
7 ! CHECK-LABEL: func @_QPtest_dconjg(
8 ! CHECK-SAME: %[[ARG_0:.*]]: !fir.ref<!fir.complex<8>> {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: %[[VAL_2:.*]] = arith.negf %[[VAL_1]] {{.*}}: f64
13 ! CHECK: %[[VAL_3:.*]] = fir.insert_value %[[VAL_0]], %[[VAL_2]], [1 : index] : (!fir.complex<8>, f64) -> !fir.complex<8>
14 ! CHECK: fir.store %[[VAL_3]] to %[[ARG_0]] : !fir.ref<!fir.complex<8>>
15 ! CHECK: return
16 ! CHECK: }
18 r = dconjg(c)
19 end