| 1 |
/* Verify that we refuse 'acc_map_data' when the "host address [...] is already |
| 2 |
mapped". */ |
| 3 |
|
| 4 |
/* { dg-skip-if "" { *-*-* } { "*" } { "-DACC_MEM_SHARED=0" } } */ |
| 5 |
|
| 6 |
#include <assert.h> |
| 7 |
#include <stdio.h> |
| 8 |
#include <stdlib.h> |
| 9 |
#include <openacc.h> |
| 10 |
|
| 11 |
int |
| 12 |
main () |
| 13 |
{ |
| 14 |
const int N = 102; |
| 15 |
|
| 16 |
char *h = (char *) malloc (N); |
| 17 |
assert (h); |
| 18 |
void *d1 = acc_create (h, N); |
| 19 |
assert (d1); |
| 20 |
|
| 21 |
void *d2 = acc_malloc (N); |
| 22 |
assert (d2); |
| 23 |
fprintf (stderr, "CheCKpOInT\n"); |
| 24 |
acc_map_data (h, d2, N); |
| 25 |
|
| 26 |
return 0; |
| 27 |
} |
| 28 |
|
| 29 |
|
| 30 |
/* { dg-output "CheCKpOInT(\n|\r\n|\r).*" } */ |
| 31 |
/* { dg-output "host address \\\[\[0-9a-fA-FxX\]+, \\\+102\\\] is already mapped" } */ |
| 32 |
/* { dg-shouldfail "" } */ |