* c-c++-common/Wrestrict.c (test_strcpy_range): Revert latest change.
[official-gcc.git] / libgomp / testsuite / libgomp.oacc-c-c++-common / present-1.c
blob61c8109a7e0ca8fd7dcc34910e7f7ca5d131f7c6
1 /* { dg-do run } */
2 /* { dg-skip-if "" { *-*-* } { "*" } { "-DACC_MEM_SHARED=0" } } */
4 #include <openacc.h>
5 #include <string.h>
6 #include <stdio.h>
7 #include <stdlib.h>
8 #include <stdbool.h>
10 int
11 main (int argc, char **argv)
13 int N = 8;
14 float *a, *b, *c, *d;
15 int i;
17 a = (float *) malloc (N * sizeof (float));
18 b = (float *) malloc (N * sizeof (float));
19 c = (float *) malloc (N * sizeof (float));
21 d = (float *) acc_malloc (N * sizeof (float));
22 acc_map_data (c, d, N * sizeof (float));
24 fprintf (stderr, "CheCKpOInT\n");
25 #pragma acc data present (a[0:N]) present (c[0:N]) present (b[0:N])
27 #pragma acc parallel
29 int ii;
31 for (ii = 0; ii < N; ii++)
33 c[ii] = a[ii];
34 b[ii] = c[ii];
39 d = (float *) acc_deviceptr (c);
40 acc_unmap_data (c);
41 acc_free (d);
43 free (a);
44 free (b);
45 free (c);
47 return 0;
50 /* { dg-output "CheCKpOInT(\n|\r\n|\r).*" } */
51 /* { dg-output "present clause: !acc_is_present" } */
52 /* { dg-shouldfail "" } */