summaryrefslogtreecommitdiffstats
path: root/openmp/testsuite/fortran/omp_task_shared.f
diff options
context:
space:
mode:
Diffstat (limited to 'openmp/testsuite/fortran/omp_task_shared.f')
-rw-r--r--openmp/testsuite/fortran/omp_task_shared.f47
1 files changed, 47 insertions, 0 deletions
diff --git a/openmp/testsuite/fortran/omp_task_shared.f b/openmp/testsuite/fortran/omp_task_shared.f
new file mode 100644
index 00000000000..58564b31935
--- /dev/null
+++ b/openmp/testsuite/fortran/omp_task_shared.f
@@ -0,0 +1,47 @@
+<ompts:test>
+<ompts:testdescription> Test to see if implied shared works correctly</ompts:testdescription>
+<ompts:ompversion>3.0</ompts:ompversion>
+<ompts:directive>omp task</ompts:directive>
+<ompts:dependences>omp single, omp task firstprivate</ompts:dependences>
+<ompts:testcode>
+ INCLUDE "omp_my_sleep.f"
+
+ INTEGER FUNCTION <ompts:testcode:functionname>omp_task_shared</ompts:testcode:functionname>()
+ IMPLICIT NONE
+ INCLUDE "omp_testsuite.f"
+ <ompts:orphan:vars>
+ external my_sleep
+ INTEGER i
+ COMMON /orphvars/ i
+ </ompts:orphan:vars>
+ INTEGER rslt
+ INTEGER k
+
+ i = 0
+ k = 0
+ rslt = 0
+
+!$omp parallel private(k) shared(i)
+!$omp single
+ do k=1, NUM_TASKS
+ <ompts:orphan>
+!$omp task <ompts:crosscheck>firstprivate(i)</ompts:crosscheck>
+!$omp+ <ompts:check>shared(i)</ompts:check>
+!$omp atomic
+ i = i + 1
+!$omp end task
+ </ompts:orphan>
+ end do
+!$omp end single
+!$omp end parallel
+
+ rslt = i
+ if (rslt .eq. NUM_TASKS) then
+ <testfunctionname></testfunctionname> = 1
+ else
+ <testfunctionname></testfunctionname> = 0
+ end if
+
+ END FUNCTION
+</ompts:testcode>
+</ompts:test>
OpenPOWER on IntegriCloud