diff --git a/flang/test/Semantics/acc-clause-validity.f90 b/flang/test/Semantics/acc-clause-validity.f90 --- a/flang/test/Semantics/acc-clause-validity.f90 +++ b/flang/test/Semantics/acc-clause-validity.f90 @@ -25,9 +25,11 @@ integer, parameter :: N = 256 integer, dimension(N) :: c logical, dimension(N) :: d, e + integer :: async1 + integer :: wait1, wait2 real :: reduction_r logical :: reduction_l - real(8), dimension(N, N) :: aa + real(8), dimension(N, N) :: aa, bb, cc logical :: ifCondition = .TRUE. !ERROR: At least one clause is required on the DECLARE directive @@ -365,6 +367,141 @@ end do !$acc end kernels loop + !$acc serial + !$acc end serial + + !$acc serial async + !$acc end serial + + !$acc serial async(1) + !$acc end serial + + !$acc serial async(async1) + !$acc end serial + + !$acc serial wait + !$acc end serial + + !$acc serial wait(1) + !$acc end serial + + !$acc serial wait(wait1) + !$acc end serial + + !$acc serial wait(1,2) + !$acc end serial + + !$acc serial wait(wait1, wait2) + !$acc end serial + + !$acc serial if(.true.) + !$acc end serial + + !ERROR: At most one IF clause can appear on the SERIAL directive + !$acc serial if(.true.) if(ifCondition) + !$acc end serial + + !$acc serial if(ifCondition) + !$acc end serial + + !$acc serial self + !$acc end serial + + !$acc serial self(.true.) + !$acc end serial + + !$acc serial self(ifCondition) + !$acc end serial + + !$acc serial loop reduction(+: reduction_r) + do i = 1, N + reduction_r = a(i) + i + end do + + !$acc serial loop reduction(*: reduction_r) + do i = 1, N + reduction_r = reduction_r * (a(i) + i) + end do + + !$acc serial loop reduction(min: reduction_r) + do i = 1, N + reduction_r = min(reduction_r, a(i) * i) + end do + + !$acc serial loop reduction(max: reduction_r) + do i = 1, N + reduction_r = max(reduction_r, a(i) * i) + end do + + !$acc serial loop reduction(iand: b) + do i = 1, N + b = iand(b, c(i)) + end do + + !$acc serial loop reduction(ior: b) + do i = 1, N + b = ior(b, c(i)) + end do + + !$acc serial loop reduction(ieor: b) + do i = 1, N + b = ieor(b, c(i)) + end do + + !$acc serial loop reduction(.and.: reduction_l) + do i = 1, N + reduction_l = d(i) .and. e(i) + end do + + !$acc serial loop reduction(.or.: reduction_l) + do i = 1, N + reduction_l = d(i) .or. e(i) + end do + + !$acc serial loop reduction(.eqv.: reduction_l) + do i = 1, N + reduction_l = d(i) .eqv. e(i) + end do + + !$acc serial loop reduction(.neqv.: reduction_l) + do i = 1, N + reduction_l = d(i) .neqv. e(i) + end do + + !$acc serial copy(aa) copyin(bb) copyout(cc) + !$acc end serial + + !$acc serial copy(aa, bb) copyout(zero: cc) + !$acc end serial + + !$acc serial present(aa, bb) create(cc) + !$acc end serial + + !$acc serial copyin(readonly: aa, bb) create(zero: cc) + !$acc end serial + + !$acc serial deviceptr(aa, bb) no_create(cc) + !$acc end serial + + !$acc serial attach(aa, bb, cc) + !$acc end serial + + !$acc serial private(aa) firstprivate(bb, cc) + !$acc end serial + + !$acc serial default(none) + !$acc end serial + + !$acc serial default(present) + !$acc end serial + + !ERROR: At most one DEFAULT clause can appear on the SERIAL directive + !$acc serial default(present) default(none) + !$acc end serial + + !$acc serial device_type(*) async wait + !$acc end serial + !$acc serial device_type(*) async do i = 1, N a(i) = 3.14 @@ -473,6 +610,8 @@ !$acc kernels wait(devnum: 1: queues: 1, 2) async(3) !$acc end kernels + + !$acc wait !$acc wait async