1 ! RUN: %python %S/test_errors.py %s %flang_fc1
2 ! Test BLOCK DATA subprogram (14.3)
4 !ERROR: IMPORT is not allowed in a BLOCK DATA subprogram
6 real :: pi
= asin(-1.0) ! ok
7 !ERROR: An initialized variable in BLOCK DATA must be in a COMMON block
8 integer :: notInCommon
= 1
9 integer :: uninitialized
! ok
10 !ERROR: 'q' may not appear in a BLOCK DATA subprogram
11 procedure(sin
), pointer :: q
=> cos
12 !ERROR: 'p' may not be a procedure as it is in a COMMON block
13 procedure(sin
), pointer :: p
=> cos
15 !ERROR: An initialized variable in BLOCK DATA must be in a COMMON block
16 integer :: inDataButNotCommon
17 data inDataButNotCommon
/1/
18 integer :: inCommonA
, inCommonB
19 !ERROR: 'incommona' in COMMON block /a/ must not be storage associated with 'incommonb' in COMMON block /b/ by EQUIVALENCE
20 common /a
/ inCommonA
, /b
/ inCommonB
21 equivalence(inCommonA
, inCommonB
)
22 integer :: inCommonD
, initialized
! ok
24 equivalence(inCommonD
, initialized
)
26 integer :: inCommonE
, jarr(2)
27 equivalence(inCommonE
, jarr(2))
28 !ERROR: 'incommone' cannot backward-extend COMMON block /e/ via EQUIVALENCE with 'jarr'
30 equivalence(inCommonF1
, inCommonF2
)
31 integer :: inCommonF1
, inCommonF2
32 !ERROR: 'incommonf1' is storage associated with 'incommonf2' by EQUIVALENCE elsewhere in COMMON block /f/
33 common /f
/ inCommonF1
, inCommonF2