2017-02-20 Paul Thomas <pault@gcc.gnu.org>
[official-gcc.git] / gcc / testsuite / gfortran.dg / test_com_block.f90
blobdf3f643e72d57ced7380005e9f08f49c6d17e4e2
1 ! { dg-do run }
2 module nonF03ComBlock
3 common /NONF03COM/ r, s
4 real :: r
5 real :: s
7 contains
9 subroutine hello(myArray)
10 integer, dimension(:) :: myArray
12 r = 1.0
13 s = 2.0
14 end subroutine hello
15 end module nonF03ComBlock
17 program testComBlock
18 use nonF03ComBlock
19 integer, dimension(1:10) :: myArray
21 call hello(myArray)
23 ! these are set in the call to hello() above
24 ! r and s are reals (default size) in com block, set to
25 ! 1.0 and 2.0, respectively, in hello()
26 if(r .ne. 1.0) then
27 call abort()
28 endif
29 if(s .ne. 2.0) then
30 call abort()
31 endif
32 end program testComBlock