1! Test of worker-private variables declared on a loop directive.
2
3! { dg-do run }
4
5program main
6  integer :: x, i, j, arr(0:32*32)
7  common x
8
9  do i = 0, 32*32-1
10     arr(i) = i
11  end do
12
13  !$acc kernels copy(arr)
14  !$acc loop gang(num:32) private(x)
15  do i = 0, 31
16     !$acc loop worker(num:8) private(x)
17     do j = 0, 31
18        x = ieor(i, j * 3)
19        arr(i * 32 + j) = arr(i * 32 + j) + x
20     end do
21  end do
22  !$acc end kernels
23
24  do i = 0, 32 * 32 - 1
25     if (arr(i) .ne. i + ieor(i / 32, mod(i, 32) * 3)) stop 1
26  end do
27end program main
28