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/c/omp_parallel_sections_firstprivate.c | |
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/c/omp_parallel_sections_firstprivate.c')
-rw-r--r-- | openmp/testsuite/c/omp_parallel_sections_firstprivate.c | 49 |
1 files changed, 49 insertions, 0 deletions
diff --git a/openmp/testsuite/c/omp_parallel_sections_firstprivate.c b/openmp/testsuite/c/omp_parallel_sections_firstprivate.c new file mode 100644 index 00000000000..2933839022b --- /dev/null +++ b/openmp/testsuite/c/omp_parallel_sections_firstprivate.c @@ -0,0 +1,49 @@ +<ompts:test> +<ompts:testdescription>Test which checks the omp parallel sections firstprivate directive.</ompts:testdescription> +<ompts:ompversion>2.0</ompts:ompversion> +<ompts:directive>omp parallel sections firstprivate</ompts:directive> +<ompts:dependences>omp critical</ompts:dependences> +<ompts:testcode> +#include <stdio.h> +#include "omp_testsuite.h" + +int <ompts:testcode:functionname>omp_parallel_sections_firstprivate</ompts:testcode:functionname>(FILE * logFile){ + <ompts:orphan:vars> + int sum; + int sum0; + </ompts:orphan:vars> + int known_sum; + sum =7; + sum0=11; + +<ompts:orphan> +#pragma omp parallel sections <ompts:check>firstprivate(sum0)</ompts:check><ompts:crosscheck>private(sum0)</ompts:crosscheck> + { +#pragma omp section + { +#pragma omp critical + { + sum= sum+sum0; + } /*end of critical */ + } +#pragma omp section + { +#pragma omp critical + { + sum= sum+sum0; + } /*end of critical */ + } +#pragma omp section + { +#pragma omp critical + { + sum= sum+sum0; + } /*end of critical */ + } + } /*end of parallel sections*/ +</ompts:orphan> +known_sum=11*3+7; +return (known_sum==sum); +} /* end of check_section_firstprivate*/ +</ompts:testcode> +</ompts:test> |