Projet_SETI_RISC-V/riscv-gnu-toolchain/gcc/libgomp/testsuite/libgomp.oacc-c-c++-common/acc_free-pr92503-2.c
2023-03-06 14:48:14 +01:00

27 lines
592 B
C

/* Verify that we refuse 'acc_free', after 'acc_create'. */
/* { dg-skip-if "" { *-*-* } { "*" } { "-DACC_MEM_SHARED=0" } } */
#include <stdio.h>
#include <stdlib.h>
#include <openacc.h>
int
main ()
{
const int N = 108;
char *h = (char *) malloc (N);
void *d = acc_create (h, N - 1);
if (!d)
abort ();
fprintf (stderr, "CheCKpOInT\n");
acc_free (d);
return 0;
}
/* { dg-output "CheCKpOInT(\n|\r\n|\r).*" }
{ dg-output "refusing to free device memory space at \[0-9a-fA-FxX\]+ that is still mapped at \\\[\[0-9a-fA-FxX\]+,\\\+107\\\]" }
{ dg-shouldfail "" } */