summaryrefslogtreecommitdiff
path: root/flang/test/Semantics/OpenACC/acc-reduction-validity.f90
diff options
context:
space:
mode:
Diffstat (limited to 'flang/test/Semantics/OpenACC/acc-reduction-validity.f90')
-rw-r--r--flang/test/Semantics/OpenACC/acc-reduction-validity.f9014
1 files changed, 12 insertions, 2 deletions
diff --git a/flang/test/Semantics/OpenACC/acc-reduction-validity.f90 b/flang/test/Semantics/OpenACC/acc-reduction-validity.f90
index 0cdf33a2adb9..fd83e411191d 100644
--- a/flang/test/Semantics/OpenACC/acc-reduction-validity.f90
+++ b/flang/test/Semantics/OpenACC/acc-reduction-validity.f90
@@ -177,13 +177,23 @@ program openacc_reduction_validity
end program
subroutine sum()
- ! ERROR: 'sum' is already declared in this scoping unit
+ !ERROR: 'sum' is already declared in this scoping unit
integer :: i,sum
sum = 0
- !$acc parallel
+ !$acc parallel
+ !ERROR: Only variables are allowed in data clauses on the LOOP directive
!$acc loop independent gang reduction(+:sum)
do i=1,10
sum = sum + i
enddo
!$acc end parallel
end subroutine
+
+subroutine reduce()
+ integer :: red = 0, ii
+ !$acc parallel loop default(none) reduction(+:red)
+ do ii = 1, 10
+ red = red + ii
+ end do
+ !$acc end parallel
+end subroutine