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 "Only DEFAULT permitted as reduction-modifier in REDUCTION clause" "" { target *-*-* } .-2 }
26  ! { dg-error "'inscan' and non-'inscan' 'reduction' clauses on the same construct" "" { target *-*-* } .-3 }
27do i=1,10
28  a = a + 1
29end do
30
31!$omp taskloop reduction(task,+:a) in_reduction(+:b) ! { dg-error "32: Only DEFAULT permitted as reduction-modifier in REDUCTION clause" }
32do i=1,10
33  a = a + 1
34end do
35
36!$omp teams reduction(inscan,+:b) ! { dg-error "'inscan' REDUCTION clause on construct other than DO, SIMD, DO SIMD, PARALLEL DO, PARALLEL DO SIMD" }
37  ! { dg-error "Only DEFAULT permitted as reduction-modifier in REDUCTION clause" "" { target *-*-* } .-1 }
38  a = a + 1
39!$omp end teams
40
41!$omp teams reduction(task, +:b) ! { dg-error "30: Only DEFAULT permitted as reduction-modifier in REDUCTION clause" }
42  a = a + 1
43!$omp end teams
44
45!$omp parallel reduction(inscan,+:a)  ! { dg-error "'inscan' REDUCTION clause on construct other than DO, SIMD, DO SIMD, PARALLEL DO, PARALLEL DO SIMD" }
46do i=1,10
47  a = a + 1
48end do
49!$omp end parallel
50
51!$omp parallel
52!$omp sections reduction(inscan,+:a)   ! { dg-error "'inscan' REDUCTION clause on construct other than DO, SIMD, DO SIMD, PARALLEL DO, PARALLEL DO SIMD" }
53  !$omp section
54  a = a + 1
55!$omp end sections
56!$omp end parallel
57
58
59end
60