testsuite/libgomp.c++/loop-2.C

Go to the documentation of this file.
00001 #include <omp.h>
00002 
00003 /* Orphaned work sharing.  */
00004 
00005 extern "C" void abort (void);
00006 
00007 #define N 10
00008 
00009 void parloop (int *a)
00010 {
00011   int i;
00012 
00013 #pragma omp for
00014   for (i = 0; i < N; i++)
00015     a[i] = i + 3;
00016 }
00017 
00018 main()
00019 {
00020   int i, a[N];
00021 
00022 #pragma omp parallel shared(a)
00023   {
00024     parloop (a);
00025   }
00026 
00027   for (i = 0; i < N; i++)
00028     if (a[i] != i + 3)
00029       abort ();
00030 
00031   return 0;
00032 }

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