Mercurial > hg > CbC > CbC_gcc
comparison libgomp/testsuite/libgomp.fortran/reduction5.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 ! { dg-do run } | |
2 | |
3 module reduction5 | |
4 intrinsic ior, min, max | |
5 end module reduction5 | |
6 | |
7 call test1 | |
8 call test2 | |
9 contains | |
10 subroutine test1 | |
11 use reduction5, bitwise_or => ior | |
12 integer :: n | |
13 n = Z'f' | |
14 !$omp parallel sections num_threads (3) reduction (bitwise_or: n) | |
15 n = ior (n, Z'20') | |
16 !$omp section | |
17 n = bitwise_or (Z'410', n) | |
18 !$omp section | |
19 n = bitwise_or (n, Z'2000') | |
20 !$omp end parallel sections | |
21 if (n .ne. Z'243f') call abort | |
22 end subroutine | |
23 subroutine test2 | |
24 use reduction5, min => max, max => min | |
25 integer :: m, n | |
26 m = 8 | |
27 n = 4 | |
28 !$omp parallel sections num_threads (3) reduction (min: n) & | |
29 !$omp & reduction (max: m) | |
30 if (m .gt. 13) m = 13 | |
31 if (n .lt. 11) n = 11 | |
32 !$omp section | |
33 if (m .gt. 5) m = 5 | |
34 if (n .lt. 15) n = 15 | |
35 !$omp section | |
36 if (m .gt. 3) m = 3 | |
37 if (n .lt. -1) n = -1 | |
38 !$omp end parallel sections | |
39 if (m .ne. 3 .or. n .ne. 15) call abort | |
40 end subroutine test2 | |
41 end | |
42 | |
43 ! { dg-final { cleanup-modules "reduction5" } } |