2013-06-17 Richard Biener <rguenther@suse.de>
[official-gcc.git] / libgomp / testsuite / libgomp.c / copyin-2.c
blobae2451ef1d857df30e6b1d0939fcaf325bd15c85
1 /* { dg-do run } */
2 /* { dg-options "-O2" } */
3 /* { dg-require-effective-target tls_runtime } */
5 #include <omp.h>
6 #include <stdlib.h>
8 struct { int t; char buf[64]; } thr = { 32, "" };
9 #pragma omp threadprivate (thr)
11 int
12 main (void)
14 int l = 0;
16 omp_set_dynamic (0);
17 omp_set_num_threads (6);
19 #pragma omp parallel copyin (thr) reduction (||:l)
21 l = thr.t != 32;
22 thr.t = omp_get_thread_num () + 11;
25 if (l || thr.t != 11)
26 abort ();
28 #pragma omp parallel reduction (||:l)
29 l = thr.t != omp_get_thread_num () + 11;
31 if (l)
32 abort ();
33 return 0;