| 1 |
/* { dg-skip-if "" { *-*-* } { "*" } { "-DACC_MEM_SHARED=0" } } */ |
| 2 |
|
| 3 |
#include <stdio.h> |
| 4 |
#include <stdlib.h> |
| 5 |
#include <openacc.h> |
| 6 |
#include <stdint.h> |
| 7 |
|
| 8 |
int |
| 9 |
main (int argc, char **argv) |
| 10 |
{ |
| 11 |
const int N = 512; |
| 12 |
void *d; |
| 13 |
|
| 14 |
d = acc_malloc (N); |
| 15 |
if (d == NULL) |
| 16 |
abort (); |
| 17 |
|
| 18 |
fprintf (stderr, "CheCKpOInT\n"); |
| 19 |
acc_free ((void *)((uintptr_t) d + (uintptr_t) (N >> 1))); |
| 20 |
|
| 21 |
return 0; |
| 22 |
} |
| 23 |
|
| 24 |
/* { dg-output "CheCKpOInT(\n|\r\n|\r)+" } */ |
| 25 |
/* { dg-output "libgomp: invalid device address(\n|\r\n|\r)+" { target openacc_nvidia_accel_selected } } */ |
| 26 |
/* { dg-output "libgomp: GCN fatal error: Could not free device memory(\n|\r\n|\r)+" { target openacc_radeon_accel_selected } } |
| 27 |
{ dg-output "Runtime message: HSA_STATUS_ERROR_INVALID_ALLOCATION: The requested allocation is not valid\.(\n|\r\n|\r)+" { target openacc_radeon_accel_selected } } */ |
| 28 |
/* { dg-output "libgomp: error in freeing device memory in acc_free(\n|\r\n|\r)+$" } */ |
| 29 |
/* { dg-shouldfail "" } */ |