1 /* { dg-do compile } */
2 /* { dg-require-effective-target tls_native } */
4 extern int omp_get_num_threads (void);
6 #pragma omp threadprivate(x)
13 #pragma omp parallel default(none) private(a) shared(z)
15 int j
= omp_get_num_threads ();
16 /* O.K. - j is declared within parallel region */
17 /* O.K. - a is listed in private clause */
18 /* - z is listed in shared clause */
19 x
= c
; /* O.K. - x is threadprivate */
20 /* - c has const-qualified type */
22 /* { dg-error "'i' not specified" "" { target *-*-* } 21 } */
23 /* { dg-error "enclosing parallel" "" { target *-*-* } 13 } */
24 /* { dg-error "'y' not specified" "" { target *-*-* } 21 } */
25 #pragma omp for firstprivate(y)
26 for (i
= 0; i
< 10; i
++)
28 z
[i
] = y
; /* O.K. - i is the loop iteration variable */
29 /* - y is listed in firstprivate clause */
32 /* { dg-error "'l' not specified" "" { target *-*-* } 31 } */
33 /* { dg-error "'t' not specified" "" { target *-*-* } 31 } */