gcc/libgomp/testsuite/libgomp.oacc-c-c++-common/acc_free-pr92503-4.c
Thomas Schwinge 47afc7b4dd [PR92116, PR92877] [OpenACC] Replace 'openacc.data_environ' by standard libgomp mechanics
libgomp/
	PR libgomp/92116
	PR libgomp/92877
	* oacc-mem.c (lookup_dev): Reimplement.  Adjust all users.
	* libgomp.h (struct acc_dispatch_t): Remove 'data_environ' member.
	Adjust all users.
	* testsuite/libgomp.oacc-c-c++-common/acc_free-pr92503-4-2.c:
	Remove XFAIL.
	* testsuite/libgomp.oacc-c-c++-common/acc_free-pr92503-4.c:
	Likewise.
	* testsuite/libgomp.oacc-c-c++-common/pr92877-1.c: New file.

Co-Authored-By: Julian Brown <julian@codesourcery.com>

From-SVN: r279147
2019-12-09 23:52:56 +01:00

31 lines
638 B
C

/* Verify that we refuse 'acc_free', inside 'data'. */
/* { 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);
#pragma acc data create (h[0:N - 21])
{
void *d = acc_deviceptr (h);
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\]+,\\\+87\\\]" }
{ dg-shouldfail "" } */