summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gfortran.dg/blockdata_4.f90
blob: 5cf3d1f42fba05a1f1435da4c22e49b31e2b85aa (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
! { dg-do compile }
! { dg-options "-std=gnu" }
! PR33152 Initialization/declaration problems in block data
! Test case prepared by Jerry DeLisle  <jvdelisle@gcc.gnu.org>
blockdata bab
 character(len=3) :: myname(2)=(/'bar','baz'/)
 common/nmstr/myname
end blockdata bab

blockdata thdinit 
 implicit none 
 integer, parameter :: nmin=2 
 common/onestr/emname 
 character(len=3) :: emname(nmin) = (/'bar','baz'/) 
end blockdata thdinit

blockdata fooinit 
 implicit none 
 integer, parameter :: nmin=2 
 common/twostr/aname 
 data aname/'bar','baz'/ ! { dg-error "DATA array" }
 character(len=3) :: aname(nmin)
end blockdata fooinit

end