annotate gcc/testsuite/gfortran.dg/use_13.f90 @ 111:04ced10e8804

gcc 7
author kono
date Fri, 27 Oct 2017 22:46:09 +0900
parents
children 84e7813d76e9
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
kono
parents:
diff changeset
28 if (fun() /= 42) call abort()
kono
parents:
diff changeset
29 if (var /= 43) call abort()
kono
parents:
diff changeset
30 call fun2()
kono
parents:
diff changeset
31 if (var /= 44) call abort()
kono
parents:
diff changeset
32 end subroutine test
kono
parents:
diff changeset
33 integer function fun()
kono
parents:
diff changeset
34 call abort()
kono
parents:
diff changeset
35 fun = -3
kono
parents:
diff changeset
36 end function fun
kono
parents:
diff changeset
37 subroutine fun2()
kono
parents:
diff changeset
38 call abort()
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