1 /* { dg-do compile } */
2 /* { dg-require-effective-target tls_native } */
7 #pragma omp threadprivate (thrglobalvar)
9 const int constvar = 8;
27 #pragma omp threadprivate (thrlocvar)
32 p = malloc (sizeof (int));
38 #pragma omp parallel for /* { dg-error "enclosing parallel" } */ \
39 default (none) private (p) shared (s)
40 for (i = 0; i < 64; i++)
42 int k = foo (0); /* Predetermined - private (automatic var declared */
43 k++; /* in scope of construct). */
44 thrglobalvar++; /* Predetermined - threadprivate. */
45 thrlocvar++; /* Predetermined - threadprivate. */
46 foo (i); /* Predetermined - private (omp for loop variable). */
47 foo (constvar); /* Predetermined - shared (const qualified type). */
48 foo (*p); /* *p predetermined - shared (heap allocated */
49 (*p)++; /* storage). */
50 bar (p); /* Explicitly determined - private. */
51 foo (s); /* Explicitly determined - shared. */
52 globalvar++; /* { dg-error "not specified in" } */
53 locvar++; /* { dg-error "not specified in" } */
54 l++; /* { dg-error "not specified in" } */
55 for (j = 0; j < 2; j++); /* { dg-error "not specified in" } */