1! Program to check resolution of symbols with the same name
2program contained2
3   implicit none
4   integer var1
5
6   var1 = 42
7   if (f1() .ne. 1) call abort
8   call f2()
9   if (var1 .ne. 42) call abort
10contains
11
12function f1 ()
13   implicit none
14   integer f1
15   integer var1
16   integer f2
17
18   var1 = 1
19   f2 = var1
20   f1 = f2
21end function
22
23subroutine f2()
24   implicit none
25   if (f1() .ne. 1) call abort
26end subroutine
27
28end program
29