File: data06.f90

package info (click to toggle)
llvm-toolchain-13 1%3A13.0.1-11
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 1,418,840 kB
  • sloc: cpp: 5,290,826; ansic: 996,570; asm: 544,593; python: 188,212; objc: 72,027; lisp: 30,291; f90: 25,395; sh: 24,898; javascript: 9,780; pascal: 9,398; perl: 7,484; ml: 5,432; awk: 3,523; makefile: 2,913; xml: 953; cs: 573; fortran: 539
file content (51 lines) | stat: -rw-r--r-- 1,818 bytes parent folder | download | duplicates (3)
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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
! RUN: %S/test_errors.sh %s %t %flang_fc1
! REQUIRES: shell
! DATA statement errors
subroutine s1
  type :: t1
    integer :: j = 666
  end type t1
  type(t1) :: t1x
  !ERROR: Default-initialized 't1x' must not be initialized in a DATA statement
  data t1x%j / 777 /
  integer :: ja = 888
  !ERROR: Default-initialized 'ja' must not be initialized in a DATA statement
  data ja / 999 /
  integer :: a1(10)
  !ERROR: DATA statement set has more values than objects
  data a1(1:9:2) / 6 * 1 /
  integer :: a2(10)
  !ERROR: DATA statement set has no value for 'a2(2_8)'
  data (a2(k),k=10,1,-2) / 4 * 1 /
  integer :: a3(2)
  !ERROR: DATA statement implied DO loop has a step value of zero
  data (a3(j),j=1,2,0)/2*333/
  integer :: a4(3)
  !ERROR: DATA statement designator 'a4(5_8)' is out of range
  data (a4(j),j=1,5,2) /3*222/
  interface
    real function rfunc(x)
      real, intent(in) :: x
    end function
  end interface
  real, pointer :: rp
  !ERROR: Procedure 'rfunc' may not be used to initialize 'rp', which is not a procedure pointer
  data rp/rfunc/
  procedure(rfunc), pointer :: rpp
  real, target :: rt
  !ERROR: Data object 'rt' may not be used to initialize 'rpp', which is a procedure pointer
  data rpp/rt/
  !ERROR: Initializer for 'rt' must not be a pointer
  data rt/null()/
  !ERROR: Initializer for 'rt' must not be a procedure
  data rt/rfunc/
  integer :: jx, jy
  !WARNING: DATA statement value initializes 'jx' of type 'INTEGER(4)' with CHARACTER
  data jx/'abc'/
  !ERROR: DATA statement value could not be converted to the type 'INTEGER(4)' of the object 'jx'
  data jx/t1()/
  !ERROR: DATA statement value could not be converted to the type 'INTEGER(4)' of the object 'jx'
  data jx/.false./
  !ERROR: DATA statement value 'jy' for 'jx' is not a constant
  data jx/jy/
end subroutine