diff options
author | Jim Cownie <james.h.cownie@intel.com> | 2014-05-10 17:02:09 +0000 |
---|---|---|
committer | Jim Cownie <james.h.cownie@intel.com> | 2014-05-10 17:02:09 +0000 |
commit | 18d8473f185999e418dcb62ee4d8a671c2eacee5 (patch) | |
tree | d212f5cac426b2be33035984fc56623f92f5ddde /openmp/testsuite/fortran/section_lastprivate.f | |
parent | 281f9d0e97dca0594a15341e3c927e2667773104 (diff) | |
download | bcm5719-llvm-18d8473f185999e418dcb62ee4d8a671c2eacee5.tar.gz bcm5719-llvm-18d8473f185999e418dcb62ee4d8a671c2eacee5.zip |
Add testsuite from OpenUH
llvm-svn: 208472
Diffstat (limited to 'openmp/testsuite/fortran/section_lastprivate.f')
-rw-r--r-- | openmp/testsuite/fortran/section_lastprivate.f | 62 |
1 files changed, 62 insertions, 0 deletions
diff --git a/openmp/testsuite/fortran/section_lastprivate.f b/openmp/testsuite/fortran/section_lastprivate.f new file mode 100644 index 00000000000..5ba71487e90 --- /dev/null +++ b/openmp/testsuite/fortran/section_lastprivate.f @@ -0,0 +1,62 @@ +<ompts:test> +<ompts:testdescription>Test which checks the omp section lastprivate directive.</ompts:testdescription> +<ompts:ompversion>2.0</ompts:ompversion> +<ompts:directive>omp section lastprivate</ompts:directive> +<ompts:testcode> + INTEGER FUNCTION <ompts:testcode:functionname>section_lastprivate</ompts:testcode:functionname>() + INTEGER known_sum + + <ompts:orphan:vars> + INTEGER i, i0, sum, sum0 + COMMON /orphvars/ i,i0,sum + </ompts:orphan:vars> + + sum = 0 + sum0 = 0 + i0 = -1 + +!$omp parallel +<ompts:orphan> +!$omp sections <ompts:check>lastprivate(i0)</ompts:check><ompts:crosscheck>private(i0)</ompts:crosscheck> private(i,sum0) +!$omp section + sum0 = 0 + DO i=1, 399 + sum0 = sum0 + i + i0 = i + END DO +!$omp critical + sum = sum + sum0 +!$omp end critical +!$omp section + sum0 = 0 + DO i=400, 699 + sum0 = sum0 + i + i0 = i + END DO +!$omp critical + sum = sum + sum0 +!$omp end critical +!$omp section + sum0 = 0 + DO i=700, 999 + sum0 = sum0 + i + i0 = i + END DO +!$omp critical + sum = sum + sum0 +!$omp end critical +!$omp end sections +</ompts:orphan> +!$omp end parallel + + known_sum = (999*1000)/2 + IF ( known_sum .EQ. sum .AND. i0 .EQ. 999 ) THEN + <testfunctionname></testfunctionname> = 1 + ELSE + <testfunctionname></testfunctionname> = 0 + END IF + END +</ompts:testcode> +</omts:test> + + |