aboutsummaryrefslogtreecommitdiffstats
path: root/gcc-4.9/gcc/testsuite/gfortran.dg/host_assoc_function_4.f90
blob: 46fb5f8006260703f06e198fbbd04ea6adccff3e (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
! { 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