[SimplifyCFG] Always allow hoisting if all instructions match. (#97158)
[llvm-project.git] / flang / test / Lower / Intrinsics / dreal.f90
blobc911bc9fea59d2abf9d08e33ef7806a6d4e6e866
1 ! RUN: bbc -emit-fir -hlfir=false %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<complex<f64>> {fir.bindc_name = "c"}) {
10 ! CHECK: %[[VAL_0:.*]] = fir.load %[[ARG_1]] : !fir.ref<complex<f64>>
11 ! CHECK: %[[VAL_1:.*]] = fir.extract_value %[[VAL_0]], [0 : index] : (complex<f64>) -> f64
12 ! CHECK: fir.store %[[VAL_1]] to %[[ARG_0]] : !fir.ref<f64>
13 ! CHECK: return
14 ! CHECK: }
16 r = dreal(c)
17 end