threadprivate1.f90 475 B

12345678910111213141516171819202122
  1. ! { dg-do run }
  2. ! { dg-require-effective-target tls_runtime }
  3. module threadprivate1
  4. double precision :: d
  5. !$omp threadprivate (d)
  6. end module threadprivate1
  7. !$ use omp_lib
  8. use threadprivate1
  9. logical :: l
  10. l = .false.
  11. !$omp parallel num_threads (4) reduction (.or.:l)
  12. d = omp_get_thread_num () + 6.5
  13. !$omp barrier
  14. if (d .ne. omp_get_thread_num () + 6.5) l = .true.
  15. !$omp end parallel
  16. if (l) call abort ()
  17. end
  18. ! { dg-final { cleanup-modules "threadprivate1" } }