aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/gfortran.dg/gomp/scan-9.f90
blob: 64d173602175cfa10acdc5ae58bbc5aed180146b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
subroutine foo (c, d, a)
  integer :: i, a, c(64), d(64)
  !$omp do reduction (inscan, +: a)
  !$omp tile sizes (2)
  do i = 1, 64
    a = a + c(i)
    !$omp scan inclusive (a) ! { dg-error "Unexpected !\\\$OMP SCAN at \\\(1\\\) outside loop construct with 'inscan' REDUCTION clause" }
    d(i) = a
  end do
end subroutine foo

subroutine bar (c, d, a)
  integer :: i, j, a, c(64, 64), d(64, 64)
  !$omp do collapse (2) reduction (inscan, +: a)
  do i = 1, 64
    !$omp tile sizes (2)
    do j = 1, 64
      d(i, j) = a
      !$omp scan exclusive (a) ! { dg-error "Unexpected !\\\$OMP SCAN at \\\(1\\\) outside loop construct with 'inscan' REDUCTION clause" }
      a = a + c(i, j)
    end do
  end do
end subroutine bar

subroutine baz (c, d, a)
  integer :: i, a, c(64), d(64)
  !$omp do reduction (inscan, +: a)
  !$omp unroll partial (2)
  do i = 1, 64
    d(i) = a
    !$omp scan exclusive (a) ! { dg-error "Unexpected !\\\$OMP SCAN at \\\(1\\\) outside loop construct with 'inscan' REDUCTION clause" }
    a = a + c(i)
  end do
end subroutine baz

subroutine qux (c, d, a)
  integer :: i, j, a, c(64, 64), d(64, 64)
  !$omp do collapse (2) reduction (inscan, +: a)
  do i = 1, 64
    !$omp tile sizes (2)
    do j = 1, 64
      a = a + c(i, j)
      !$omp scan inclusive (a) ! { dg-error "Unexpected !\\\$OMP SCAN at \\\(1\\\) outside loop construct with 'inscan' REDUCTION clause" }
      d(i, j) = a
    end do
  end do
end subroutine qux