Break circular dependency between FIR dialect and utilities
[llvm-project.git] / flang / test / Semantics / block-data01.f90
blob4c8b8b7bf8bb7eef1df9873b934435ad12bc6e29
1 ! RUN: %python %S/test_errors.py %s %flang_fc1
2 ! Test BLOCK DATA subprogram (14.3)
3 block data foo
4 !ERROR: IMPORT is not allowed in a BLOCK DATA subprogram
5 import
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
14 common /block/ p, pi
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
23 common /d/ inCommonD
24 equivalence(inCommonD, initialized)
25 data initialized /2/
26 integer :: inCommonE, jarr(2)
27 equivalence(inCommonE, jarr(2))
28 !ERROR: 'incommone' cannot backward-extend COMMON block /e/ via EQUIVALENCE with 'jarr'
29 common /e/ inCommonE
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
34 end block data