Update 'Q' constraint documentation.
[official-gcc.git] / libgomp / testsuite / libgomp.oacc-c-c++-common / pr88288.c
blobd13e3359a3ec41c2d2bf48640e5aa513c57b38f4
1 /* Test present data clauses in acc offloaded regions when the
2 subarray inside the present clause does not have the same base
3 offset value as the subarray in the enclosing acc data or acc enter
4 data variable. */
6 #include <assert.h>
8 void
9 offset (int *data, int n)
11 int i;
13 #pragma acc parallel loop present (data[0:n])
14 for (i = 0; i < n; i++)
15 data[i] = n;
18 int
19 main ()
21 const int n = 30;
22 int data[n], i;
24 for (i = 0; i < n; i++)
25 data[i] = -1;
27 #pragma acc data copy(data[0:n])
29 offset (data + 10, 10);
32 for (i = 0; i < n; i++)
34 if (i < 10 || i >= 20)
35 assert (data[i] == -1);
36 else
37 assert (data[i] == 10);
40 return 0;