| 1 |
! { dg-do compile } |
| 2 |
! { dg-options "-std=gnu" } |
| 3 |
program do_concurrent_complex |
| 4 |
implicit none |
| 5 |
integer :: i, j, k, sum, product |
| 6 |
integer, dimension(10,10,10) :: array |
| 7 |
sum = 0 |
| 8 |
product = 1 |
| 9 |
do concurrent (i = 1:10) local(j) shared(sum) reduce(+:sum) |
| 10 |
! { dg-error "Variable .sum. at .1. has already been specified in a locality-spec" "" { target *-*-* } .-1 } |
| 11 |
do concurrent (j = 1:10) local(k) shared(product) reduce(*:product) |
| 12 |
! { dg-error "Variable .product. at .1. has already been specified in a locality-spec" "" { target *-*-* } .-1 } |
| 13 |
do concurrent (k = 1:10) |
| 14 |
array(i,j,k) = i * j * k |
| 15 |
sum = sum + array(i,j,k) |
| 16 |
product = product * array(i,j,k) |
| 17 |
end do |
| 18 |
end do |
| 19 |
end do |
| 20 |
print *, sum, product |
| 21 |
end program do_concurrent_complex |