OpenCores
URL https://opencores.org/ocsvn/openrisc/openrisc/trunk

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-old/] [gcc-4.2.2/] [gcc/] [testsuite/] [gfortran.dg/] [missing_optional_dummy_3.f90] - Blame information for rev 841

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 149 jeremybenn
! { dg-do compile }
2
! Tests the fix for PR29976, in which the call to CMPLX caused an
3
! ICE with an optional dummy for the imaginary part.
4
!
5
! Contributed by Francois-Xavier Coudert 
6
!
7
SUBROUTINE pw_sumup (alpha_im)
8
  REAL, INTENT(in), OPTIONAL :: alpha_im
9
  COMPLEX :: my_alpha_c
10
  IF (PRESENT(alpha_im)) THEN
11
     my_alpha_c = CMPLX(0.,alpha_im)
12
  END IF
13
END SUBROUTINE pw_sumup
14
 
15
! Check non-intrinsic functions.
16
SUBROUTINE pw_sumup_2 (alpha_im)
17
  REAL, INTENT(in), OPTIONAL :: alpha_im
18
  COMPLEX :: my_alpha_c
19
  IF (PRESENT(alpha_im)) THEN
20
     my_alpha_c = MY_CMPLX(0.,alpha_im)
21
  END IF
22
contains
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)
28
    else
29
      MY_CMPLX = cmplx (re, 0.0)
30
    end if
31
  end function MY_CMPLX
32
END SUBROUTINE pw_sumup_2

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.