OSDN Git Service

PR testsuite/51875
[pf3gnuchains/gcc-fork.git] / gcc / testsuite / gfortran.dg / access_spec_3.f90
1 ! { dg-do compile }
2 !
3 ! Tests the fix for PR36454, where the PUBLIC declaration for
4 ! aint and bint was rejected because the access was already set.
5 !
6 ! Contributed by Thomas Orgis <thomas.orgis@awi.de>
7
8 module base
9         integer :: baseint
10 end module
11
12 module a
13         use base, ONLY: aint => baseint
14 end module
15
16 module b
17         use base, ONLY: bint => baseint
18 end module
19
20 module c
21         use a
22         use b
23         private
24         public :: aint, bint
25 end module
26
27 program user
28         use c, ONLY: aint, bint
29
30         aint = 3
31         bint = 8
32         write(*,*) aint
33 end program
34 ! { dg-final { cleanup-modules "base a b c" } }