00001 /* PR c++/26943 */ 00002 /* { dg-do run } */ 00003 00004 extern void abort (void); 00005 extern void omp_set_dynamic (int); 00006 int n = 6; 00007 00008 int 00009 main (void) 00010 { 00011 int i, x = 0; 00012 omp_set_dynamic (0); 00013 #pragma omp parallel for num_threads (16) firstprivate (n) lastprivate (n) \ 00014 schedule (static, 1) reduction (+: x) 00015 for (i = 0; i < 16; i++) 00016 { 00017 if (n != 6) 00018 ++x; 00019 n = i; 00020 } 00021 if (x || n != 15) 00022 abort (); 00023 return 0; 00024 }