OpenCores
URL https://opencores.org/ocsvn/openrisc/openrisc/trunk

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [libgomp/] [testsuite/] [libgomp.fortran/] [nested1.f90] - Rev 865

Go to most recent revision | Compare with Previous | Blame | View Log

! { dg-do run }
program nested1
  use omp_lib
  integer :: e1, e2, e3, e
  integer :: tn1, tn2, tn3
  e1 = 0
  e2 = 0
  e3 = 0
  call omp_set_nested (.true.)
  call omp_set_dynamic (.false.)
  if (omp_in_parallel ()) call abort
  if (omp_get_num_threads ().ne.1) call abort
  if (omp_get_level ().ne.0) call abort
  if (omp_get_ancestor_thread_num (0).ne.0) call abort
  if (omp_get_ancestor_thread_num (-1).ne.-1) call abort
  if (omp_get_ancestor_thread_num (1).ne.-1) call abort
  if (omp_get_team_size (0).ne.1) call abort
  if (omp_get_team_size (-1).ne.-1) call abort
  if (omp_get_team_size (1).ne.-1) call abort
  if (omp_get_active_level ().ne.0) call abort
!$omp parallel num_threads (4) private (e, tn1)
  e = 0
  tn1 = omp_get_thread_num ()
  if (.not.omp_in_parallel ()) e = e + 1
  if (omp_get_num_threads ().ne.4) e = e + 1
  if (tn1.lt.0.or.tn1.ge.4) e = e + 1
  if (omp_get_level ().ne.1) e = e + 1
  if (omp_get_ancestor_thread_num (0).ne.0) e = e + 1
  if (omp_get_ancestor_thread_num (1).ne.tn1) e = e + 1
  if (omp_get_ancestor_thread_num (-1).ne.-1) e = e + 1
  if (omp_get_ancestor_thread_num (2).ne.-1) e = e + 1
  if (omp_get_team_size (0).ne.1) e = e + 1
  if (omp_get_team_size (1).ne.4) e = e + 1
  if (omp_get_team_size (-1).ne.-1) e = e + 1
  if (omp_get_team_size (2).ne.-1) e = e + 1
  if (omp_get_active_level ().ne.1) e = e + 1
  !$omp atomic
    e1 = e1 + e
!$omp parallel num_threads (5) if (.false.) firstprivate (tn1) &
!$omp& private (e, tn2)
  e = 0
  tn2 = omp_get_thread_num ()
  if (.not.omp_in_parallel ()) e = e + 1
  if (omp_get_num_threads ().ne.1) e = e + 1
  if (tn2.ne.0) e = e + 1
  if (omp_get_level ().ne.2) e = e + 1
  if (omp_get_ancestor_thread_num (0).ne.0) e = e + 1
  if (omp_get_ancestor_thread_num (1).ne.tn1) e = e + 1
  if (omp_get_ancestor_thread_num (2).ne.tn2) e = e + 1
  if (omp_get_ancestor_thread_num (-1).ne.-1) e = e + 1
  if (omp_get_ancestor_thread_num (3).ne.-1) e = e + 1
  if (omp_get_team_size (0).ne.1) e = e + 1
  if (omp_get_team_size (1).ne.4) e = e + 1
  if (omp_get_team_size (2).ne.1) e = e + 1
  if (omp_get_team_size (-1).ne.-1) e = e + 1
  if (omp_get_team_size (3).ne.-1) e = e + 1
  if (omp_get_active_level ().ne.1) e = e + 1
  !$omp atomic
    e2 = e2 + e
!$omp parallel num_threads (2) firstprivate (tn1, tn2) &
!$omp& private (e, tn3)
  e = 0
  tn3 = omp_get_thread_num ()
  if (.not.omp_in_parallel ()) e = e + 1
  if (omp_get_num_threads ().ne.2) e = e + 1
  if (tn3.lt.0.or.tn3.ge.2) e = e + 1
  if (omp_get_level ().ne.3) e = e + 1
  if (omp_get_ancestor_thread_num (0).ne.0) e = e + 1
  if (omp_get_ancestor_thread_num (1).ne.tn1) e = e + 1
  if (omp_get_ancestor_thread_num (2).ne.tn2) e = e + 1
  if (omp_get_ancestor_thread_num (3).ne.tn3) e = e + 1
  if (omp_get_ancestor_thread_num (-1).ne.-1) e = e + 1
  if (omp_get_ancestor_thread_num (4).ne.-1) e = e + 1
  if (omp_get_team_size (0).ne.1) e = e + 1
  if (omp_get_team_size (1).ne.4) e = e + 1
  if (omp_get_team_size (2).ne.1) e = e + 1
  if (omp_get_team_size (3).ne.2) e = e + 1
  if (omp_get_team_size (-1).ne.-1) e = e + 1
  if (omp_get_team_size (4).ne.-1) e = e + 1
  if (omp_get_active_level ().ne.2) e = e + 1
  !$omp atomic
    e3 = e3 + e
!$omp end parallel
!$omp end parallel
!$omp end parallel
  if (e1.ne.0.or.e2.ne.0.or.e3.ne.0) call abort
end program nested1

Go to most recent revision | Compare with Previous | Blame | View Log

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.