]> git.ipfire.org Git - thirdparty/gcc.git/blob - gcc/testsuite/gcc.dg/gomp/appendix-a/a.32.1.c
[multiple changes]
[thirdparty/gcc.git] / gcc / testsuite / gcc.dg / gomp / appendix-a / a.32.1.c
1 /* { dg-do compile } */
2 /* { dg-require-effective-target tls } */
3
4 #include <stdlib.h>
5 float *work;
6 int size;
7 float tol;
8 void build (void);
9 #pragma omp threadprivate(work,size,tol)
10 void
11 a32 (float t, int n)
12 {
13 tol = t;
14 size = n;
15 #pragma omp parallel copyin(tol,size)
16 {
17 build ();
18 }
19 }
20 void
21 build ()
22 {
23 int i;
24 work = (float *) malloc (sizeof (float) * size);
25 for (i = 0; i < size; ++i)
26 work[i] = tol;
27 }