comparison libgomp/testsuite/libgomp.fortran/nestedfn4.f90 @ 0:a06113de4d67

first commit
author kent <kent@cr.ie.u-ryukyu.ac.jp>
date Fri, 17 Jul 2009 14:47:48 +0900
parents
children 84e7813d76e9
comparison
equal deleted inserted replaced
-1:000000000000 0:a06113de4d67
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) call abort
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)) call abort
17 end do
18 !$omp parallel do lastprivate (j)
19 do j = 1, 10, k
20 end do
21 if (j .ne. 11) call abort
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) call abort
40 end subroutine test2
41 end program foo