| 1 |
/* Exercise an invalid acc_present_or_create. */ |
| 2 |
|
| 3 |
/* { dg-skip-if "" { *-*-* } { "*" } { "-DACC_MEM_SHARED=0" } } */ |
| 4 |
|
| 5 |
#include <stdio.h> |
| 6 |
#include <stdlib.h> |
| 7 |
#include <openacc.h> |
| 8 |
|
| 9 |
int |
| 10 |
main (int argc, char **argv) |
| 11 |
{ |
| 12 |
const int N = 256; |
| 13 |
unsigned char *h; |
| 14 |
void *d1, *d2; |
| 15 |
|
| 16 |
h = (unsigned char *) malloc (N); |
| 17 |
|
| 18 |
d1 = acc_present_or_create (h, N); |
| 19 |
if (!d1) |
| 20 |
abort (); |
| 21 |
|
| 22 |
fprintf (stderr, "CheCKpOInT\n"); |
| 23 |
d2 = acc_present_or_create (h + 2, N); |
| 24 |
if (!d2) |
| 25 |
abort (); |
| 26 |
|
| 27 |
if (d1 != d2) |
| 28 |
abort (); |
| 29 |
|
| 30 |
acc_delete (h, N); |
| 31 |
|
| 32 |
free (h); |
| 33 |
|
| 34 |
return 0; |
| 35 |
} |
| 36 |
|
| 37 |
/* { dg-output "CheCKpOInT(\n|\r\n|\r).*" } */ |
| 38 |
/* { dg-output "\\\[\[0-9a-fA-FxX\]+,\\\+256\\\] not mapped" } */ |
| 39 |
/* { dg-shouldfail "" } */ |