Debian Codegraph @

gcc/testsuite/gfortran.dg/gomp/scan-8.f90

raw
1 integer function s1 (a1, a2, a3) result(r)
2 implicit none
3 integer :: a1, a2, a3
4 integer :: i, j, k
5 procedure(integer) :: iii
6
7 r = 0
8 !$omp simd collapse(3) reduction (inscan, +:r)
9 do i = 1, a1
10 do j = 1, a2
11 do k = 1, a3
12 !$omp scan exclusive (r) ! { dg-warning "!.OMP SCAN at .1. with zero executable statements in preceding structured block sequence" }
13 call f1 (2, k, r)
14 end do
15 end do
16 end do
17
18 !$omp simd collapse(3) reduction (inscan, +:r)
19 do i = 1, a1
20 do j = 1, a2
21 do k = 1, a3
22 r = r + iii (i, j, k)
23 !$omp scan exclusive (r) ! { dg-warning "!.OMP SCAN at .1. with zero executable statements in succeeding structured block sequence" }
24 end do
25 end do
26 end do
27
28 !$omp simd collapse(3) reduction (inscan, +:r)
29 do i = 1, a1
30 do j = 1, a2
31 do k = 1, a3
32 !$omp scan inclusive (r)
33 ! { dg-warning "!.OMP SCAN at .1. with zero executable statements in preceding structured block sequence" "" { target *-*-* } .-1 }
34 ! { dg-warning "!.OMP SCAN at .1. with zero executable statements in succeeding structured block sequence" "" { target *-*-* } .-2 }
35 end do
36 end do
37 end do
38 end function
39
40 integer function s2 (a1, a2, a3) result(r)
41 implicit none
42 integer :: a1, a2, a3
43 integer :: i, j, k
44 procedure(integer) :: iii
45
46 r = 0
47 !$omp simd collapse(3) reduction (inscan, +:r) ! { dg-error "With INSCAN at .1., expected loop body with !.OMP SCAN between two structured block sequences" }
48 do i = 1, a1
49 do j = 1, a2
50 do k = 1, a3
51 call f1 (2, k, r)
52 r = r + iii (i, j, k)
53 end do
54 end do
55 end do
56
57 r = 0
58 !$omp simd collapse(3) reduction (inscan, +:r) ! { dg-error "With INSCAN at .1., expected loop body with !.OMP SCAN between two structured block sequences" }
59 do i = 1, a1
60 do j = 1, a2
61 do k = 1, a3
62 end do
63 end do
64 end do
65
66 r = 0
67 !$omp simd collapse(3) reduction (inscan, +:r)
68 do i = 1, a1
69 do j = 1, a2
70 do k = 1, a3
71 call f1 (2, k, r)
72 !$omp scan inclusive (r)
73 !$omp scan inclusive (r) ! { dg-error "Unexpected !.OMP SCAN at .1. outside loop construct with 'inscan' REDUCTION clause" }
74 r = r + iii (i, j, k)
75 end do
76 end do
77 end do
78
79 !$omp scan inclusive (r) ! { dg-error "Unexpected !.OMP SCAN at .1. outside loop construct with 'inscan' REDUCTION clause" }
80
81 r = 0
82 !$omp simd collapse(3) reduction (inscan, +:r) ! { dg-error "With INSCAN at .1., expected loop body with !.OMP SCAN between two structured block sequences" }
83 do i = 1, a1
84 do j = 1, a2
85 do k = 1, a3
86 call f1 (2, k, r)
87 block
88 !$omp scan inclusive (r) ! { dg-error "Unexpected !.OMP SCAN at .1. outside loop construct with 'inscan' REDUCTION clause" }
89 end block
90 r = r + iii (i, j, k)
91 end do
92 end do
93 end do
94
95
96 end function