1  int a, b;
       2  #pragma omp threadprivate (a, b)
       3  
       4  void
       5  foo (void)
       6  {
       7    #pragma omp for				/* { dg-error "threadprivate iteration variable 'a'" } */
       8    for (a = 0; a < 32; a++)
       9      ;
      10    #pragma omp parallel for collapse(2)		/* { dg-error "threadprivate iteration variable 'a'" "" { target c } } */
      11    for (a = 0; a < 32; a++)			/* { dg-error "threadprivate iteration variable 'b'" "" { target c } .-1 } */
      12      for (b = 0; b < 32; b++)			/* { dg-error "threadprivate iteration variable 'a'" "" { target c++ } .-1 } */
      13        ;						/* { dg-error "threadprivate iteration variable 'b'" "" { target c++ } .-2 } */
      14    #pragma omp simd				/* { dg-error "threadprivate iteration variable 'a'" } */
      15    for (a = 0; a < 32; a++)
      16      ;
      17    #pragma omp taskloop				/* { dg-error "threadprivate iteration variable 'a'" } */
      18    for (a = 0; a < 32; a++)
      19      ;
      20    #pragma omp loop bind(thread)			/* { dg-error "threadprivate iteration variable 'a'" } */
      21    for (a = 0; a < 32; a++)
      22      ;
      23  }
      24  
      25  void
      26  bar (void)
      27  {
      28    #pragma omp distribute collapse(2)		/* { dg-error "threadprivate iteration variable 'a'" } */
      29    for (a = 0; a < 32; a++)			/* { dg-error "threadprivate iteration variable 'b'" "" { target *-*-* } .-1 } */
      30      for (b = 0; b < a; b++)
      31        ;
      32    #pragma omp distribute parallel for simd	/* { dg-error "threadprivate iteration variable 'a'" "" { target c } } */
      33    for (a = 0; a < 32; a++)			/* { dg-error "threadprivate iteration variable 'a'" "" { target c++ } } */
      34      ;
      35  }