Commit 7d020473 by Thomas Schwinge Committed by Thomas Schwinge

[PR92854] Add 'libgomp.oacc-c-c++-common/pr92854-1.c'

... to document the status quo.

	libgomp/
	PR libgomp/92854
	* testsuite/libgomp.oacc-c-c++-common/pr92854-1.c: New file.

From-SVN: r279120
parent 1e1fb715
2019-12-09 Thomas Schwinge <thomas@codesourcery.com>
PR libgomp/92854
* testsuite/libgomp.oacc-c-c++-common/pr92854-1.c: New file.
* testsuite/libgomp.oacc-c-c++-common/host_data-6.c: New file.
* target.c (gomp_exit_data): Use 'gomp_remove_var'.
......
/* Verify that 'acc_unmap_data' unmaps even in presence of dynamic reference
counts. */
/* { dg-skip-if "" { *-*-* } { "*" } { "-DACC_MEM_SHARED=0" } } */
#include <assert.h>
#include <stdlib.h>
#include <openacc.h>
int
main ()
{
const int N = 180;
char *h = (char *) malloc (N);
char *d = (char *) acc_malloc (N);
if (!d)
abort ();
acc_map_data (h, d, N);
char *d_ = (char *) acc_create (h + 3, N - 77);
assert (d_ == d + 3);
d_ = (char *) acc_create (h, N);
assert (d_ == d);
acc_unmap_data (h);
assert (!acc_is_present (h, N));
return 0;
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment