summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gfortran.dg/generic_8.f90
blob: a129efe4ca47977efe842cbc0c4bd9956509e7e5 (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
28
29
30
31
! { dg-do compile }
! Tests the fix for PR29837, in which the following valid code
! would emit an error because of mistaken INTENT; the wrong
! specific interface would be used for the comparison.
!
! Contributed by 
!
MODULE M
  IMPLICIT NONE
  INTERFACE A
    MODULE PROCEDURE A1,A2
  END INTERFACE
CONTAINS

  SUBROUTINE A2(X)
    INTEGER, INTENT(INOUT) :: X
  END SUBROUTINE A2

  SUBROUTINE A1(X,Y)
    INTEGER, INTENT(IN) :: X
    INTEGER, INTENT(OUT) :: Y
    Y=X
  END SUBROUTINE A1

  SUBROUTINE T(X)
    INTEGER, INTENT(IN) :: X(:)
    INTEGER Y
    CALL A(MAXVAL(X),Y)
  END SUBROUTINE T
END MODULE M
! { dg-final { cleanup-modules "m" } }