summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gfortran.dg/common_14.f90
blob: 892e4a5705f30cd9538e00d72d30ff6513ca7a65 (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
! { dg-do compile }
! { dg-options "-Wno-align-commons" }
!
! PR fortran/45044
!
! Named common blocks need to be all of the same size
! check that the compiler warns for those.

module m
  common /xx/ a
end module m

subroutine two()
integer :: a, b, c
real(8) :: y
common /xx/ a, b, c, y ! { dg-warning "Named COMMON block 'xx' at \\(1\\) shall be of the same size as elsewhere \\(24 vs 4 bytes" }
end


subroutine one()
integer :: a, b
common /xx/ a, b ! { dg-warning "Named COMMON block 'xx' at \\(1\\) shall be of the same size as elsewhere \\(8 vs 24 bytes" }
end

call two()
end

! { dg-final { cleanup-modules "m" } }