1 ! RUN: %S/test_errors.sh %s %t %flang_fc1
4 !A variable that is referenced by the scalar-mask-expr of a
5 !concurrent-header or by any concurrent-limit or concurrent-step in that
6 !concurrent-header shall not appear in a LOCAL locality-spec in the same DO
11 !ERROR: 'i' is already declared in this scoping unit
12 do concurrent (i
=1:10) local(i
)
17 !ERROR: 'i' is already declared in this scoping unit
18 do concurrent (i
=1:10) local_init(i
)
23 !ERROR: DO CONCURRENT expression references variable 'i' in LOCAL locality-spec
24 do concurrent (j
=i
:10) local(i
)
29 !OK because the locality-spec is local_init
30 do concurrent (j
=i
:10) local_init(i
)
35 !OK because the locality-spec is shared
36 do concurrent (j
=i
:10) shared(i
)
41 !ERROR: DO CONCURRENT expression references variable 'i' in LOCAL locality-spec
42 do concurrent (j
=1:i
) local(i
)
47 !OK because the locality-spec is local_init
48 do concurrent (j
=1:i
) local_init(i
)
53 !OK because the locality-spec is shared
54 do concurrent (j
=1:i
) shared(i
)
59 !ERROR: DO CONCURRENT expression references variable 'i' in LOCAL locality-spec
60 do concurrent (j
=1:10:i
) local(i
)
65 !OK because the locality-spec is local_init
66 do concurrent (j
=1:10:i
) local_init(i
)
71 !OK because the locality-spec is shared
72 do concurrent (j
=1:10:i
) shared(i
)
77 ! Test construct-association, in this case, established by the "shared"
79 associate (avar
=> ivar
)
80 !ERROR: DO CONCURRENT expression references variable 'ivar' in LOCAL locality-spec
81 do concurrent (j
=1:10:avar
) local(avar
)
90 ! Test use-association, in this case, established by the "shared"
93 !ERROR: DO CONCURRENT expression references variable 'mvar' in LOCAL locality-spec
94 do concurrent (k
=mvar
:10) local(mvar
)
99 ! Test host-association, in this case, established by the "shared"
102 do concurrent (j
=ivar
:10) shared(ivar
)
103 !ERROR: DO CONCURRENT expression references variable 'ivar' in LOCAL locality-spec
104 do concurrent (k
=ivar
:10) local(ivar
)