1 ! RUN: %python %S/test_errors.py %s %flang_fc1
2 ! Tests for duplicate definitions and initializations, mostly of procedures
4 procedure(real), pointer :: p
5 !ERROR: EXTERNAL attribute was already specified on 'p'
6 !ERROR: POINTER attribute was already specified on 'p'
7 !ERROR: The interface for procedure 'p' has already been declared
8 procedure(integer), pointer :: p
12 real, dimension(:), pointer :: realArray
=> null()
13 !ERROR: POINTER attribute was already specified on 'realarray'
14 !ERROR: The type of 'realarray' has already been declared
15 real, dimension(:), pointer :: realArray
=> localArray
24 procedure(sub
), pointer :: p1
=> null()
25 !ERROR: EXTERNAL attribute was already specified on 'p1'
26 !ERROR: POINTER attribute was already specified on 'p1'
27 !ERROR: The interface for procedure 'p1' has already been declared
28 procedure(sub
), pointer :: p1
=> null()
38 procedure(fun
), pointer :: f1
=> null()
39 !ERROR: EXTERNAL attribute was already specified on 'f1'
40 !ERROR: POINTER attribute was already specified on 'f1'
41 !ERROR: The interface for procedure 'f1' has already been declared
42 procedure(fun
), pointer :: f1
=> null()
47 real, dimension(:), pointer :: localArray
=> null()
49 real, dimension(:), pointer :: realArray
=> null()
50 !ERROR: Component 'realarray' is already declared in this derived type
51 real, dimension(:), pointer :: realArray
=> localArray
56 !ERROR: Actual argument for 'string=' has bad type 'REAL(4)'
57 character(len
=len(a
)) :: b
58 !ERROR: The type of 'a' has already been implicitly declared
59 character(len
=len(b
)) :: a
63 integer, dimension(3) :: iarray
64 !ERROR: Derived type 'ubound' not found
65 character(len
=ubound(iarray
)(1)) :: first
69 integer, dimension(2) :: iarray
70 !ERROR: Derived type 'ubound' not found
71 integer :: ivar
= ubound(iarray
)(1)
76 !ERROR: The type of 'ivar' has already been declared
78 integer, target
:: jVar
= 5
79 integer, target
:: kVar
= 5
80 integer, pointer :: pVar
=> jVar
81 !ERROR: POINTER attribute was already specified on 'pvar'
82 !ERROR: The type of 'pvar' has already been declared
83 integer, pointer :: pVar
=> kVar