view gcc/testsuite/gfortran.dg/pr78619.f90 @ 131:84e7813d76e9

gcc-8.2
author mir3636
date Thu, 25 Oct 2018 07:37:49 +0900
parents
children
line wrap: on
line source

! { dg-do compile }
! { dg-options "-Werror -O3" }
!
! Tests the fix for PR78619, in which the recursive use of 'f' at line 13
! caused an ICE.
!
! Contributed by Gerhard Steinmetz  <gerhard.steinmetz.fortran@t-online.de>
!
  print *, g(1.0) ! 'g' is OK
contains
  function f(x) result(z)
    real :: x, z
    z = sign(1.0, f) ! { dg-error "calling itself recursively|must be the same type" }
  end
  real function g(x)
    real :: x
    g = -1
    g = -sign(1.0, g) ! This is OK.
  end
end
! { dg-message "all warnings being treated as errors" "" { target *-*-* } 0 }