1 ! RUN: %python %S/../test_errors.py %s %flang -fopenacc -pedantic
3 ! Check OpenACC restruction in branch in and out of some construct
5 subroutine openacc_clause_validity
17 !ERROR: RETURN statement is not allowed in a PARALLEL construct
25 !ERROR: RETURN statement is not allowed in a PARALLEL LOOP construct
32 !ERROR: RETURN statement is not allowed in a SERIAL LOOP construct
39 !ERROR: RETURN statement is not allowed in a KERNELS LOOP construct
53 ! Exit branches out of parallel construct, not attached to an OpenACC parallel construct.
59 ifname
: if (j
== 2) then
64 !ERROR: EXIT to construct 'name1' outside of PARALLEL construct is not allowed
66 ! Exit to construct other than loops.
74 ! Exit branches out of parallel construct, attached to an OpenACC parallel construct.
76 fortname
: if (.true
.) then
77 !PORTABILITY: The construct name 'name1' should be distinct at the subprogram level
80 !ERROR: EXIT to construct 'fortname' outside of PARALLEL construct is not allowed
86 !ERROR: EXIT to construct 'name1' outside of PARALLEL construct is not allowed
93 !ERROR: EXIT to construct 'thisblk' outside of PARALLEL construct is not allowed
101 !Exit branches inside OpenACC construct.
106 ifname
: if (i
== 2) then
126 !ERROR: RETURN statement is not allowed in a KERNELS construct
152 !ERROR: RETURN statement is not allowed in a SERIAL construct
169 ifname
: if (.true
.) then
173 !ERROR: EXIT to construct 'name2' outside of SERIAL construct is not allowed
194 !ERROR: RETURN statement is not allowed in a DATA construct
195 if (size(a
) == 10) return
199 end subroutine openacc_clause_validity