PR target/82855
[official-gcc.git] / libgomp / testsuite / libgomp.c / copyin-2.c
bloba7b05973482ff8c7f37f67a3cd26d50f78b70ad3
1 /* { dg-do run } */
2 /* { dg-require-effective-target tls_runtime } */
4 #include <omp.h>
5 #include <stdlib.h>
7 struct { int t; char buf[64]; } thr = { 32, "" };
8 #pragma omp threadprivate (thr)
10 int
11 main (void)
13 int l = 0;
15 omp_set_dynamic (0);
16 omp_set_num_threads (6);
18 #pragma omp parallel copyin (thr) reduction (||:l)
20 l = thr.t != 32;
21 thr.t = omp_get_thread_num () + 11;
24 if (l || thr.t != 11)
25 abort ();
27 #pragma omp parallel reduction (||:l)
28 l = thr.t != omp_get_thread_num () + 11;
30 if (l)
31 abort ();
32 return 0;