gcc/libgomp/testsuite/libgomp.oacc-c-c++-common/pr92970-1.c
Thomas Schwinge ddb25eb9ca [PR92726, PR92970, PR92984] [OpenACC] Clarify 'acc_delete' etc. for 'NULL'-in, non-present data, or size zero
PR92970 "OpenACC 2.5: 'acc_delete' etc. on non-present data is a no-op" is an
actual bug fix, and the other ones are fall-out, currently undefined behavior.

	libgomp/
	PR libgomp/92726
	PR libgomp/92970
	PR libgomp/92984
	* oacc-mem.c (delete_copyout): No-op behavior if 'lookup_host'
	fails.
	(GOACC_enter_exit_data): Simplify accordingly.
	* testsuite/libgomp.oacc-c-c++-common/pr92970-1.c: New file,
	subsuming...
	* testsuite/libgomp.oacc-c-c++-common/lib-17.c: ... this file...
	* testsuite/libgomp.oacc-c-c++-common/lib-18.c: ..., and this
	file.
	* testsuite/libgomp.oacc-c-c++-common/pr92984-1.c: New file,
	subsuming...
	* testsuite/libgomp.oacc-c-c++-common/lib-21.c: ... this file...
	* testsuite/libgomp.oacc-c-c++-common/lib-29.c: ..., and this
	file.
	* testsuite/libgomp.oacc-c-c++-common/pr92726-1.c: New file,
	subsuming...
	* testsuite/libgomp.oacc-c-c++-common/lib-28.c: ... this file.

From-SVN: r279532
2019-12-18 18:01:11 +01:00

34 lines
870 B
C

/* Verify that 'acc_delete' etc. on non-present data is a no-op. */
#include <openacc.h>
int
main ()
{
int a;
int async = 0;
#pragma acc exit data copyout (a)
acc_copyout (&a, sizeof a);
#pragma acc exit data copyout (a) async (async++)
acc_copyout_async (&a, sizeof a, async++);
#pragma acc exit data copyout (a) finalize
acc_copyout_finalize (&a, sizeof a);
#pragma acc exit data copyout (a) finalize async (async++)
acc_copyout_finalize_async (&a, sizeof a, async++);
#pragma acc exit data delete (a)
acc_delete (&a, sizeof a);
#pragma acc exit data delete (a) async (async++)
acc_delete_async (&a, sizeof a, async++);
#pragma acc exit data delete (a) finalize
acc_delete_finalize (&a, sizeof a);
#pragma acc exit data delete (a) finalize async (async++)
acc_delete_finalize_async (&a, sizeof a, async++);
acc_wait_all ();
return 0;
}