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