summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gfortran.dg/host_assoc_function_4.f90
blob: 799eb0078709ad3e8cb2f8c0daf1d8c0c7941ead (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
! { dg-do run }
!
! PR fortran/37445, in which the contained 's1' would be
! ignored and the use+host associated version used.
!
! Contributed by Norman S Clerman < clerman@fuse.net>
!
MODULE M1
CONTAINS
  integer function S1 ()
    s1 = 0
  END function
END MODULE

MODULE M2
  USE M1
CONTAINS
  SUBROUTINE S2
    if (s1 () .ne. 1) call abort
  CONTAINS
    integer function S1 ()
      s1 = 1
    END function
  END SUBROUTINE
END MODULE

  USE M2
  CALL S2
END
! { dg-final { cleanup-modules "M1 M2" } }