Mercurial > hg > CbC > CbC_gcc
annotate libgomp/testsuite/libgomp.fortran/pr34020.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 | 04ced10e8804 |
rev | line source |
---|---|
0 | 1 ! PR fortran/34020 |
2 ! { dg-do run } | |
3 | |
4 subroutine atomic_add(lhs, rhs) | |
5 real lhs, rhs | |
6 !$omp atomic | |
7 lhs = rhs + lhs | |
8 end | |
9 | |
10 real lhs, rhs | |
11 integer i | |
12 lhs = 0 | |
13 rhs = 1 | |
14 !$omp parallel do num_threads(8) shared(lhs, rhs) | |
15 do i = 1, 300000 | |
16 call atomic_add(lhs, rhs) | |
17 enddo | |
18 if (lhs .ne. 300000) call abort | |
19 end |