1*404b540aSrobert /* PR c++/26943 */ 2*404b540aSrobert /* { dg-do run } */ 3*404b540aSrobert 4*404b540aSrobert extern void abort (void); 5*404b540aSrobert extern void omp_set_dynamic (int); 6*404b540aSrobert int n = 6; 7*404b540aSrobert 8*404b540aSrobert int main(void)9*404b540aSrobertmain (void) 10*404b540aSrobert { 11*404b540aSrobert int i, x = 0; 12*404b540aSrobert omp_set_dynamic (0); 13*404b540aSrobert #pragma omp parallel for num_threads (16) firstprivate (n) lastprivate (n) \ 14*404b540aSrobert schedule (static, 1) reduction (+: x) 15*404b540aSrobert for (i = 0; i < 16; i++) 16*404b540aSrobert { 17*404b540aSrobert if (n != 6) 18*404b540aSrobert ++x; 19*404b540aSrobert n = i; 20*404b540aSrobert } 21*404b540aSrobert if (x || n != 15) 22*404b540aSrobert abort (); 23*404b540aSrobert return 0; 24*404b540aSrobert } 25