2 ! Tests the fix for PR29976, in which the call to CMPLX caused an
3 ! ICE with an optional dummy for the imaginary part.
5 ! Contributed by Francois-Xavier Coudert <fxcoudert@gcc.gnu.org>
7 SUBROUTINE pw_sumup (alpha_im
)
8 REAL, INTENT(in
), OPTIONAL
:: alpha_im
10 IF (PRESENT(alpha_im
)) THEN
11 my_alpha_c
= CMPLX(0.,alpha_im
)
13 END SUBROUTINE pw_sumup
15 ! Check non-intrinsic functions.
16 SUBROUTINE pw_sumup_2 (alpha_im
)
17 REAL, INTENT(in
), OPTIONAL
:: alpha_im
19 IF (PRESENT(alpha_im
)) THEN
20 my_alpha_c
= MY_CMPLX(0.,alpha_im
)
23 complex function MY_CMPLX (re
, im
)
24 real, intent(in
) :: re
25 real, intent(in
), optional
:: im
26 if (present (im
)) then
27 MY_CMPLX
= cmplx (re
, im
)
29 MY_CMPLX
= cmplx (re
, 0.0)
32 END SUBROUTINE pw_sumup_2