1 ! RUN: %S/test_errors.sh %s %t %flang_fc1
3 ! Tests for duplicate definitions and initializations, mostly of procedures
5 procedure(real), pointer :: p
6 !ERROR: The interface for procedure 'p' has already been declared
7 procedure(integer), pointer :: p
11 real, dimension(:), pointer :: realArray
=> null()
12 !ERROR: The type of 'realarray' has already been declared
13 real, dimension(:), pointer :: realArray
=> localArray
22 procedure(sub
), pointer :: p1
=> null()
23 !ERROR: The interface for procedure 'p1' has already been declared
24 procedure(sub
), pointer :: p1
=> null()
34 procedure(fun
), pointer :: f1
=> null()
35 !ERROR: The interface for procedure 'f1' has already been declared
36 procedure(fun
), pointer :: f1
=> null()
41 real, dimension(:), pointer :: localArray
=> null()
43 real, dimension(:), pointer :: realArray
=> null()
44 !ERROR: Component 'realarray' is already declared in this derived type
45 real, dimension(:), pointer :: realArray
=> localArray
50 !ERROR: Actual argument for 'string=' has bad type 'REAL(4)'
51 character(len
=len(a
)) :: b
52 !ERROR: The type of 'a' has already been implicitly declared
53 character(len
=len(b
)) :: a
57 integer, dimension(3) :: iarray
58 !ERROR: Derived type 'ubound' not found
59 character(len
=ubound(iarray
)(1)) :: first
63 integer, dimension(2) :: iarray
64 !ERROR: Derived type 'ubound' not found
65 integer :: ivar
= ubound(iarray
)(1)
70 !ERROR: The type of 'ivar' has already been declared
72 integer, target
:: jVar
= 5
73 integer, target
:: kVar
= 5
74 integer, pointer :: pVar
=> jVar
75 !ERROR: The type of 'pvar' has already been declared
76 integer, pointer :: pVar
=> kVar