testsuite/libgomp.c/loop-8.c

Go to the documentation of this file.
00001 extern void abort (void);
00002 
00003 int buf[256];
00004 
00005 void __attribute__((noinline))
00006 foo (void)
00007 {
00008   int i;
00009   #pragma omp for schedule (auto)
00010     for (i = 0; i < 256; i++)
00011       buf[i] += i;
00012 }
00013 
00014 int
00015 main (void)
00016 {
00017   int i;
00018   #pragma omp parallel for schedule (auto)
00019     for (i = 0; i < 256; i++)
00020       buf[i] = i;
00021   #pragma omp parallel num_threads (4)
00022     foo ();
00023   for (i = 0; i < 256; i++)
00024     if (buf[i] != 2 * i)
00025       abort ();
00026   return 0;
00027 }

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