| 1 |
/* Exercise acc_map_data with a NULL data mapping. */ |
| 2 |
|
| 3 |
#include <stdio.h> |
| 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 |
fprintf (stderr, "CheCKpOInT\n"); |
| 19 |
acc_map_data (h, 0, N); |
| 20 |
|
| 21 |
acc_unmap_data (h); |
| 22 |
|
| 23 |
acc_free (d); |
| 24 |
|
| 25 |
free (h); |
| 26 |
|
| 27 |
return 0; |
| 28 |
} |
| 29 |
|
| 30 |
/* { dg-output "CheCKpOInT(\n|\r\n|\r).*" } */ |
| 31 |
/* { dg-output "\\\[\[0-9a-fA-FxX\]+,\\\+256\]->\\\[\[^\n\r]*,\\\+256\\\] is a bad map" { target { ! openacc_host_selected } } } */ |
| 32 |
/* { dg-output "cannot map data on shared-memory system" { target openacc_host_selected } } */ |
| 33 |
/* { dg-shouldfail "" } */ |