111
|
1 /* { dg-do run } */
|
|
2 /* { dg-skip-if "" { *-*-* } { "*" } { "-DACC_MEM_SHARED=0" } } */
|
|
3
|
|
4 #include <string.h>
|
|
5 #include <stdlib.h>
|
|
6 #include <openacc.h>
|
|
7
|
|
8 int
|
|
9 main (int argc, char **argv)
|
|
10 {
|
|
11 const int N = 256;
|
|
12 int i;
|
|
13 unsigned char *h;
|
|
14
|
|
15 h = (unsigned char *) malloc (N);
|
|
16
|
|
17 for (i = 0; i < N; i++)
|
|
18 {
|
|
19 h[i] = i;
|
|
20 }
|
|
21
|
|
22 (void) acc_copyin (h, N);
|
|
23
|
|
24 memset (h, 0, N);
|
|
25
|
|
26 acc_copyout (h, N);
|
|
27
|
|
28 for (i = 0; i < N; i++)
|
|
29 {
|
|
30 if (h[i] != i)
|
|
31 abort ();
|
|
32 }
|
|
33
|
|
34 free (h);
|
|
35
|
|
36 return 0;
|
|
37 }
|