* c-c++-common/Wrestrict.c (test_strcpy_range): Revert latest change.
[official-gcc.git] / libgomp / testsuite / libgomp.oacc-c-c++-common / present-2.c
blob41efa70e4ec7606909fb6e8af704432da85d0914
1 /* { dg-do run } */
2 /* { dg-skip-if "" { *-*-* } { "*" } { "-DACC_MEM_SHARED=0" } } */
4 #include <openacc.h>
5 #include <stdlib.h>
7 int
8 main (int argc, char **argv)
10 int N = 8;
11 float *a, *b;
12 int i;
14 a = (float *) malloc (N * sizeof (float));
15 b = (float *) malloc (N * sizeof (float));
17 for (i = 0; i < N; i++)
19 a[i] = 4.0;
20 b[i] = 0.0;
23 #pragma acc data copyin(a[0:N]) copyout(b[0:N])
26 #pragma acc parallel present(a[0:N])
28 int ii;
30 for (ii = 0; ii < N; ii++)
32 b[ii] = a[ii];
38 for (i = 0; i < N; i++)
40 if (a[i] != 4.0)
41 abort ();
43 if (b[i] != 4.0)
44 abort ();
47 return 0;