2008-07-06 Kai Tietz <kai.tietz@onevision.com>
[official-gcc.git] / gcc / testsuite / gfortran.dg / contained_1.f90
blob05216b2285a96e305ac283e52c56578e79879813
1 ! PR15986
2 ! Siblings may be used as actual arguments, in which case they look like
3 ! variables during parsing. Also checks that actual variables aren't replaced
4 ! by siblings with the same name
5 ! { dg-do run }
6 module contained_1_mod
7 integer i
8 contains
9 subroutine a
10 integer :: c = 42
11 call sub(b, c)
12 end subroutine a
13 subroutine b()
14 i = i + 1
15 end subroutine b
16 subroutine c
17 end subroutine
18 end module
20 subroutine sub (proc, var)
21 external proc1
22 integer var
24 if (var .ne. 42) call abort
25 call proc
26 end subroutine
28 program contained_1
29 use contained_1_mod
30 i = 0
31 call a
32 if (i .ne. 1) call abort
33 end program
35 ! { dg-final { cleanup-modules "contained_1_mod" } }