File: resolve45.f90

package info (click to toggle)
llvm-toolchain-11 1%3A11.0.1-2
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 995,808 kB
  • sloc: cpp: 4,767,656; ansic: 760,916; asm: 477,436; python: 170,940; objc: 69,804; lisp: 29,914; sh: 23,855; f90: 18,173; pascal: 7,551; perl: 7,471; ml: 5,603; awk: 3,489; makefile: 2,573; xml: 915; cs: 573; fortran: 503; javascript: 452
file content (70 lines) | stat: -rw-r--r-- 1,767 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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
! RUN: %S/test_errors.sh %s %t %f18
function f1(x, y)
  integer x
  !ERROR: SAVE attribute may not be applied to dummy argument 'x'
  !ERROR: SAVE attribute may not be applied to dummy argument 'y'
  save x,y
  integer y
  !ERROR: SAVE attribute may not be applied to function result 'f1'
  save f1
end

function f2(x, y)
  !ERROR: SAVE attribute may not be applied to function result 'f2'
  real, save :: f2
  !ERROR: SAVE attribute may not be applied to dummy argument 'x'
  complex, save :: x
  allocatable :: y
  integer :: y
  !ERROR: SAVE attribute may not be applied to dummy argument 'y'
  save :: y
end

! SAVE statement should not trigger the above errors
function f2b(x, y)
  real :: x, y
  save
end

subroutine s3(x)
  !ERROR: SAVE attribute may not be applied to dummy argument 'x'
  procedure(integer), pointer, save :: x
  !ERROR: Procedure 'y' with SAVE attribute must also have POINTER attribute
  procedure(integer), save :: y
end

subroutine s4
  !ERROR: Explicit SAVE of 'z' is redundant due to global SAVE statement
  save z
  save
  procedure(integer), pointer :: x
  !ERROR: Explicit SAVE of 'x' is redundant due to global SAVE statement
  save :: x
  !ERROR: Explicit SAVE of 'y' is redundant due to global SAVE statement
  integer, save :: y
end

subroutine s5
  implicit none
  integer x
  block
    !ERROR: No explicit type declared for 'x'
    save x
  end block
end

subroutine s6
  save x
  save y
  !ERROR: SAVE attribute was already specified on 'y'
  integer, save :: y
  integer, save :: z
  !ERROR: SAVE attribute was already specified on 'x'
  !ERROR: SAVE attribute was already specified on 'z'
  save x,z
end

subroutine s7
  !ERROR: 'x' appears as a COMMON block in a SAVE statement but not in a COMMON statement
  save /x/
end