1 ! RUN: %python %S/test_errors.py %s %flang_fc1
2 ! Tests for F'2023 C1130:
3 ! A variable-name that appears in a LOCAL or LOCAL_INIT locality-spec shall not
4 ! have the ALLOCATABLE; INTENT (IN); or OPTIONAL attribute; shall not be of
5 ! finalizable type; shall not be a nonpointer polymorphic dummy argument; and
6 ! shall not be a coarray or an assumed-size array.
9 ! Cannot have ALLOCATABLE variable in a LOCAL/LOCAL_INIT locality spec
10 integer, allocatable
:: k
11 !ERROR: ALLOCATABLE variable 'k' not allowed in a LOCAL locality-spec
12 do concurrent(i
=1:5) local(k
)
14 !ERROR: ALLOCATABLE variable 'k' not allowed in a LOCAL_INIT locality-spec
15 do concurrent(i
=1:5) local_init(k
)
20 ! Cannot have a dummy OPTIONAL in a locality spec
21 integer, optional
:: arg
22 !ERROR: OPTIONAL argument 'arg' not allowed in a locality-spec
23 do concurrent(i
=1:5) local(arg
)
30 do concurrent(i
=1:5) local(arg
)
35 ! Cannot have a dummy INTENT(IN) in a locality spec
36 real, intent(in
) :: arg
37 !ERROR: INTENT IN argument 'arg' not allowed in a locality-spec
38 do concurrent(i
=1:5) local(arg
)
43 ! Cannot have a variable of a finalizable type in a LOCAL locality spec
52 !ERROR: Finalizable variable 'var' not allowed in a LOCAL locality-spec
53 do concurrent(i
=1:5) local(var
)
62 ! Cannot have a nonpointer polymorphic dummy argument in a LOCAL locality spec
68 class(t
), pointer :: x
72 do concurrent(i
=1:5) local(x
)
76 !ERROR: Nonpointer polymorphic argument 'y' not allowed in a LOCAL locality-spec
77 do concurrent(i
=1:5) local(y
)
83 ! Cannot have a coarray
84 integer, codimension
[*] :: coarray_var
85 !ERROR: Coarray 'coarray_var' not allowed in a LOCAL locality-spec
86 do concurrent(i
=1:5) local(coarray_var
)
91 ! Cannot have an assumed size array
92 integer, dimension(*) :: arg
93 !ERROR: Assumed size array 'arg' not allowed in a locality-spec
94 do concurrent(i
=1:5) local(arg
)