summaryrefslogtreecommitdiff
path: root/libgomp/testsuite/libgomp.fortran/threadprivate1.f90
blob: 32161426bdef512b22eba67b63f4b161db178610 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
! { dg-do run }
! { dg-require-effective-target tls_runtime }

module threadprivate1
  double precision :: d
!$omp threadprivate (d)
end module threadprivate1

!$ use omp_lib
  use threadprivate1
  logical :: l
  l = .false.
!$omp parallel num_threads (4) reduction (.or.:l)
  d = omp_get_thread_num () + 6.5
!$omp barrier
  if (d .ne. omp_get_thread_num () + 6.5) l = .true.
!$omp end parallel
  if (l) call abort ()
end

! { dg-final { cleanup-modules "threadprivate1" } }