Daily bump.
[gcc-git-mirror.git] / libgomp / testsuite / libgomp.fortran / unroll-1.f90
blob1674755b55d64c20a739a51dd2fb8da2a25c4386
1 ! { dg-do run }
3 module test_functions
4 contains
5 integer function compute_sum() result(sum)
6 implicit none
7 integer :: i,j
9 sum = 0
10 !$omp parallel do reduction(+:sum) private(j)
11 do i = 1,10,3
12 !$omp unroll full
13 do j = 1,10,3
14 sum = sum + 1
15 end do
16 end do
17 end function
19 integer function compute_sum2() result(sum)
20 implicit none
21 integer :: i,j
23 sum = 0
24 !$omp parallel do reduction(+:sum) private(i, j)
25 !$omp unroll partial(2)
26 do i = 1,10,3
27 do j = 1,10,3
28 sum = sum + 1
29 end do
30 end do
31 end function
32 end module test_functions
34 program test
35 use test_functions
36 implicit none
38 integer :: result
40 result = compute_sum ()
41 if (result .ne. 16) then
42 stop 1
43 end if
45 result = compute_sum2 ()
46 if (result .ne. 16) then
47 stop 2
48 end if
49 end program