File: contiguous01.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 (37 lines) | stat: -rw-r--r-- 1,409 bytes parent folder | download | duplicates (2)
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
! RUN: %python %S/test_errors.py %s %flang_fc1
module m0
  real, pointer, contiguous :: p1(:) ! ok
  real, pointer :: p2(:)
end
module m
  use m0
  !ERROR: Cannot change CONTIGUOUS attribute on use-associated 'p1'
  contiguous p1
  !ERROR: Cannot change CONTIGUOUS attribute on use-associated 'p2'
  contiguous p2
  !ERROR: CONTIGUOUS entity 'x' must be an array pointer, assumed-shape, or assumed-rank
  real, contiguous :: x
  !ERROR: CONTIGUOUS entity 'scalar' must be an array pointer, assumed-shape, or assumed-rank
  real, contiguous, pointer :: scalar
  !ERROR: CONTIGUOUS entity 'allocatable' must be an array pointer, assumed-shape, or assumed-rank
  real, contiguous, allocatable :: allocatable
 contains
  !ERROR: CONTIGUOUS entity 'func' must be an array pointer, assumed-shape, or assumed-rank
  function func(ashape,arank) result(r)
    real, contiguous :: ashape(:) ! ok
    real, contiguous :: arank(..) ! ok
    !ERROR: CONTIGUOUS entity 'r' must be an array pointer, assumed-shape, or assumed-rank
    real :: r(10)
    !ERROR: CONTIGUOUS entity 'r2' must be an array pointer, assumed-shape, or assumed-rank
    real :: r2(10)
    contiguous func
    contiguous r
    contiguous e
    contiguous r2
    !ERROR: CONTIGUOUS entity 'e' must be an array pointer, assumed-shape, or assumed-rank
    entry e() result(r2)
  end
  function fp()
    real, pointer, contiguous :: fp(:) ! ok
  end
end