testsuite/libgomp.c/copyin-1.c

Go to the documentation of this file.
00001 /* { dg-do run } */
00002 /* { dg-options "-O2" } */
00003 /* { dg-require-effective-target tls_runtime } */
00004 
00005 #include <omp.h>
00006 #include <stdlib.h>
00007 
00008 int thr = 32;
00009 #pragma omp threadprivate (thr)
00010 
00011 int
00012 main (void)
00013 {
00014   int l = 0;
00015 
00016   omp_set_dynamic (0);
00017   omp_set_num_threads (6);
00018 
00019 #pragma omp parallel copyin (thr) reduction (||:l)
00020   {
00021     l = thr != 32;
00022     thr = omp_get_thread_num () + 11;
00023   }
00024 
00025   if (l || thr != 11)
00026     abort ();
00027 
00028 #pragma omp parallel reduction (||:l)
00029   l = thr != omp_get_thread_num () + 11;
00030 
00031   if (l)
00032     abort ();
00033   return 0;
00034 }

Generated on Fri Apr 5 05:38:10 2013 for Libgomp by  doxygen 1.4.7