Mercurial > hg > CbC > CbC_gcc
comparison libgomp/testsuite/libgomp.fortran/pr42162.f90 @ 51:ae3a4bfb450b
add some files of version 4.4.3 that have been forgotten.
author | kent <kent@cr.ie.u-ryukyu.ac.jp> |
---|---|
date | Sun, 07 Feb 2010 18:27:48 +0900 |
parents | |
children | 84e7813d76e9 |
comparison
equal
deleted
inserted
replaced
47:3bfb6c00c1e0 | 51:ae3a4bfb450b |
---|---|
1 ! PR fortran/42162 | |
2 ! { dg-do run } | |
3 | |
4 subroutine sub1(k, a) | |
5 implicit none | |
6 integer :: k, a(3) | |
7 !$omp do | |
8 do k=1,3 | |
9 a(k) = a(k) + 1 | |
10 enddo | |
11 !$omp end do | |
12 end subroutine sub1 | |
13 | |
14 subroutine sub2(k, a) | |
15 implicit none | |
16 integer :: k, a(3) | |
17 !$omp do private (k) | |
18 do k=1,3 | |
19 a(k) = a(k) + 1 | |
20 enddo | |
21 !$omp end do | |
22 end subroutine sub2 | |
23 | |
24 subroutine sub3(k, a) | |
25 implicit none | |
26 integer :: k, a(3) | |
27 !$omp do lastprivate (k) | |
28 do k=1,3 | |
29 a(k) = a(k) + 1 | |
30 enddo | |
31 !$omp end do | |
32 end subroutine sub3 | |
33 | |
34 program pr42162 | |
35 implicit none | |
36 integer :: k, a(3), b(3), c(3) | |
37 a = 1 | |
38 b = 2 | |
39 c = 3 | |
40 k = 3 | |
41 !$omp parallel num_threads(3) | |
42 call sub1 (k, a) | |
43 !$omp end parallel | |
44 k = 4 | |
45 !$omp parallel num_threads(3) | |
46 call sub2 (k, b) | |
47 !$omp end parallel | |
48 k = 10 | |
49 !$omp parallel num_threads(3) | |
50 call sub3 (k, c) | |
51 !$omp end parallel | |
52 if (k.ne.4.or.any(a.ne.2).or.any(b.ne.3).or.any(c.ne.4)) call abort | |
53 end |