2014-07-12 Paul Thomas <pault@gcc.gnu.org>
[official-gcc.git] / gcc / testsuite / gfortran.dg / use_4.f90
bloba05689d3772db4adabbe1995977571715e8c2e16
1 ! { dg-do compile }
2 ! PR fortran/30973
3 ! Using symbols with the name of the module
5 module foo
6 integer :: i
7 end module foo
9 module bar
10 integer :: j
11 end module bar
13 module test
14 use foo, only:
15 integer :: foo ! { dg-error "cannot have a type" }
16 end module test
18 module test2
19 use bar, only: foo => j
20 use foo ! ok, unless foo is accessed
21 end module test2
23 module test3
24 use bar, only: foo => j
25 use foo ! ok, unless foo is accessed
26 foo = 5 ! { dg-error "is an ambiguous reference to 'j'" }
27 end module test3
29 program test_foo
30 use foo, only: foo ! { dg-error "been used as an external module name" }
31 use foo, only: i => foo! { dg-error "been used as an external module name" }
32 use foo, only: foo => i! { dg-error "been used as an external module name" }
33 end program