pr24455.c 349 B

123456789101112131415161718192021222324
  1. /* { dg-do run } */
  2. /* { dg-additional-sources pr24455-1.c } */
  3. /* { dg-require-effective-target tls_runtime } */
  4. extern void abort (void);
  5. extern int i;
  6. #pragma omp threadprivate(i)
  7. int main()
  8. {
  9. i = 0;
  10. #pragma omp parallel default(none) num_threads(10)
  11. {
  12. i++;
  13. #pragma omp barrier
  14. if (i != 1)
  15. abort ();
  16. }
  17. return 0;
  18. }