File: block-data01.f90

package info (click to toggle)
swiftlang 6.0.3-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 2,519,992 kB
  • sloc: cpp: 9,107,863; ansic: 2,040,022; asm: 1,135,751; python: 296,500; objc: 82,456; f90: 60,502; lisp: 34,951; pascal: 19,946; sh: 18,133; perl: 7,482; ml: 4,937; javascript: 4,117; makefile: 3,840; awk: 3,535; xml: 914; fortran: 619; cs: 573; ruby: 573
file content (34 lines) | stat: -rw-r--r-- 1,457 bytes parent folder | download | duplicates (4)
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
29
30
31
32
33
34
! RUN: %python %S/test_errors.py %s %flang_fc1
! Test BLOCK DATA subprogram (14.3)
block data foo
  !ERROR: IMPORT is not allowed in a BLOCK DATA subprogram
  import
  real :: pi = asin(-1.0) ! ok
  !ERROR: An initialized variable in BLOCK DATA must be in a COMMON block
  integer :: notInCommon = 1
  integer :: uninitialized ! ok
  !ERROR: 'q' may not appear in a BLOCK DATA subprogram
  procedure(sin), pointer :: q => cos
  !ERROR: 'p' may not be a procedure as it is in a COMMON block
  procedure(sin), pointer :: p => cos
  common /block/ p, pi
  !ERROR: An initialized variable in BLOCK DATA must be in a COMMON block
  integer :: inDataButNotCommon
  data inDataButNotCommon /1/
  integer :: inCommonA, inCommonB
  !ERROR: 'incommona' in COMMON block /a/ must not be storage associated with 'incommonb' in COMMON block /b/ by EQUIVALENCE
  common /a/ inCommonA, /b/ inCommonB
  equivalence(inCommonA, inCommonB)
  integer :: inCommonD, initialized ! ok
  common /d/ inCommonD
  equivalence(inCommonD, initialized)
  data initialized /2/
  integer :: inCommonE, jarr(2)
  equivalence(inCommonE, jarr(2))
  !ERROR: 'incommone' cannot backward-extend COMMON block /e/ via EQUIVALENCE with 'jarr'
  common /e/ inCommonE
  equivalence(inCommonF1, inCommonF2)
  integer :: inCommonF1, inCommonF2
  !ERROR: 'incommonf1' is storage associated with 'incommonf2' by EQUIVALENCE elsewhere in COMMON block /f/
  common /f/ inCommonF1, inCommonF2
end block data