1 void __attribute__((noinline, noclone))
foo(int j,int n,int * a)2 foo (int j, int n, int *a)
3 {
4 int i;
5 #pragma omp target
6 #pragma omp teams
7 #pragma omp distribute parallel for shared(a) firstprivate(n) private(i) firstprivate(j)
8 for (i = j + 1; i < n; i++)
9 a[i] = i;
10 }
11
main(int argc,char ** argv)12 int main (int argc, char **argv)
13 {
14 int n = 32;
15 int *a = __builtin_malloc (sizeof (int) * n);
16 int i, j = 4;
17
18 __builtin_memset (a, 0, sizeof (int) * n);
19 foo (j, n, a);
20 for (i = j + 1; i < n; i ++)
21 {
22 if (a[i] != i)
23 __builtin_abort ();
24 }
25 return 0;
26 }
27