1 ! RUN: %python %S/../test_errors.py %s %flang -fopenacc
3 ! Check OpenACC clause validity for the following construct and directive:
6 program openacc_update_validity
11 real(8), dimension(10) :: arr
15 integer, parameter :: N
= 256
16 integer, dimension(N
) :: c
18 integer :: wait1
, wait2
19 real(8), dimension(N
, N
) :: aa
, bb
, cc
20 logical :: ifCondition
= .TRUE
.
22 type(atype
), dimension(10) :: ta
23 real(8), dimension(N
) :: a
, f
, g
, h
25 !ERROR: At least one of DEVICE, HOST, SELF clause must appear on the UPDATE directive
28 !$acc update device(t%arr(:))
30 !$acc update device(ta(i)%arr(:))
32 !$acc update self(a, f) host(g) device(h)
34 !$acc update host(aa) async(1)
36 !$acc update device(bb) async(async1)
38 !ERROR: At most one ASYNC clause can appear on the UPDATE directive
39 !$acc update host(aa, bb) async(1) async(2)
41 !$acc update self(bb, cc(:)) wait(1)
43 !ERROR: SELF clause on the UPDATE directive must have a var-list
46 !$acc update device(aa, bb, cc) wait(wait1)
48 !$acc update host(aa) host(bb) device(cc) wait(1,2)
50 !$acc update device(aa, cc) wait(wait1, wait2)
52 !$acc update device(aa) device_type(*) async
54 !$acc update host(bb) device_type(*) wait
56 !$acc update self(cc) device_type(1,2) async device_type(3) wait
58 !ERROR: At most one IF clause can appear on the UPDATE directive
59 !$acc update device(aa) if(.true.) if(ifCondition)
61 !ERROR: At most one IF_PRESENT clause can appear on the UPDATE directive
62 !$acc update device(bb) if_present if_present
64 !ERROR: Clause IF is not allowed after clause DEVICE_TYPE on the UPDATE directive
65 !$acc update device(i) device_type(*) if(.TRUE.)
67 end program openacc_update_validity