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