PR target/84064
[official-gcc.git] / libgomp / testsuite / libgomp.oacc-fortran / collapse-8.f90
blob04fbcfef49acfb633bc03937d56759c1e8ac7f8d
1 ! { dg-do run }
3 ! collapse3.f90:test5
4 program collapse8
5 integer :: i, j, k, a(1:7, -3:5, 12:19), b(1:7, -3:5, 12:19)
6 integer :: v1, v2, v3, v4, v5, v6
7 logical :: l, r
8 l = .false.
9 r = .false.
10 a(:, :, :) = 0
11 b(:, :, :) = 0
12 v1 = 3
13 v2 = 6
14 v3 = -2
15 v4 = 4
16 v5 = 13
17 v6 = 18
18 !$acc parallel
19 !$acc loop collapse (3) reduction (.or.:l)
20 do i = v1, v2
21 do j = v3, v4
22 do k = v5, v6
23 l = l.or.i.lt.2.or.i.gt.6.or.j.lt.-2.or.j.gt.4
24 l = l.or.k.lt.13.or.k.gt.18
25 if (.not.l) a(i, j, k) = a(i, j, k) + 1
26 end do
27 end do
28 end do
29 !$acc end parallel
30 do i = v1, v2
31 do j = v3, v4
32 do k = v5, v6
33 r = r.or.i.lt.2.or.i.gt.6.or.j.lt.-2.or.j.gt.4
34 r = r.or.k.lt.13.or.k.gt.18
35 if (.not.r) b(i, j, k) = b(i, j, k) + 1
36 end do
37 end do
38 end do
39 if (l .neqv. r) call abort
40 do i = v1, v2
41 do j = v3, v4
42 do k = v5, v6
43 if (a(i, j, k) .ne. b(i, j, k)) call abort
44 end do
45 end do
46 end do
47 end program collapse8