Fix build on sparc64-linux-gnu.
[official-gcc.git] / libgomp / testsuite / libgomp.fortran / nestedfn4.f90
blobbc8614a340ab4771abd52da77f556584c5cdee76
1 program foo
2 integer :: i, j, k
3 integer :: a(10), c(10)
4 k = 2
5 a(:) = 0
6 call test1
7 call test2
8 do i = 1, 10
9 if (a(i) .ne. 10 * i) STOP 1
10 end do
11 !$omp parallel do reduction (+:c)
12 do i = 1, 10
13 c = c + a
14 end do
15 do i = 1, 10
16 if (c(i) .ne. 10 * a(i)) STOP 2
17 end do
18 !$omp parallel do lastprivate (j)
19 do j = 1, 10, k
20 end do
21 if (j .ne. 11) STOP 3
22 contains
23 subroutine test1
24 integer :: i
25 integer :: b(10)
26 do i = 1, 10
27 b(i) = i
28 end do
29 c(:) = 0
30 !$omp parallel do reduction (+:a)
31 do i = 1, 10
32 a = a + b
33 end do
34 end subroutine test1
35 subroutine test2
36 !$omp parallel do lastprivate (j)
37 do j = 1, 10, k
38 end do
39 if (j .ne. 11) STOP 4
40 end subroutine test2
41 end program foo