68 lines · plain
1! RUN: %python %S/../test_errors.py %s %flang -fopenacc2 3! Check OpenACC clause validity for the following construct and directive:4! 2.14.4 Update5 6program openacc_update_validity7 8 implicit none9 10 type atype11 real(8), dimension(10) :: arr12 end type atype13 14 integer :: i15 integer, parameter :: N = 25616 integer, dimension(N) :: c17 integer :: async118 integer :: wait1, wait219 real(8), dimension(N, N) :: aa, bb, cc20 logical :: ifCondition = .TRUE.21 type(atype) :: t22 type(atype), dimension(10) :: ta23 real(8), dimension(N) :: a, f, g, h24 25 !ERROR: At least one of DEVICE, HOST, SELF clause must appear on the UPDATE directive26 !$acc update27 28 !$acc update device(t%arr(:))29 30 !$acc update device(ta(i)%arr(:))31 32 !$acc update self(a, f) host(g) device(h)33 34 !$acc update host(aa) async(1)35 36 !$acc update device(bb) async(async1)37 38 !ERROR: At most one ASYNC clause can appear on the UPDATE directive39 !$acc update host(aa, bb) async(1) async(2)40 41 !$acc update self(bb, cc(:,:)) wait(1)42 43 !ERROR: SELF clause on the UPDATE directive must have a var-list44 !$acc update self45 46 !$acc update device(aa, bb, cc) wait(wait1)47 48 !$acc update host(aa) host(bb) device(cc) wait(1,2)49 50 !$acc update device(aa, cc) wait(wait1, wait2)51 52 !$acc update device(aa) device_type(*) async53 54 !$acc update host(bb) device_type(*) wait55 56 !$acc update self(cc) device_type(host,multicore) async device_type(*) wait57 58 !ERROR: At most one IF clause can appear on the UPDATE directive59 !$acc update device(aa) if(.true.) if(ifCondition)60 61 ! OK62 !$acc update device(bb) if_present if_present63 64 !ERROR: Clause IF is not allowed after clause DEVICE_TYPE on the UPDATE directive65 !$acc update device(i) device_type(*) if(.TRUE.)66 67end program openacc_update_validity68