1! { dg-do compile }
2!
3implicit none
4integer :: a, b, i
5a = 0
6
7!$omp parallel reduction(foo,+:a)  ! { dg-error "26: Failed to match clause" }
8do i=1,10
9  a = a + 1
10end do
11!$omp end parallel  ! { dg-error "Unexpected !.OMP END PARALLEL statement" }
12
13!$omp parallel reduction(task +:a) ! { dg-error "30: Comma expected at" }
14do i=1,10
15  a = a + 1
16end do
17!$omp end parallel  ! { dg-error "Unexpected !.OMP END PARALLEL statement" }
18
19!$omp task in_reduction(foo,+:a)  ! { dg-error "25: Failed to match clause" }
20  a = a + 1
21!$omp end task  ! { dg-error "Unexpected !.OMP END TASK statement" }
22
23!$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" }
24  ! { dg-error "34: With INSCAN at .1., expected loop body with ..OMP SCAN between two structured-block-sequences" "" { target *-*-* } .-1 }
25  ! { dg-error "'inscan' and non-'inscan' 'reduction' clauses on the same construct" "" { target *-*-* } .-2 }
26do i=1,10
27  a = a + 1
28end do
29
30!$omp taskloop reduction(task,+:a) in_reduction(+:b) ! { dg-error "32: Only DEFAULT permitted as reduction-modifier in REDUCTION clause" }
31do i=1,10
32  a = a + 1
33end do
34
35!$omp teams reduction(inscan,+:b) ! { dg-error "'inscan' REDUCTION clause on construct other than DO, SIMD, DO SIMD, PARALLEL DO, PARALLEL DO SIMD" }
36  a = a + 1
37!$omp end teams
38
39!$omp teams reduction(task, +:b) ! { dg-error "30: Only DEFAULT permitted as reduction-modifier in REDUCTION clause" }
40  a = a + 1
41!$omp end teams
42
43!$omp parallel reduction(inscan,+:a)  ! { dg-error "'inscan' REDUCTION clause on construct other than DO, SIMD, DO SIMD, PARALLEL DO, PARALLEL DO SIMD" }
44do i=1,10
45  a = a + 1
46end do
47!$omp end parallel
48
49!$omp parallel
50!$omp sections reduction(inscan,+:a)   ! { dg-error "'inscan' REDUCTION clause on construct other than DO, SIMD, DO SIMD, PARALLEL DO, PARALLEL DO SIMD" }
51  !$omp section
52  a = a + 1
53!$omp end sections
54!$omp end parallel
55
56
57end
58