00001 extern void abort (void); 00002 00003 char buf[8] = "01234567"; 00004 char buf2[8] = "23456789"; 00005 00006 int 00007 main (void) 00008 { 00009 char *p, *q; 00010 int sum = 0; 00011 #pragma omp parallel for collapse (2) reduction (+:sum) lastprivate (p, q) 00012 for (p = buf; p < &buf[8]; p++) 00013 for (q = &buf2[0]; q <= buf2 + 7; q++) 00014 sum += (*p - '0') + (*q - '0'); 00015 if (p != &buf[8] || q != buf2 + 8 || sum != 576) 00016 abort (); 00017 return 0; 00018 }