Debian Codegraph @

libgomp/testsuite/libgomp.fortran/unroll-8.f90

raw
1 ! { dg-do run }
2 ! { dg-additional-options "-g" }
3
4 module test_functions
5 contains
6 subroutine copy (array1, array2, step, n)
7 implicit none
8 integer :: array1(n)
9 integer :: array2(n)
10 integer :: i, step, n
11
12 call omp_set_num_threads (4)
13 !$omp parallel do shared(array1) shared(array2) schedule(static, 4) &
14 !$omp & private(i)
15 !$omp unroll partial(2)
16 do i = 1,n
17 array1(i) = array2(i)
18 end do
19 end subroutine
20 end module test_functions
21
22 program test
23 use test_functions
24 implicit none
25 integer :: array1(100), array2(100)
26 integer :: i
27
28 array1 = 2
29 call copy(array1, array2, 1, 100)
30 do i=1,100
31 if (array1(i) /= array2(i)) then
32 stop 1
33 end if
34 end do
35 end program