| 1 |
! { dg-do run } |
| 2 |
! { dg-additional-options "-Wno-intrinsic-shadow" } |
| 3 |
! PR fortran/103782 - ICE overloading an intrinsic like dble or real |
| 4 |
! Contributed by Urban Jost |
| 5 |
|
| 6 |
program runtest |
| 7 |
implicit none |
| 8 |
interface dble |
| 9 |
procedure to_double |
| 10 |
end interface dble |
| 11 |
interface real |
| 12 |
procedure floor ! not really FLOOR... |
| 13 |
end interface real |
| 14 |
if (any (dble ([10.0d0,20.0d0]) - [10.0d0,20.0d0] /= 0.d0)) stop 1 |
| 15 |
if (any (real ([1.5,2.5]) - [1.5,2.5] /= 0.0 )) stop 2 |
| 16 |
contains |
| 17 |
elemental function to_double (valuein) result(d_out) |
| 18 |
doubleprecision,intent(in) :: valuein |
| 19 |
doubleprecision :: d_out |
| 20 |
d_out=valuein |
| 21 |
end function to_double |
| 22 |
elemental function floor (valuein) result(d_out) ! not really FLOOR... |
| 23 |
real, intent(in) :: valuein |
| 24 |
real :: d_out |
| 25 |
d_out=valuein |
| 26 |
end function floor |
| 27 |
end program runtest |