1 ! RUN: %S/../test_errors.sh %s %t %flang -fopenacc
4 ! Check OpenACC clause validity for the following construct and directive:
7 program openacc_loop_validity
12 real(8), dimension(10) :: arr
16 integer :: i
, j
, b
, gang_size
, vector_size
, worker_size
17 integer, parameter :: N
= 256
18 integer, dimension(N
) :: c
19 logical, dimension(N
) :: d
, e
21 integer :: wait1
, wait2
23 logical :: reduction_l
24 real(8), dimension(N
, N
) :: aa
, bb
, cc
25 logical :: ifCondition
= .TRUE
.
27 type(atype
), dimension(10) :: ta
29 real(8), dimension(N
) :: a
, f
, g
, h
38 !$acc parallel device_type(*) num_gangs(2)
53 !$acc loop independent
67 !ERROR: At most one VECTOR clause can appear on the LOOP directive
68 !$acc loop vector vector(128)
89 !$acc loop vector(vector_size)
96 !$acc loop vector(length: vector_size)
103 !ERROR: At most one WORKER clause can appear on the LOOP directive
104 !$acc loop worker worker(10)
118 !$acc loop worker(10)
125 !$acc loop worker(worker_size)
132 !$acc loop worker(num: worker_size)
139 !ERROR: At most one GANG clause can appear on the LOOP directive
140 !$acc loop gang gang(gang_size)
147 !$acc loop gang(gang_size)
154 !$acc loop gang(num: gang_size)
161 !$acc loop gang(gang_size, static:*)
168 !$acc loop gang(num: gang_size, static:*)
175 !$acc loop gang(num: gang_size, static: gang_size)
182 !$acc loop private(b, a(:))
196 !$acc loop tile(2, 2)
205 !ERROR: The parameter of the COLLAPSE clause must be a constant positive integer expression
206 !$acc loop collapse(-1)
215 !ERROR: Clause PRIVATE is not allowed after clause DEVICE_TYPE on the LOOP directive
216 !$acc loop device_type(*) private(i)
223 !ERROR: Clause GANG is not allowed if clause SEQ appears on the LOOP directive
231 !ERROR: Clause WORKER is not allowed if clause SEQ appears on the LOOP directive
232 !$acc loop worker seq
239 !ERROR: Clause VECTOR is not allowed if clause SEQ appears on the LOOP directive
240 !$acc loop vector seq
246 !ERROR: Clause IF is not allowed after clause DEVICE_TYPE on the PARALLEL directive
247 !$acc parallel device_type(*) if(.TRUE.)
254 end program openacc_loop_validity