Mercurial > hg > CbC > CbC_gcc
comparison libgomp/testsuite/libgomp.fortran/retval2.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 function f1 () | |
4 real :: f1 | |
5 f1 = 6.5 | |
6 call sub1 | |
7 contains | |
8 subroutine sub1 | |
9 use omp_lib | |
10 logical :: l | |
11 l = .false. | |
12 !$omp parallel firstprivate (f1) num_threads (2) reduction (.or.:l) | |
13 l = f1 .ne. 6.5 | |
14 if (omp_get_thread_num () .eq. 0) f1 = 8.5 | |
15 if (omp_get_thread_num () .eq. 1) f1 = 14.5 | |
16 !$omp barrier | |
17 l = l .or. (omp_get_thread_num () .eq. 0 .and. f1 .ne. 8.5) | |
18 l = l .or. (omp_get_thread_num () .eq. 1 .and. f1 .ne. 14.5) | |
19 !$omp end parallel | |
20 if (l) call abort | |
21 f1 = -2.5 | |
22 end subroutine sub1 | |
23 end function f1 | |
24 | |
25 real :: f1 | |
26 if (f1 () .ne. -2.5) call abort | |
27 end |