1! { dg-do compile }
2!
3! PR fortran/44350
4!
5! Fortran 2008, C1116 only permits a small subset of statements in BLOCK DATA
6!
7! Part of the test case was contributed by Vittorio Zecca
8!
9module m
10end module m
11
12BLOCK DATA valid2
13  use m
14  implicit integer(a-z)
15  intrinsic :: sin
16  common /one/ a, c
17  bind(C) :: /one/
18  dimension c(5)
19  parameter (g = 7)
20END BLOCK DATA valid2
21
22BLOCK DATA valid
23  use m
24  implicit none
25  type t
26    sequence
27  end type t
28  type(t), save :: x
29  integer  :: y
30  real :: q
31  save :: y
32  dimension :: q(5)
33!  class(*) :: zz ! See PR fortran/58857
34!  pointer :: zz
35  target :: q
36  volatile y
37  asynchronous q
38END BLOCK DATA valid
39
40block data invalid
41      common x
42      f(x)=x ! { dg-error "STATEMENT FUNCTION statement is not allowed inside of BLOCK DATA" }
43      interface ! { dg-error "INTERFACE statement is not allowed inside of BLOCK DATA" }
44      end interface
451     format() ! { dg-error "FORMAT statement is not allowed inside of BLOCK DATA" }
46end block invalid ! { dg-error "Expecting END BLOCK DATA statement" }
47
48! { dg-error "Unexpected end of file" "" { target "*-*-*" } 0 }
49