1 ! RUN: %S/../test_errors.sh %s %t %flang -fopenacc
4 ! Check OpenACC clause validity for the following construct and directive:
7 program openacc_serial_loop_validity
12 integer, parameter :: N
= 256
13 integer, dimension(N
) :: c
14 logical, dimension(N
) :: d
, e
16 integer :: wait1
, wait2
18 logical :: reduction_l
19 logical :: ifCondition
= .TRUE
.
20 real(8), dimension(N
) :: a
23 !$acc serial loop reduction(+: reduction_r)
25 reduction_r
= a(i
) + i
28 !$acc serial loop reduction(*: reduction_r)
30 reduction_r
= reduction_r
* (a(i
) + i
)
33 !$acc serial loop reduction(min: reduction_r)
35 reduction_r
= min(reduction_r
, a(i
) * i
)
38 !$acc serial loop reduction(max: reduction_r)
40 reduction_r
= max(reduction_r
, a(i
) * i
)
43 !$acc serial loop reduction(iand: b)
48 !$acc serial loop reduction(ior: b)
53 !$acc serial loop reduction(ieor: b)
58 !$acc serial loop reduction(.and.: reduction_l)
60 reduction_l
= d(i
) .and
. e(i
)
63 !$acc serial loop reduction(.or.: reduction_l)
65 reduction_l
= d(i
) .or
. e(i
)
68 !$acc serial loop reduction(.eqv.: reduction_l)
70 reduction_l
= d(i
) .eqv
. e(i
)
73 !$acc serial loop reduction(.neqv.: reduction_l)
75 reduction_l
= d(i
) .neqv
. e(i
)
78 !ERROR: Clause IF is not allowed after clause DEVICE_TYPE on the SERIAL LOOP directive
79 !$acc serial loop device_type(*) if(.TRUE.)
85 !$acc serial loop if(ifCondition)
95 !ERROR: Unmatched END PARALLEL LOOP directive
96 !$acc end parallel loop
98 end program openacc_serial_loop_validity