1! RUN: %S/test_errors.sh %s %t %flang_fc1
2! REQUIRES: shell
3program p1
4  integer(8) :: a, b, c, d
5  pointer(a, b)
6  !ERROR: 'b' cannot be a Cray pointer as it is already a Cray pointee
7  pointer(b, c)
8  !ERROR: 'a' cannot be a Cray pointee as it is already a Cray pointer
9  pointer(d, a)
10end
11
12program p2
13  pointer(a, c)
14  !ERROR: 'c' was already declared as a Cray pointee
15  pointer(b, c)
16end
17
18program p3
19  real a
20  !ERROR: Cray pointer 'a' must have type INTEGER(8)
21  pointer(a, b)
22end
23
24program p4
25  implicit none
26  real b
27  !ERROR: No explicit type declared for 'd'
28  pointer(a, b), (c, d)
29end
30
31program p5
32  integer(8) a(10)
33  !ERROR: Cray pointer 'a' must be a scalar
34  pointer(a, b)
35end
36
37program p6
38  real b(8)
39  !ERROR: Array spec was already declared for 'b'
40  pointer(a, b(4))
41end
42
43program p7
44  !ERROR: Cray pointee 'b' must have must have explicit shape or assumed size
45  pointer(a, b(:))
46contains
47  subroutine s(x, y)
48    real :: x(*)  ! assumed size
49    !ERROR: Cray pointee 'y' must have must have explicit shape or assumed size
50    real :: y(:)  ! assumed shape
51    pointer(w, y)
52  end
53end
54
55program p8
56  integer(8), parameter :: k = 2
57  type t
58  end type
59  !ERROR: 't' is not a variable
60  pointer(t, a)
61  !ERROR: 's' is not a variable
62  pointer(s, b)
63  !ERROR: 'k' is not a variable
64  pointer(k, c)
65contains
66  subroutine s
67  end
68end
69
70program p9
71  integer(8), parameter :: k = 2
72  type t
73  end type
74  !ERROR: 't' is not a variable
75  pointer(a, t)
76  !ERROR: 's' is not a variable
77  pointer(b, s)
78  !ERROR: 'k' is not a variable
79  pointer(c, k)
80contains
81  subroutine s
82  end
83end
84
85module m10
86  integer(8) :: a
87  real :: b
88end
89program p10
90  use m10
91  !ERROR: 'b' cannot be a Cray pointee as it is use-associated
92  pointer(a, c),(d, b)
93end
94
95program p11
96  pointer(a, b)
97  !ERROR: PARAMETER attribute not allowed on 'a'
98  parameter(a=2)
99  !ERROR: PARAMETER attribute not allowed on 'b'
100  parameter(b=3)
101end
102
103program p12
104  type t1
105    sequence
106    real c1
107  end type
108  type t2
109    integer c2
110  end type
111  type(t1) :: x1
112  type(t2) :: x2
113  pointer(a, x1)
114  !ERROR: Type of Cray pointee 'x2' is a non-sequence derived type
115  pointer(b, x2)
116end
117