summaryrefslogtreecommitdiff
path: root/libgomp/testsuite/libgomp.fortran/recursion1.f90
blob: 35cb8786e09778eb0100a2ab9ed01948ccf06db9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
! { dg-do run }
! { dg-options "-fopenmp -fcheck=recursion" }
!
! PR 42517: Bogus runtime error with -fopenmp -fcheck=recursion
!
! Contributed by Janus Weil <janus@gcc.gnu.org>

implicit none
integer :: i,s

s=0
!$omp parallel do private(i) shared(s)
do i=1,10
  call sub(i)
end do
!$omp end parallel do
if (s/=55) call abort()

contains

  subroutine sub (n)
    integer :: n
!$omp atomic
    s = s + n
    print '(A,i3)',"loop =",n
  end subroutine

end