pr34020.f90: Make compile with TS 18508/Fortran 2015
[official-gcc.git] / libgomp / testsuite / libgomp.fortran / pr34020.f90
blob39f7046d1975602580bf4cbfa919f000770d9bc2
1 ! PR fortran/34020
2 ! { dg-do run }
4 subroutine atomic_add(lhs, rhs)
5 real lhs, rhs
6 !$omp atomic
7 lhs = rhs + lhs
8 end
10 external atomic_add
11 real lhs, rhs
12 integer i
13 lhs = 0
14 rhs = 1
15 !$omp parallel do num_threads(8) shared(lhs, rhs)
16 do i = 1, 300000
17 call atomic_add(lhs, rhs)
18 enddo
19 if (lhs .ne. 300000) call abort
20 end