summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gfortran.dg/test_com_block.f90
blob: df3f643e72d57ced7380005e9f08f49c6d17e4e2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
! { dg-do run }
module nonF03ComBlock
  common /NONF03COM/ r, s
  real :: r
  real :: s
  
  contains
    
    subroutine hello(myArray)
      integer, dimension(:) :: myArray

      r = 1.0
      s = 2.0
    end subroutine hello
end module nonF03ComBlock

program testComBlock
  use nonF03ComBlock
  integer, dimension(1:10) :: myArray

  call hello(myArray)

  ! these are set in the call to hello() above
  ! r and s are reals (default size) in com block, set to 
  ! 1.0 and 2.0, respectively, in hello()
  if(r .ne. 1.0) then 
     call abort()
  endif
  if(s .ne. 2.0) then
     call abort()
  endif
end program testComBlock