summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gfortran.dg/intent_out_15.f90
blob: 64334e6f0388ff3cf92fa0a20202fff8659f0a43 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
! { dg-do compile }
! { dg-additional-options "-fdump-tree-original" }
!
! PR fortran/105012
! The following case was triggering an ICE because of a clobber
! on the DERFC function decl instead of its result.

module error_function
integer, parameter :: r8 = selected_real_kind(12) ! 8 byte real
contains
SUBROUTINE CALERF_r8(ARG, RESULT, JINT)
   integer, parameter :: rk = r8
   real(rk), intent(in)  :: arg
   real(rk), intent(out) :: result
   IF (Y .LE. THRESH) THEN
   END IF
end SUBROUTINE CALERF_r8
FUNCTION DERFC(X)
   integer, parameter :: rk = r8 ! 8 byte real
   real(rk), intent(in) :: X
   real(rk) :: DERFC
   CALL CALERF_r8(X, DERFC, JINT)
END FUNCTION DERFC
end module error_function

! { dg-final { scan-tree-dump-times "CLOBBER" 1 "original" } }
! { dg-final { scan-tree-dump "__result_derfc = {CLOBBER};" "original" } }