File: resolve91.f90

package info (click to toggle)
llvm-toolchain-20 1%3A20.1.8-1
  • links: PTS, VCS
  • area: main
  • in suites: experimental
  • size: 2,111,696 kB
  • sloc: cpp: 7,438,781; ansic: 1,393,871; asm: 1,012,926; python: 241,771; f90: 86,635; objc: 75,411; lisp: 42,144; pascal: 17,286; sh: 8,596; ml: 5,082; perl: 4,730; makefile: 3,591; awk: 3,523; javascript: 2,251; xml: 892; fortran: 672
file content (91 lines) | stat: -rw-r--r-- 2,667 bytes parent folder | download | duplicates (10)
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
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
! RUN: %python %S/test_errors.py %s %flang_fc1
! Tests for duplicate definitions and initializations, mostly of procedures
module m
  procedure(real), pointer :: p
  !ERROR: EXTERNAL attribute was already specified on 'p'
  !ERROR: POINTER attribute was already specified on 'p'
  !ERROR: The type of 'p' has already been declared
  procedure(integer), pointer :: p
end

module m1
    real, dimension(:), pointer :: realArray => null()
    !ERROR: POINTER attribute was already specified on 'realarray'
    !ERROR: The type of 'realarray' has already been declared
    real, dimension(:), pointer :: realArray => localArray
end module m1

module m2
  interface
    subroutine sub()
    end subroutine sub
  end interface

  procedure(sub), pointer :: p1 => null()
  !ERROR: EXTERNAL attribute was already specified on 'p1'
  !ERROR: POINTER attribute was already specified on 'p1'
  !ERROR: The interface for procedure 'p1' has already been declared
  procedure(sub), pointer :: p1 => null()

end module m2

module m3
  interface
    real function fun()
    end function fun
  end interface

  procedure(fun), pointer :: f1 => null()
  !ERROR: EXTERNAL attribute was already specified on 'f1'
  !ERROR: POINTER attribute was already specified on 'f1'
  !ERROR: The interface for procedure 'f1' has already been declared
  procedure(fun), pointer :: f1 => null()

end module m3

module m4
  real, dimension(:), pointer :: localArray => null()
  type :: t2
    real, dimension(:), pointer :: realArray => null()
    !ERROR: Component 'realarray' is already declared in this derived type
    real, dimension(:), pointer :: realArray => localArray
  end type
end module m4

module m5
  !ERROR: Actual argument for 'string=' has bad type 'REAL(4)'
  character(len=len(a)) :: b
  !ERROR: The type of 'a' has already been implicitly declared
  character(len=len(b)) :: a
end module m5

module m6
  integer, dimension(3) :: iarray
  !ERROR: Derived type 'ubound' not found
  character(len=ubound(iarray)(1)) :: first
end module m6

module m7
  integer, dimension(2) :: iarray
  !ERROR: Derived type 'ubound' not found
  integer :: ivar = ubound(iarray)(1)
end module m7

module m8
  integer :: iVar = 3
  !ERROR: The type of 'ivar' has already been declared
  integer :: iVar = 4
  integer, target :: jVar = 5
  integer, target :: kVar = 5
  integer, pointer :: pVar => jVar
  !ERROR: POINTER attribute was already specified on 'pvar'
  !ERROR: The type of 'pvar' has already been declared
  integer, pointer :: pVar => kVar
end module m8

module m9
  integer :: p, q
  procedure() p ! ok
  !ERROR: The type of 'q' has already been declared
  procedure(real) q
end module m9