Test which checks the if clause of the omp task directive. The idear of the tests is to generate a tasks in a single region and pause it immediately. The parent thread now shall set a counter variable which the paused task shall evaluate when woke up.
3.0
omp task if
omp single,omp flush
INCLUDE "omp_my_sleep.f"
INTEGER FUNCTION omp_task_if()
IMPLICIT NONE
INCLUDE "omp_testsuite.f"
external my_sleep
INTEGER dummy
LOGICAL condition_false
INTEGER cnt
INTEGER rslt
COMMON /orphvars/ condition_false, cnt, rslt
cnt = 0
condition_false = (dummy .eq. 314159)
!$omp parallel
!$omp single
!$omp task if (condition_false) shared(cnt,rslt)
call my_sleep(SLEEPTIME_LONG)
!$omp flush
if (cnt .eq. 0) then
rslt = 1
else
rslt = 0
end if
!$omp end task
cnt = 1
!$omp end single
!$omp end parallel
= rslt
END FUNCTION