aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/gfortran.dg/do_concurrent_multiple_reduce.f90
blob: 47c71492107c4d7432df7da336144245a8552ef4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
! { dg-do compile }
program do_concurrent_multiple_reduce
  implicit none
  integer :: i, arr(10), sum, product
  sum = 0
  product = 1

  do concurrent (i = 1:10) reduce(+:sum) reduce(*:product)
    arr(i) = i
    sum = sum + i
    product = product * i
  end do

  print *, arr
  print *, "Sum:", sum
  print *, "Product:", product
end program do_concurrent_multiple_reduce