aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/gfortran.dg/gomp/reduction5.f90
blob: 85491f0b643cc583fac211d6f6ad46651754b713 (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
48
49
50
51
52
53
54
55
56
57
! { dg-do compile }
!
implicit none
integer :: a, b, i
a = 0

!$omp parallel reduction(foo,+:a)  ! { dg-error "26: Failed to match clause" }
do i=1,10
  a = a + 1
end do
!$omp end parallel  ! { dg-error "Unexpected !.OMP END PARALLEL statement" }

!$omp parallel reduction(task +:a) ! { dg-error "30: Comma expected at" }
do i=1,10
  a = a + 1
end do
!$omp end parallel  ! { dg-error "Unexpected !.OMP END PARALLEL statement" }

!$omp task in_reduction(foo,+:a)  ! { dg-error "25: Failed to match clause" }
  a = a + 1
!$omp end task  ! { dg-error "Unexpected !.OMP END TASK statement" }

!$omp taskloop reduction(inscan,+:a) in_reduction(+:b) ! { dg-error "'inscan' REDUCTION clause on construct other than DO, SIMD, DO SIMD, PARALLEL DO, PARALLEL DO SIMD" }
  ! { dg-error "34: With INSCAN at .1., expected loop body with ..OMP SCAN between two structured block sequences" "" { target *-*-* } .-1 }
  ! { dg-error "'inscan' and non-'inscan' 'reduction' clauses on the same construct" "" { target *-*-* } .-2 }
do i=1,10
  a = a + 1
end do

!$omp taskloop reduction(task,+:a) in_reduction(+:b) ! { dg-error "32: Only DEFAULT permitted as reduction-modifier in REDUCTION clause" }
do i=1,10
  a = a + 1
end do

!$omp teams reduction(inscan,+:b) ! { dg-error "'inscan' REDUCTION clause on construct other than DO, SIMD, DO SIMD, PARALLEL DO, PARALLEL DO SIMD" }
  a = a + 1
!$omp end teams

!$omp teams reduction(task, +:b) ! { dg-error "30: Only DEFAULT permitted as reduction-modifier in REDUCTION clause" }
  a = a + 1
!$omp end teams

!$omp parallel reduction(inscan,+:a)  ! { dg-error "'inscan' REDUCTION clause on construct other than DO, SIMD, DO SIMD, PARALLEL DO, PARALLEL DO SIMD" }
do i=1,10
  a = a + 1
end do
!$omp end parallel

!$omp parallel
!$omp sections reduction(inscan,+:a)   ! { dg-error "'inscan' REDUCTION clause on construct other than DO, SIMD, DO SIMD, PARALLEL DO, PARALLEL DO SIMD" }
  !$omp section
  a = a + 1
!$omp end sections
!$omp end parallel


end