1 ! RUN: %python %S/test_errors.py %s %flang_fc1 -pedantic
6 !ERROR: 'foo' is already declared in this scoping unit
15 !ERROR: 'foo' is already declared in this scoping unit
21 real :: a(10,10), b(10,10)
24 !PORTABILITY: Index variable 'y' should be a scalar object or common block if it is present in the enclosing scope
25 !ERROR: Must have INTEGER type, but is REAL(4)
26 forall(x
=1:10, y
=1:10)
27 !ERROR: Must have INTEGER type, but is REAL(4)
28 !ERROR: Must have INTEGER type, but is REAL(4)
31 !PORTABILITY: Index variable 'y' should be a scalar object or common block if it is present in the enclosing scope
32 !ERROR: Must have INTEGER type, but is REAL(4)
33 !ERROR: Must have INTEGER type, but is REAL(4)
34 !ERROR: Must have INTEGER type, but is REAL(4)
35 forall(x
=1:10, y
=1:10) a(x
, y
) = b(x
, y
)
42 !ERROR: Must have INTEGER type, but is COMPLEX(4)
44 !ERROR: Must have INTEGER type, but is COMPLEX(4)
45 !ERROR: Must have INTEGER type, but is COMPLEX(4)
48 !ERROR: Must have INTEGER type, but is REAL(4)
50 !ERROR: Must have INTEGER type, but is REAL(4)
51 !ERROR: Must have INTEGER type, but is REAL(4)
54 !PORTABILITY: Index variable 'i' should be scalar in the enclosing scope
61 integer, parameter :: n
= 4
62 real, dimension(n
) :: x
63 data(x(i
), i
=1, n
) / n
* 0.0 /
64 !PORTABILITY: Index variable 't' should be a scalar object or common block if it is present in the enclosing scope
65 !ERROR: Must have INTEGER type, but is REAL(4)
66 !ERROR: Must have INTEGER type, but is REAL(4)
67 forall(t
=1:n
) x(t
) = 0.0
74 integer, parameter :: k
= 4
76 forall(integer(k
) :: i
= 1:10)
78 ! C713 A scalar-int-constant-name shall be a named constant of type integer.
79 !ERROR: Must be a constant value
80 forall(integer(l
) :: i
= 1:10)
85 !ERROR: 'i' is already declared in this scoping unit
86 do concurrent(integer::i
=1:5) local(j
, i
) &
87 !ERROR: 'j' is already declared in this scoping unit
89 !WARNING: Variable 'a' with SHARED locality implicitly declared
97 !ERROR: No explicit type declared for 'i'
98 do concurrent(i
=1:5) &
99 !ERROR: No explicit type declared for 'j'
101 !ERROR: No explicit type declared for 'k'
108 !ERROR: 'i' is already declared in this scoping unit
109 do concurrent(integer::i
=1:5) shared(i
) &
111 !ERROR: 'j' is already declared in this scoping unit
118 real, parameter :: bad2
= 1.0
120 do concurrent(i
=1:2) &
121 !ERROR: 'bad1' may not appear in a locality-spec because it is not definable
122 !BECAUSE: 'bad1' is not a variable
124 !ERROR: 'bad2' may not appear in a locality-spec because it is not definable
125 !BECAUSE: 'bad2' is not a variable
127 !ERROR: 'bad3' may not appear in a locality-spec because it is not definable
128 !BECAUSE: 'bad3' is not a variable
130 !ERROR: 'cos' may not appear in a locality-spec because it is not definable
131 !BECAUSE: 'cos' is not a variable
134 do concurrent(i
=1:2) &
135 !ERROR: The name 'bad1' must be a variable to appear in a locality-spec
137 !ERROR: The name 'bad2' must be a variable to appear in a locality-spec
139 !ERROR: The name 'bad3' must be a variable to appear in a locality-spec
141 !ERROR: The name 'cos' must be a variable to appear in a locality-spec