gcc/libgomp/testsuite/libgomp.fortran/pr48894.f90
Jakub Jelinek e7385332a0 re PR fortran/48894 (generic omp_get_ancestor_thread_num(l(i)) produces incorrect output)
PR fortran/48894
	* fortran.c: Include limits.h.
	(TO_INT): Define.
	(omp_set_dynamic_8_, omp_set_num_threads_8_): Use !!*set instead of
	*set.
	(omp_set_num_threads_8_, omp_set_schedule_8_,
	omp_set_max_active_levels_8_, omp_get_ancestor_thread_num_8_,
	omp_get_team_size_8_): Use TO_INT macro.
	* testsuite/libgomp.fortran/pr48894.f90: New test.

From-SVN: r173476
2011-05-06 12:11:07 +02:00

24 lines
613 B
Fortran

! PR fortran/48894
! { dg-do run }
! { dg-options "-fdefault-integer-8" }
use omp_lib
integer, parameter :: zero = 0
integer :: err
logical :: l
err = 0
!$omp parallel
!$omp parallel private (l)
l = omp_get_ancestor_thread_num (-HUGE (zero)) .ne. -1
l = l .or. (omp_get_ancestor_thread_num (HUGE (zero)) .ne. -1)
l = l .or. (omp_get_team_size (-HUGE (zero)) .ne. -1)
l = l .or. (omp_get_team_size (HUGE (zero)) .ne. -1)
if (l) then
!$omp atomic
err = err + 1
endif
!$omp end parallel
!$omp end parallel
if (err .ne. 0) call abort
end