fix pr/45972
[official-gcc.git] / gcc / testsuite / gfortran.dg / bad_automatic_objects_1.f90
blobc4c1f2cb0ccd8df3373a1a026a781cd593cd12dc
1 ! { dg-do compile }
2 ! Tests the fix for 25103, in which the presence of automatic objects
3 ! in the main program and the specification part of a module was not
4 ! detected.
6 ! Contributed by Joost VandeVondele <jv244@cam.ac.uk>
8 module foo
9 integer :: i
10 end module foo
11 module bar
12 use foo
13 integer, dimension (i) :: j ! { dg-error "must have constant shape" }
14 character (len = i) :: c1 ! { dg-error "must have constant character length" }
15 end module bar
16 program foobar
17 use foo
18 integer, dimension (i) :: k ! { dg-error "must have constant shape" }
19 character (len = i) :: c2 ! { dg-error "must have constant character length" }
20 end program foobar
22 ! { dg-final { cleanup-modules "foo bar" } }