nestedfn3.f90 390 B

12345678910111213141516171819202122232425
  1. ! PR middle-end/28790
  2. ! { dg-do run }
  3. program nestomp
  4. integer :: j
  5. j = 8
  6. call bar
  7. if (j.ne.10) call abort
  8. contains
  9. subroutine foo (i)
  10. integer :: i
  11. !$omp atomic
  12. j = j + i - 5
  13. end subroutine
  14. subroutine bar
  15. use omp_lib
  16. integer :: i
  17. i = 6
  18. call omp_set_dynamic (.false.)
  19. !$omp parallel num_threads (2)
  20. call foo(i)
  21. !$omp end parallel
  22. end subroutine
  23. end