annotate gcc/testsuite/gfortran.dg/use_13.f90 @ 131:84e7813d76e9

gcc-8.2
author mir3636
date Thu, 25 Oct 2018 07:37:49 +0900
parents 04ced10e8804
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
111
kono
parents:
diff changeset
1 ! { dg-do run }
kono
parents:
diff changeset
2 !
kono
parents:
diff changeset
3 ! PR fortran/44360
kono
parents:
diff changeset
4 !
kono
parents:
diff changeset
5 ! Test-case based on a contribution of Vittorio Zecca.
kono
parents:
diff changeset
6 !
kono
parents:
diff changeset
7 ! The used subroutine was not the use-associated but the host associated one!
kono
parents:
diff changeset
8 ! The use-associated function/variable were already working properly.
kono
parents:
diff changeset
9 !
kono
parents:
diff changeset
10 module m
kono
parents:
diff changeset
11 integer :: var = 43
kono
parents:
diff changeset
12 contains
kono
parents:
diff changeset
13 integer function fun()
kono
parents:
diff changeset
14 fun = 42
kono
parents:
diff changeset
15 end function fun
kono
parents:
diff changeset
16 subroutine fun2()
kono
parents:
diff changeset
17 var = 44
kono
parents:
diff changeset
18 end subroutine fun2
kono
parents:
diff changeset
19 end module m
kono
parents:
diff changeset
20
kono
parents:
diff changeset
21 module m2
kono
parents:
diff changeset
22 integer :: var = -2
kono
parents:
diff changeset
23 contains
kono
parents:
diff changeset
24 subroutine test()
kono
parents:
diff changeset
25 ! All procedures/variables below refer to the ones in module "m"
kono
parents:
diff changeset
26 ! and not to the siblings in this module "m2".
kono
parents:
diff changeset
27 use m
131
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
28 if (fun() /= 42) STOP 1
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
29 if (var /= 43) STOP 2
111
kono
parents:
diff changeset
30 call fun2()
131
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
31 if (var /= 44) STOP 3
111
kono
parents:
diff changeset
32 end subroutine test
kono
parents:
diff changeset
33 integer function fun()
131
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
34 STOP 4
111
kono
parents:
diff changeset
35 fun = -3
kono
parents:
diff changeset
36 end function fun
kono
parents:
diff changeset
37 subroutine fun2()
131
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
38 STOP 5
111
kono
parents:
diff changeset
39 end subroutine fun2
kono
parents:
diff changeset
40 end module m2
kono
parents:
diff changeset
41
kono
parents:
diff changeset
42 use m2
kono
parents:
diff changeset
43 call test()
kono
parents:
diff changeset
44 end