[LoopReroll] Add an extra defensive check to avoid SCEV assertion.
[llvm-project.git] / flang / test / Semantics / resolve91.f90
blob44b1dc5e33300641dbbdb39cdb16ca909f9dd713
1 ! RUN: %S/test_errors.sh %s %t %flang_fc1
2 ! REQUIRES: shell
3 ! Tests for duplicate definitions and initializations, mostly of procedures
4 module m
5 procedure(real), pointer :: p
6 !ERROR: The interface for procedure 'p' has already been declared
7 procedure(integer), pointer :: p
8 end
10 module m1
11 real, dimension(:), pointer :: realArray => null()
12 !ERROR: The type of 'realarray' has already been declared
13 real, dimension(:), pointer :: realArray => localArray
14 end module m1
16 module m2
17 interface
18 subroutine sub()
19 end subroutine sub
20 end interface
22 procedure(sub), pointer :: p1 => null()
23 !ERROR: The interface for procedure 'p1' has already been declared
24 procedure(sub), pointer :: p1 => null()
26 end module m2
28 module m3
29 interface
30 real function fun()
31 end function fun
32 end interface
34 procedure(fun), pointer :: f1 => null()
35 !ERROR: The interface for procedure 'f1' has already been declared
36 procedure(fun), pointer :: f1 => null()
38 end module m3
40 module m4
41 real, dimension(:), pointer :: localArray => null()
42 type :: t2
43 real, dimension(:), pointer :: realArray => null()
44 !ERROR: Component 'realarray' is already declared in this derived type
45 real, dimension(:), pointer :: realArray => localArray
46 end type
47 end module m4
49 module m5
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
54 end module m5
56 module m6
57 integer, dimension(3) :: iarray
58 !ERROR: Derived type 'ubound' not found
59 character(len=ubound(iarray)(1)) :: first
60 end module m6
62 module m7
63 integer, dimension(2) :: iarray
64 !ERROR: Derived type 'ubound' not found
65 integer :: ivar = ubound(iarray)(1)
66 end module m7
68 module m8
69 integer :: iVar = 3
70 !ERROR: The type of 'ivar' has already been declared
71 integer :: iVar = 4
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
77 end module m8